andrey                                   Tue, 09 Feb 2010 19:05:40 +0000

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

Log:
make send_close a hook, too

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-02-09 18:58:35 UTC 
(rev 294818)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c  2010-02-09 19:05:40 UTC 
(rev 294819)
@@ -64,8 +64,6 @@
 PHPAPI MYSQLND_STATS *mysqlnd_global_stats = NULL;
 static zend_bool mysqlnd_library_initted = FALSE;

-static enum_func_status mysqlnd_send_close(MYSQLND * conn TSRMLS_DC);
-
 static struct st_mysqlnd_conn_methods *mysqlnd_conn_methods;

 /* {{{ mysqlnd_library_end */
@@ -491,7 +489,7 @@
                if (CONN_GET_STATE(conn) < CONN_QUIT_SENT) {
                        MYSQLND_INC_CONN_STATISTIC(conn->stats, 
STAT_CLOSE_IMPLICIT);
                        reconnect = TRUE;
-                       mysqlnd_send_close(conn TSRMLS_CC);
+                       conn->m->send_close(conn TSRMLS_CC);
                }

                conn->m->free_contents(conn TSRMLS_CC);
@@ -1378,7 +1376,7 @@

 /* {{{ mysqlnd_send_close */
 static enum_func_status
-mysqlnd_send_close(MYSQLND * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn, send_close)(MYSQLND * const conn TSRMLS_DC)
 {
        enum_func_status ret = PASS;

@@ -1458,7 +1456,7 @@
          Close now, free_reference will try,
          if we are last, but that's not a problem.
        */
-       ret = mysqlnd_send_close(conn TSRMLS_CC);
+       ret = conn->m->send_close(conn TSRMLS_CC);

        ret = conn->m->free_reference(conn TSRMLS_CC);

@@ -1492,7 +1490,7 @@
                  This will free the object too, of course because references 
has
                  reached zero.
                */
-               ret = mysqlnd_send_close(conn TSRMLS_CC);
+               ret = conn->m->send_close(conn TSRMLS_CC);
                conn->m->dtor(conn TSRMLS_CC);
        }
        DBG_RETURN(ret);
@@ -2099,7 +2097,8 @@
        MYSQLND_METHOD(mysqlnd_conn, simple_command),
        MYSQLND_METHOD(mysqlnd_conn, simple_command_handle_response),
        MYSQLND_METHOD(mysqlnd_conn, restart_psession),
-       MYSQLND_METHOD(mysqlnd_conn, end_psession)
+       MYSQLND_METHOD(mysqlnd_conn, end_psession),
+       MYSQLND_METHOD(mysqlnd_conn, send_close)
 MYSQLND_CLASS_METHODS_END;



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-02-09 
18:58:35 UTC (rev 294818)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h  2010-02-09 
19:05:40 UTC (rev 294819)
@@ -346,6 +346,7 @@

        enum_func_status        (*restart_psession)(MYSQLND *conn TSRMLS_DC);
        enum_func_status        (*end_psession)(MYSQLND *conn TSRMLS_DC);
+       enum_func_status        (*send_close)(MYSQLND * conn TSRMLS_DC);
 };



Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd.c     2010-02-09 18:58:35 UTC (rev 
294818)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd.c     2010-02-09 19:05:40 UTC (rev 
294819)
@@ -64,8 +64,6 @@
 PHPAPI MYSQLND_STATS *mysqlnd_global_stats = NULL;
 static zend_bool mysqlnd_library_initted = FALSE;

-static enum_func_status mysqlnd_send_close(MYSQLND * conn TSRMLS_DC);
-
 static struct st_mysqlnd_conn_methods *mysqlnd_conn_methods;

 /* {{{ mysqlnd_library_end */
@@ -491,7 +489,7 @@
                if (CONN_GET_STATE(conn) < CONN_QUIT_SENT) {
                        MYSQLND_INC_CONN_STATISTIC(conn->stats, 
STAT_CLOSE_IMPLICIT);
                        reconnect = TRUE;
-                       mysqlnd_send_close(conn TSRMLS_CC);
+                       conn->m->send_close(conn TSRMLS_CC);
                }

                conn->m->free_contents(conn TSRMLS_CC);
@@ -1378,7 +1376,7 @@

 /* {{{ mysqlnd_send_close */
 static enum_func_status
-mysqlnd_send_close(MYSQLND * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn, send_close)(MYSQLND * const conn TSRMLS_DC)
 {
        enum_func_status ret = PASS;

@@ -1458,7 +1456,7 @@
          Close now, free_reference will try,
          if we are last, but that's not a problem.
        */
-       ret = mysqlnd_send_close(conn TSRMLS_CC);
+       ret = conn->m->send_close(conn TSRMLS_CC);

        ret = conn->m->free_reference(conn TSRMLS_CC);

@@ -1492,7 +1490,7 @@
                  This will free the object too, of course because references 
has
                  reached zero.
                */
-               ret = mysqlnd_send_close(conn TSRMLS_CC);
+               ret = conn->m->send_close(conn TSRMLS_CC);
                conn->m->dtor(conn TSRMLS_CC);
        }
        DBG_RETURN(ret);
@@ -2099,7 +2097,8 @@
        MYSQLND_METHOD(mysqlnd_conn, simple_command),
        MYSQLND_METHOD(mysqlnd_conn, simple_command_handle_response),
        MYSQLND_METHOD(mysqlnd_conn, restart_psession),
-       MYSQLND_METHOD(mysqlnd_conn, end_psession)
+       MYSQLND_METHOD(mysqlnd_conn, end_psession),
+       MYSQLND_METHOD(mysqlnd_conn, send_close)
 MYSQLND_CLASS_METHODS_END;



Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h     2010-02-09 18:58:35 UTC 
(rev 294818)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h     2010-02-09 19:05:40 UTC 
(rev 294819)
@@ -346,6 +346,7 @@

        enum_func_status        (*restart_psession)(MYSQLND *conn TSRMLS_DC);
        enum_func_status        (*end_psession)(MYSQLND *conn TSRMLS_DC);
+       enum_func_status        (*send_close)(MYSQLND * conn TSRMLS_DC);
 };



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

Reply via email to