diff options
author | Stanley Sufficool <ssufficool@php.net> | 2013-10-05 17:57:23 -0700 |
---|---|---|
committer | Stanley Sufficool <ssufficool@php.net> | 2013-10-05 17:57:23 -0700 |
commit | 3e023c3ddf9e80046803a989f4951ee16d3b8f9b (patch) | |
tree | 602f3b798d09f49f069fd9a046d502931f56c158 /ext/mysqlnd/mysqlnd.c | |
parent | b144c263191f857391d3cc009951c95d25a2cdb3 (diff) | |
parent | 3261eb348f5aea14f74010d883cfc68978fd8ed9 (diff) | |
download | php-git-3e023c3ddf9e80046803a989f4951ee16d3b8f9b.tar.gz |
Merge branch 'master' of https://git.php.net/push/php-src
* 'master' of https://git.php.net/push/php-src: (705 commits)
Allow the ldap extension to be compiled with Oracle's LDAP implementation, if desired. Note the implementations differ so you will see different ldap behavior.
Fix bug #65667: ftp_nb_continue produces segfault
fix bug #64146 (serialize incorrectly saving objects when they are cloned)
such a weird hack probably helps in finding regressions in the future
Fix bug #65821: By-ref foreach on property access of string offset segfaults
Fixed bug #64230 (XMLReader does not suppress errors)
add NEWS and UPGRADING about gost-crypto
fix bug #55285 XMLReader::getAttribute/No/Ns methods inconsistency
typo: really fix bug #51936 Crash with clone xmlreader
fix bug #59613 (Crash with clone XMLReader)
Fix Bug #60633 build warning in bcmath
fix bug #65808 the socket_connect() won't work with IPv6 address
5.4.22-dev now
Revert "Make 'make distclean' remove the downloaded pear PHAR"
fix bug #62396 'make test' crashes starting with 5.3.14 (missing gzencode())
Fixed bug #61548
Reverted patch (it was used for internal testing and was committed by accident)
OCI8 2.0: Added a new oci_set_db_operation() user space function for the "DB Operation" tracing feature of Oracle DB 12c.
Make 'make distclean' remove the downloaded pear PHAR
fix test
...
Diffstat (limited to 'ext/mysqlnd/mysqlnd.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 724876e899..b41e5424f5 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -1180,7 +1180,7 @@ static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len TSRMLS_DC) { size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, send_query); - enum_func_status ret; + enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::send_query"); DBG_INF_FMT("conn=%llu query=%s", conn->thread_id, query); @@ -1225,6 +1225,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC #include "php_network.h" +/* {{{ mysqlnd_stream_array_to_fd_set */ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS_DC) { int cnt = 0; @@ -1255,14 +1256,17 @@ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS } return ret; } +/* }}} */ -/* {{{ stream_select mysqlnd_stream_array_to_fd_set functions */ +/* {{{ mysqlnd_stream_array_to_fd_set */ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, php_socket_t * max_fd TSRMLS_DC) { php_socket_t this_fd; - int cnt = 0; + php_stream *stream = NULL; + unsigned int cnt = 0; MYSQLND **p = conn_array; + DBG_ENTER("mysqlnd_stream_array_to_fd_set"); while (*p) { /* get the fd. @@ -1270,7 +1274,9 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p * when casting. It is only used here so that the buffered data warning * is not displayed. * */ - if (SUCCESS == php_stream_cast((*p)->data->net->data->m.get_stream((*p)->data->net TSRMLS_CC), PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, + stream = (*p)->data->net->data->m.get_stream((*p)->data->net TSRMLS_CC); + DBG_INF_FMT("conn=%llu stream=%p", (*p)->data->thread_id, stream); + if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { PHP_SAFE_FD_SET(this_fd, fds); @@ -1282,20 +1288,25 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p } p++; } - return cnt ? 1 : 0; + DBG_RETURN(cnt ? 1 : 0); } +/* }}} */ + +/* {{{ mysqlnd_stream_array_from_fd_set */ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds TSRMLS_DC) { php_socket_t this_fd; + php_stream *stream = NULL; int ret = 0; zend_bool disproportion = FALSE; - - MYSQLND **fwd = conn_array, **bckwd = conn_array; + DBG_ENTER("mysqlnd_stream_array_from_fd_set"); while (*fwd) { - if (SUCCESS == php_stream_cast((*fwd)->data->net->data->m.get_stream((*fwd)->data->net TSRMLS_CC), PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, + stream = (*fwd)->data->net->data->m.get_stream((*fwd)->data->net TSRMLS_CC); + DBG_INF_FMT("conn=%llu stream=%p", (*fwd)->data->thread_id, stream); + if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { if (PHP_SAFE_FD_ISSET(this_fd, fds)) { if (disproportion) { @@ -1312,7 +1323,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds } *bckwd = NULL;/* NULL-terminate the list */ - return ret; + DBG_RETURN(ret); } /* }}} */ @@ -1455,7 +1466,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c } if (FAIL == result->m.read_result_metadata(result, conn TSRMLS_CC)) { - DBG_ERR("Error ocurred while reading metadata"); + DBG_ERR("Error occurred while reading metadata"); result->m.free_result(result, TRUE TSRMLS_CC); result = NULL; break; @@ -1587,7 +1598,7 @@ static ulong MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC) { size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, escape_string); - ulong ret; + ulong ret = FAIL; DBG_ENTER("mysqlnd_conn_data::escape_string"); DBG_INF_FMT("conn=%llu", conn->thread_id); |