- diff --git a/_mysql.c b/_mysql.c
- index d42cc54..61a9b34 100644
- --- a/_mysql.c
- +++ b/_mysql.c
- @@ -489,9 +489,10 @@ _mysql_ConnectionObject_Initialize(
- "named_pipe", "init_command",
- "read_default_file", "read_default_group",
- "client_flag", "ssl",
- - "local_infile",
- + "local_infile", "read_timeout",
- NULL } ;
- int connect_timeout = 0;
- + int read_timeout = 0;
- int compress = -1, named_pipe = -1, local_infile = -1;
- char *init_command=NULL,
- *read_default_file=NULL,
- @@ -500,7 +501,7 @@ _mysql_ConnectionObject_Initialize(
- self->converter = NULL;
- self->open = 0;
- check_server_init(-1);
- - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ssssisOiiisssiOi:connect",
- + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ssssisOiiisssiOii:connect",
- kwlist,
- &host, &user, &passwd, &db,
- &port, &unix_socket, &conv,
- @@ -509,7 +510,8 @@ _mysql_ConnectionObject_Initialize(
- &init_command, &read_default_file,
- &read_default_group,
- &client_flag, &ssl,
- - &local_infile /* DO NOT PATCH FOR RECONNECT, IDIOTS
- + &local_infile, &read_timeout
- + /* DO NOT PATCH FOR RECONNECT, IDIOTS
- IF YOU DO THIS, I WILL NOT SUPPORT YOUR PACKAGES. */
- ))
- return -1;
- @@ -540,6 +542,12 @@ _mysql_ConnectionObject_Initialize(
- mysql_options(&(self->connection), MYSQL_OPT_CONNECT_TIMEOUT,
- (char *)&timeout);
- }
- +
- + if (read_timeout) {
- + unsigned int timeout = read_timeout;
- + mysql_options(&(self->connection), MYSQL_OPT_READ_TIMEOUT, (char *)&timeout);
- + }
- +
- if (compress != -1) {
- mysql_options(&(self->connection), MYSQL_OPT_COMPRESS, 0);
- client_flag |= CLIENT_COMPRESS;
|