summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2009-10-07 17:33:51 +0000
committerAndrey Hristov <andrey@php.net>2009-10-07 17:33:51 +0000
commit309fced64dacb409053684ab1eb837bb9bb758c4 (patch)
tree220b484bbca66a1404be97deb297f6225ad245d5 /ext/mysqlnd/mysqlnd.c
parentb6b56ba87a0fa48d9fe36e367021394239b7f7ea (diff)
downloadphp-git-309fced64dacb409053684ab1eb837bb9bb758c4.tar.gz
Increase the minimal size of the command buffer, which is used
for sending queries and in the future commpressed patch for reading almost all packets from the wire instead of using stack buffers.
Diffstat (limited to 'ext/mysqlnd/mysqlnd.c')
-rw-r--r--ext/mysqlnd/mysqlnd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 904a310dba..4f1fbb06d1 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -1948,6 +1948,9 @@ MYSQLND_METHOD(mysqlnd_conn, set_client_option)(MYSQLND * const conn,
break;
#endif
case MYSQLND_OPT_NET_CMD_BUFFER_SIZE:
+ if (*(unsigned int*) value < MYSQLND_NET_CMD_BUFFER_MIN_SIZE) {
+ DBG_RETURN(FAIL);
+ }
conn->net.cmd_buffer.length = *(unsigned int*) value;
if (!conn->net.cmd_buffer.buffer) {
conn->net.cmd_buffer.buffer = mnd_pemalloc(conn->net.cmd_buffer.length, conn->persistent);