Commit 398da99d authored by Hiroshi Mimaki's avatar Hiroshi Mimaki

Set protocol of AddrInfo

parent 55fced30
...@@ -146,6 +146,10 @@ mrb_addrinfo_getaddrinfo(mrb_state *mrb, mrb_value klass) ...@@ -146,6 +146,10 @@ mrb_addrinfo_getaddrinfo(mrb_state *mrb, mrb_value klass)
hints.ai_socktype = (int)mrb_fixnum(socktype); hints.ai_socktype = (int)mrb_fixnum(socktype);
} }
if (mrb_fixnum_p(protocol)) {
hints.ai_protocol = (int)mrb_fixnum(protocol);
}
lastai = mrb_cv_get(mrb, klass, mrb_intern_lit(mrb, "_lastai")); lastai = mrb_cv_get(mrb, klass, mrb_intern_lit(mrb, "_lastai"));
if (mrb_cptr_p(lastai)) { if (mrb_cptr_p(lastai)) {
freeaddrinfo((struct addrinfo*)mrb_cptr(lastai)); freeaddrinfo((struct addrinfo*)mrb_cptr(lastai));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment