mirror of
https://github.com/php/php-src.git
synced 2026-04-22 23:48:14 +02:00
Merge branch 'master' of git.php.net:php-src
This commit is contained in:
@@ -227,7 +227,11 @@
|
||||
} while(0)
|
||||
|
||||
/* sizeof(OnigCodePoint) */
|
||||
#define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T
|
||||
#ifdef SIZEOF_SIZE_T
|
||||
# define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T
|
||||
#else
|
||||
# define WORD_ALIGNMENT_SIZE SIZEOF_LONG
|
||||
#endif
|
||||
|
||||
#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
|
||||
(pad_size) = WORD_ALIGNMENT_SIZE \
|
||||
|
||||
@@ -318,7 +318,8 @@ typedef enum_func_status (*func_mysqlnd_vio__connect)(MYSQLND_VIO * const vio, c
|
||||
typedef void (*func_mysqlnd_vio__close_stream)(MYSQLND_VIO * const vio, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
|
||||
typedef php_stream * (*func_mysqlnd_vio__open_stream)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
|
||||
typedef php_stream * (*func_mysqlnd_vio__get_stream)(const MYSQLND_VIO * const vio);
|
||||
typedef php_stream * (*func_mysqlnd_vio__set_stream)(MYSQLND_VIO * const vio, php_stream * vio_stream);
|
||||
typedef enum_func_status (*func_mysqlnd_vio__set_stream)(MYSQLND_VIO * const vio, php_stream * vio_stream);
|
||||
typedef zend_bool (*func_mysqlnd_vio__has_valid_stream)(const MYSQLND_VIO * const vio);
|
||||
typedef func_mysqlnd_vio__open_stream (*func_mysqlnd_vio__get_open_stream)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, MYSQLND_ERROR_INFO * const error_info);
|
||||
|
||||
typedef enum_func_status (*func_mysqlnd_vio__set_client_option)(MYSQLND_VIO * const vio, enum_mysqlnd_client_option option, const char * const value);
|
||||
@@ -346,6 +347,7 @@ MYSQLND_CLASS_METHODS_TYPE(mysqlnd_vio)
|
||||
|
||||
func_mysqlnd_vio__get_stream get_stream;
|
||||
func_mysqlnd_vio__set_stream set_stream;
|
||||
func_mysqlnd_vio__has_valid_stream has_valid_stream;
|
||||
func_mysqlnd_vio__get_open_stream get_open_stream;
|
||||
|
||||
func_mysqlnd_vio__set_client_option set_client_option;
|
||||
|
||||
+22
-12
@@ -74,7 +74,7 @@ mysqlnd_set_sock_keepalive(php_stream * stream)
|
||||
/* {{{ mysqlnd_vio::network_read */
|
||||
static enum_func_status
|
||||
MYSQLND_METHOD(mysqlnd_vio, network_read)(MYSQLND_VIO * const vio, zend_uchar * const buffer, const size_t count,
|
||||
MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
|
||||
MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
|
||||
{
|
||||
enum_func_status return_value = PASS;
|
||||
php_stream * net_stream = vio->data->m.get_stream(vio);
|
||||
@@ -105,7 +105,7 @@ MYSQLND_METHOD(mysqlnd_vio, network_read)(MYSQLND_VIO * const vio, zend_uchar *
|
||||
/* {{{ mysqlnd_vio::network_write */
|
||||
static size_t
|
||||
MYSQLND_METHOD(mysqlnd_vio, network_write)(MYSQLND_VIO * const vio, const zend_uchar * const buffer, const size_t count,
|
||||
MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
|
||||
MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
|
||||
{
|
||||
size_t ret;
|
||||
DBG_ENTER("mysqlnd_vio::network_write");
|
||||
@@ -318,8 +318,7 @@ MYSQLND_METHOD(mysqlnd_vio, connect)(MYSQLND_VIO * const vio, const MYSQLND_CSTR
|
||||
open_stream = vio->data->m.get_open_stream(vio, scheme, error_info);
|
||||
if (open_stream) {
|
||||
php_stream * net_stream = open_stream(vio, scheme, persistent, conn_stats, error_info);
|
||||
if (net_stream) {
|
||||
(void) vio->data->m.set_stream(vio, net_stream);
|
||||
if (net_stream && PASS == vio->data->m.set_stream(vio, net_stream)) {
|
||||
vio->data->m.post_connect_set_opt(vio, scheme, conn_stats, error_info);
|
||||
ret = PASS;
|
||||
}
|
||||
@@ -676,7 +675,7 @@ MYSQLND_METHOD(mysqlnd_vio, close_stream)(MYSQLND_VIO * const net, MYSQLND_STATS
|
||||
} else {
|
||||
php_stream_free(net_stream, PHP_STREAM_FREE_CLOSE);
|
||||
}
|
||||
(void) net->data->m.set_stream(net, NULL);
|
||||
net->data->m.set_stream(net, NULL);
|
||||
}
|
||||
|
||||
DBG_VOID_RETURN;
|
||||
@@ -731,16 +730,26 @@ MYSQLND_METHOD(mysqlnd_vio, get_stream)(const MYSQLND_VIO * const net)
|
||||
|
||||
|
||||
/* {{{ mysqlnd_vio::set_stream */
|
||||
static php_stream *
|
||||
MYSQLND_METHOD(mysqlnd_vio, set_stream)(MYSQLND_VIO * const net, php_stream * net_stream)
|
||||
static enum_func_status
|
||||
MYSQLND_METHOD(mysqlnd_vio, set_stream)(MYSQLND_VIO * const vio, php_stream * net_stream)
|
||||
{
|
||||
php_stream * ret = NULL;
|
||||
DBG_ENTER("mysqlnd_vio::set_stream");
|
||||
if (net) {
|
||||
net->data->stream = net_stream;
|
||||
ret = net->data->stream;
|
||||
if (vio) {
|
||||
vio->data->stream = net_stream;
|
||||
DBG_RETURN(PASS);
|
||||
}
|
||||
DBG_RETURN(ret);
|
||||
DBG_RETURN(FAIL);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ mysqlnd_vio::has_valid_stream */
|
||||
static zend_bool
|
||||
MYSQLND_METHOD(mysqlnd_vio, has_valid_stream)(const MYSQLND_VIO * const vio)
|
||||
{
|
||||
DBG_ENTER("mysqlnd_vio::has_valid_stream");
|
||||
DBG_INF_FMT("%p %p", vio, vio? vio->data->stream:NULL);
|
||||
DBG_RETURN((vio && vio->data->stream)? TRUE: FALSE);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -757,6 +766,7 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_vio)
|
||||
|
||||
MYSQLND_METHOD(mysqlnd_vio, get_stream),
|
||||
MYSQLND_METHOD(mysqlnd_vio, set_stream),
|
||||
MYSQLND_METHOD(mysqlnd_vio, has_valid_stream),
|
||||
MYSQLND_METHOD(mysqlnd_vio, get_open_stream),
|
||||
|
||||
MYSQLND_METHOD(mysqlnd_vio, set_client_option),
|
||||
|
||||
Reference in New Issue
Block a user