1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
? View Code BASH 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, @-, 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; |