From: Takeshi Watanabe Date: Sun, 25 Mar 2018 12:10:11 +0000 (+0900) Subject: Merge commit '36d016afd663d34607c843d03371bedb71efa34e' X-Git-Tag: 1.4.1~30^2 X-Git-Url: https://repo.or.cz/mruby.git/commitdiff_plain/306cb99b1099e5e7e149765969e10ad3e156cec8 Merge commit '36d016afd663d34607c843d03371bedb71efa34e' --- 306cb99b1099e5e7e149765969e10ad3e156cec8 diff --cc mrbgems/mruby-socket/src/socket.c index a4e1d483a,d0df1c2f8..d81952229 --- a/mrbgems/mruby-socket/src/socket.c +++ b/mrbgems/mruby-socket/src/socket.c @@@ -145,16 -138,16 +145,20 @@@ mrb_addrinfo_getaddrinfo(mrb_state *mrb } if (mrb_fixnum_p(socktype)) { - hints.ai_socktype = mrb_fixnum(socktype); + hints.ai_socktype = (int)mrb_fixnum(socktype); + } + + if (mrb_fixnum_p(protocol)) { + hints.ai_protocol = (int)mrb_fixnum(protocol); } + if (mrb_fixnum_p(protocol)) { + hints.ai_protocol = mrb_fixnum(protocol); + } + lastai = mrb_cv_get(mrb, klass, mrb_intern_lit(mrb, "_lastai")); if (mrb_cptr_p(lastai)) { - freeaddrinfo(mrb_cptr(lastai)); + freeaddrinfo((struct addrinfo*)mrb_cptr(lastai)); mrb_cv_set(mrb, klass, mrb_intern_lit(mrb, "_lastai"), mrb_nil_value()); }