mirror of
https://github.com/php/php-src.git
synced 2026-04-21 15:08:16 +02:00
OPT_COMPRESS support for mysqlnd_conn::set_client_option
To be used by mysqli_options
This commit is contained in:
@@ -714,6 +714,10 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn,
|
||||
if (mysql_flags & CLIENT_COMPRESS) {
|
||||
mysql_flags &= ~CLIENT_COMPRESS;
|
||||
}
|
||||
#else
|
||||
if (conn->net->options.flags & MYSQLND_NET_FLAG_USE_COMPRESSION) {
|
||||
mysql_flags |= CLIENT_COMPRESS;
|
||||
}
|
||||
#endif
|
||||
#ifndef MYSQLND_SSL_SUPPORTED
|
||||
if (mysql_flags & CLIENT_SSL) {
|
||||
@@ -2034,9 +2038,7 @@ MYSQLND_METHOD(mysqlnd_conn, set_client_option)(MYSQLND * const conn,
|
||||
DBG_ENTER("mysqlnd_conn::set_client_option");
|
||||
DBG_INF_FMT("conn=%llu option=%u", conn->thread_id, option);
|
||||
switch (option) {
|
||||
#ifdef WHEN_SUPPORTED_BY_MYSQLI
|
||||
case MYSQL_OPT_COMPRESS:
|
||||
#endif
|
||||
#ifdef WHEN_SUPPORTED_BY_MYSQLI
|
||||
case MYSQL_OPT_READ_TIMEOUT:
|
||||
case MYSQL_OPT_WRITE_TIMEOUT:
|
||||
|
||||
@@ -94,6 +94,9 @@
|
||||
|
||||
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
|
||||
|
||||
|
||||
#define MYSQLND_NET_FLAG_USE_COMPRESSION 1
|
||||
|
||||
typedef enum mysqlnd_extension
|
||||
{
|
||||
MYSQLND_MYSQL = 0,
|
||||
|
||||
@@ -665,10 +665,8 @@ MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const net, enum mys
|
||||
net->options.timeout_write = *(unsigned int*) value;
|
||||
break;
|
||||
#endif
|
||||
#ifdef WHEN_SUPPORTED_BY_MYSQLI
|
||||
case MYSQL_OPT_COMPRESS:
|
||||
#endif
|
||||
/* currently not supported. Todo!! */
|
||||
net->options.flags |= MYSQLND_NET_FLAG_USE_COMPRESSION;
|
||||
break;
|
||||
default:
|
||||
DBG_RETURN(FAIL);
|
||||
|
||||
@@ -156,11 +156,18 @@ typedef struct st_mysqlnd_options
|
||||
The ABI will be broken and the methods structure will be somewhere else
|
||||
in the memory which can crash external code. Feel free to reuse these.
|
||||
*/
|
||||
char * unused1;
|
||||
#if SIZEOF_CHAR_P == 4
|
||||
uint32_t unused1;
|
||||
#elif SIZEOF_CHAR_P == 8
|
||||
uint64_t unused1;
|
||||
#else
|
||||
#error Not supported platform
|
||||
#endif
|
||||
char * unused2;
|
||||
char * unused3;
|
||||
char * unused4;
|
||||
char * unused5;
|
||||
|
||||
enum_mysqlnd_protocol_type protocol;
|
||||
|
||||
char *charset_name;
|
||||
@@ -190,6 +197,7 @@ typedef struct st_mysqlnd_net_options
|
||||
char *ssl_cipher;
|
||||
char *ssl_passphrase;
|
||||
zend_bool ssl_verify_peer;
|
||||
uint64_t flags;
|
||||
} MYSQLND_NET_OPTIONS;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user