Skip to content

Commit 3896638

Browse files
committed
Timeout values should be unsigned ints
1 parent 827d782 commit 3896638

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ext/mysql2/client.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -764,17 +764,17 @@ static VALUE _mysql_client_options(VALUE self, int opt, VALUE value) {
764764

765765
switch(opt) {
766766
case MYSQL_OPT_CONNECT_TIMEOUT:
767-
intval = NUM2INT(value);
767+
intval = NUM2UINT(value);
768768
retval = &intval;
769769
break;
770770

771771
case MYSQL_OPT_READ_TIMEOUT:
772-
intval = NUM2INT(value);
772+
intval = NUM2UINT(value);
773773
retval = &intval;
774774
break;
775775

776776
case MYSQL_OPT_WRITE_TIMEOUT:
777-
intval = NUM2INT(value);
777+
intval = NUM2UINT(value);
778778
retval = &intval;
779779
break;
780780

ext/mysql2/client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ typedef struct {
4141
VALUE active_thread; /* rb_thread_current() or Qnil */
4242
long server_version;
4343
int reconnect_enabled;
44-
int connect_timeout;
44+
unsigned int connect_timeout;
4545
int active;
4646
int connected;
4747
int initialized;

0 commit comments

Comments
 (0)