diff options
| author | Brad House <bradmssw@php.net> | 2004-12-08 03:11:32 +0000 |
|---|---|---|
| committer | Brad House <bradmssw@php.net> | 2004-12-08 03:11:32 +0000 |
| commit | 9b72bcfd99fae27d0378b180193c0b2e55d54b15 (patch) | |
| tree | dfb12315f51a10d8192e6a4fc0e8028bc82b27d7 | |
| parent | d2bf5faa4f66d66e0b79583a7571a3f9d00d0a3f (diff) | |
| download | php-git-9b72bcfd99fae27d0378b180193c0b2e55d54b15.tar.gz | |
backport from 5.0/head. Newer versions of libmonetra broke compatability with one function. Make workaround that detects version, and works with both.
| -rw-r--r-- | ext/mcve/config.m4 | 14 | ||||
| -rw-r--r-- | ext/mcve/mcve.c | 27 |
2 files changed, 37 insertions, 4 deletions
diff --git a/ext/mcve/config.m4 b/ext/mcve/config.m4 index f33e20bd6e..2f7ee696ab 100644 --- a/ext/mcve/config.m4 +++ b/ext/mcve/config.m4 @@ -51,6 +51,20 @@ yes ],[ 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) diff --git a/ext/mcve/mcve.c b/ext/mcve/mcve.c index e66f2a79b7..19f555c567 100644 --- a/ext/mcve/mcve.c +++ b/ext/mcve/mcve.c @@ -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) */ @@ -717,23 +725,34 @@ PHP_FUNCTION(m_setssl) } /* }}} */ -/* {{{ 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); } /* }}} */ |
