summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_net.c
diff options
context:
space:
mode:
authorandrey <andrey@php.net>2012-09-25 18:26:02 +0200
committerandrey <andrey@php.net>2012-09-25 18:26:02 +0200
commit263b37bee1ea92e30791b15af710b509da4b8ca8 (patch)
treecc31b3ed520c7935233de1dc417999f5a7bd977c /ext/mysqlnd/mysqlnd_net.c
parent6074df91c6ab80a1fae7c7e8ff5be1c1db342af0 (diff)
downloadphp-git-263b37bee1ea92e30791b15af710b509da4b8ca8.tar.gz
change public key setting to PERDIR and finish code that allows
to set the key file programatically per mysqli_options()
Diffstat (limited to 'ext/mysqlnd/mysqlnd_net.c')
-rw-r--r--ext/mysqlnd/mysqlnd_net.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index 7458f76528..b3d97447e9 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -781,6 +781,15 @@ MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const net, enum mys
case MYSQL_OPT_COMPRESS:
net->data->options.flags |= MYSQLND_NET_FLAG_USE_COMPRESSION;
break;
+ case MYSQL_SERVER_PUBLIC_KEY:
+ {
+ zend_bool pers = net->persistent;
+ if (net->data->options.sha256_server_public_key) {
+ mnd_pefree(net->data->options.sha256_server_public_key, pers);
+ }
+ net->data->options.sha256_server_public_key = value? mnd_pestrdup(value, pers) : NULL;
+ break;
+ }
default:
DBG_RETURN(FAIL);
}