cvs: php-src(PHP_5_0) /ext/mcve config.m4 mcve.c

From: Date: Wed, 08 Dec 2004 03:08:39 +0000
Subject: cvs: php-src(PHP_5_0) /ext/mcve config.m4 mcve.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-29477@lists.php.net to get a copy of this message
bradmssw Tue Dec 7 22:08:39 2004 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/mcve config.m4 mcve.c Log: backport from head. compatability fix with libmonetra 4.2 and higher (still works with older releases too). http://cvs.php.net/diff.php/php-src/ext/mcve/config.m4?r1=1.10&r2=1.10.2.1&ty=u Index: php-src/ext/mcve/config.m4 diff -u php-src/ext/mcve/config.m4:1.10 php-src/ext/mcve/config.m4:1.10.2.1 --- php-src/ext/mcve/config.m4:1.10 Sun May 30 10:33:44 2004 +++ php-src/ext/mcve/config.m4 Tue Dec 7 22:08:37 2004 @@ -51,6 +51,20 @@ ],[ AC_MSG_ERROR([libmcve 3.2.2 or greater required.]) ]) + + AC_MSG_CHECKING([for correct libmonetra 4.2 or higher]) + AC_EGREP_CPP(yes,[ +#include "$MCVE_DIR/include/mcve.h" +#ifdef MCVE_SetSSL_CAfile +yes +#endif + ],[ + AC_MSG_RESULT([yes]) + ],[ + AC_DEFINE([LIBMONETRA_BELOW_4_2], 1, [Whether or not we're using libmonetra 4.2 or higher ]) + AC_MSG_ERROR([no]) + ]) + CPPFLAGS=$saved_CPPFLAGS PHP_ADD_INCLUDE($MCVE_DIR/include) http://cvs.php.net/diff.php/php-src/ext/mcve/mcve.c?r1=1.28&r2=1.28.2.1&ty=u Index: php-src/ext/mcve/mcve.c diff -u php-src/ext/mcve/mcve.c:1.28 php-src/ext/mcve/mcve.c:1.28.2.1 --- php-src/ext/mcve/mcve.c:1.28 Sun May 30 18:41:13 2004 +++ php-src/ext/mcve/mcve.c Tue Dec 7 22:08:38 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mcve.c,v 1.28 2004/05/30 22:41:13 bradmssw Exp $ */ +/* $Id: mcve.c,v 1.28.2.1 2004/12/08 03:08:38 bradmssw Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -25,6 +25,14 @@ #include "php.h" +#if PHP_WIN32 +#include "config.w32.h" +#elif defined NETWARE +#include "config.nw.h" +#else +#include "php_config.h" +#endif + #if HAVE_MCVE /* standard php include(s) */ @@ -719,23 +727,34 @@ } /* }}} */ -/* {{{ proto int m_setssl_files(string sslkeyfile, string sslcertfile) +/* {{{ proto int m_setssl_files(resource conn, string sslkeyfile, string sslcertfile) Set certificate key files and certificates if server requires client certificate verification */ PHP_FUNCTION(m_setssl_files) { + MCVE_CONN *conn; int retval; - zval **arg1, **arg2; + zval **arg1, **arg2, **arg3; +#ifndef LIBMONETRA_BELOW_4_2 + if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) + WRONG_PARAM_COUNT; + ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg1, -1, "mcve connection", le_conn); +#else if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) WRONG_PARAM_COUNT; +#endif - convert_to_string_ex(arg1); convert_to_string_ex(arg2); +#ifndef LIBMONETRA_BELOW_4_2 + convert_to_string_ex(arg3); + retval = MCVE_SetSSL_Files(conn, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3)); +#else + convert_to_string_ex(arg1); retval = MCVE_SetSSL_Files(Z_STRVAL_PP(arg1), Z_STRVAL_PP(arg2)); - +#endif RETURN_LONG(retval); } /* }}} */

« previous php.cvs (#29477) next »