dsp                                      Fri, 06 Aug 2010 19:47:03 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=301937

Log:
make ssl_set return value in mysqlnd compatible with libmysqli return value

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c  2010-08-06 19:11:34 UTC 
(rev 301936)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c  2010-08-06 19:47:03 UTC 
(rev 301937)
@@ -1293,14 +1293,14 @@
 /* }}} */

 /* {{{ mysqlnd_conn::ssl_set */
-void
+static enum_func_status
 MYSQLND_METHOD(mysqlnd_conn, ssl_set)(MYSQLND * const conn, const char * key, 
const char * const cert, const char * const ca, const char * const capath, 
const char * const cipher TSRMLS_DC)
 {
-       conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_KEY, key 
TSRMLS_CC);
-       conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_CERT, cert 
TSRMLS_CC);
-       conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_CA, ca 
TSRMLS_CC);
-       conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_CAPATH, 
capath TSRMLS_CC);
-       conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_CIPHER, 
cipher TSRMLS_CC);
+       return (PASS == conn->net->m.set_client_option(conn->net, 
MYSQLND_OPT_SSL_KEY, key TSRMLS_CC) &&
+               PASS == conn->net->m.set_client_option(conn->net, 
MYSQLND_OPT_SSL_CERT, cert TSRMLS_CC) &&
+               PASS == conn->net->m.set_client_option(conn->net, 
MYSQLND_OPT_SSL_CA, ca TSRMLS_CC) &&
+               PASS == conn->net->m.set_client_option(conn->net, 
MYSQLND_OPT_SSL_CAPATH, capath TSRMLS_CC) &&
+               PASS == conn->net->m.set_client_option(conn->net, 
MYSQLND_OPT_SSL_CIPHER, cipher TSRMLS_CC)) ? PASS : FAIL;
 }
 /* }}} */


Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h  2010-08-06 
19:11:34 UTC (rev 301936)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h  2010-08-06 
19:47:03 UTC (rev 301937)
@@ -400,7 +400,7 @@
 typedef enum_func_status       (*func_mysqlnd_conn__end_psession)(MYSQLND 
*conn TSRMLS_DC);
 typedef enum_func_status       (*func_mysqlnd_conn__send_close)(MYSQLND * conn 
TSRMLS_DC);

-typedef void                           (*func_mysqlnd_conn__ssl_set)(MYSQLND * 
const conn, const char * key, const char * const cert, const char * const ca, 
const char * const capath, const char * const cipher TSRMLS_DC);
+typedef enum_func_status    (*func_mysqlnd_conn__ssl_set)(MYSQLND * const 
conn, const char * key, const char * const cert, const char * const ca, const 
char * const capath, const char * const cipher TSRMLS_DC);

 typedef MYSQLND_RES *          (*func_mysqlnd_conn__result_init)(unsigned int 
field_count, zend_bool persistent TSRMLS_DC);


Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd.c     2010-08-06 19:11:34 UTC (rev 
301936)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd.c     2010-08-06 19:47:03 UTC (rev 
301937)
@@ -1293,14 +1293,14 @@
 /* }}} */

 /* {{{ mysqlnd_conn::ssl_set */
-void
+static enum_func_status
 MYSQLND_METHOD(mysqlnd_conn, ssl_set)(MYSQLND * const conn, const char * key, 
const char * const cert, const char * const ca, const char * const capath, 
const char * const cipher TSRMLS_DC)
 {
-       conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_KEY, key 
TSRMLS_CC);
-       conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_CERT, cert 
TSRMLS_CC);
-       conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_CA, ca 
TSRMLS_CC);
-       conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_CAPATH, 
capath TSRMLS_CC);
-       conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_CIPHER, 
cipher TSRMLS_CC);
+       return (PASS == conn->net->m.set_client_option(conn->net, 
MYSQLND_OPT_SSL_KEY, key TSRMLS_CC) &&
+               PASS == conn->net->m.set_client_option(conn->net, 
MYSQLND_OPT_SSL_CERT, cert TSRMLS_CC) &&
+               PASS == conn->net->m.set_client_option(conn->net, 
MYSQLND_OPT_SSL_CA, ca TSRMLS_CC) &&
+               PASS == conn->net->m.set_client_option(conn->net, 
MYSQLND_OPT_SSL_CAPATH, capath TSRMLS_CC) &&
+               PASS == conn->net->m.set_client_option(conn->net, 
MYSQLND_OPT_SSL_CIPHER, cipher TSRMLS_CC)) ? PASS : FAIL;
 }
 /* }}} */


Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h     2010-08-06 19:11:34 UTC 
(rev 301936)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h     2010-08-06 19:47:03 UTC 
(rev 301937)
@@ -400,7 +400,7 @@
 typedef enum_func_status       (*func_mysqlnd_conn__end_psession)(MYSQLND 
*conn TSRMLS_DC);
 typedef enum_func_status       (*func_mysqlnd_conn__send_close)(MYSQLND * conn 
TSRMLS_DC);

-typedef void                           (*func_mysqlnd_conn__ssl_set)(MYSQLND * 
const conn, const char * key, const char * const cert, const char * const ca, 
const char * const capath, const char * const cipher TSRMLS_DC);
+typedef enum_func_status    (*func_mysqlnd_conn__ssl_set)(MYSQLND * const 
conn, const char * key, const char * const cert, const char * const ca, const 
char * const capath, const char * const cipher TSRMLS_DC);

 typedef MYSQLND_RES *          (*func_mysqlnd_conn__result_init)(unsigned int 
field_count, zend_bool persistent TSRMLS_DC);


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to