summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-socket
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-12-13 23:00:25 +0900
committerGitHub <[email protected]>2017-12-13 23:00:25 +0900
commit1a150a6e48e6f5bd4d07754fc8b5ba2a057b93ac (patch)
treeadd4e4f623d5aed1b89a603b526eb3f7f1d49402 /mrbgems/mruby-socket
parent55fced30cd4e333916f5a02500c05dbae28fd86e (diff)
parent398da99d059b4df05161b0bbc2d1724c96f9ff5f (diff)
downloadmruby-1a150a6e48e6f5bd4d07754fc8b5ba2a057b93ac.tar.gz
mruby-1a150a6e48e6f5bd4d07754fc8b5ba2a057b93ac.zip
Merge pull request #3891 from mimaki/set-addrinfo-protocol
Set protocol of AddrInfo
Diffstat (limited to 'mrbgems/mruby-socket')
-rw-r--r--mrbgems/mruby-socket/src/socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mrbgems/mruby-socket/src/socket.c b/mrbgems/mruby-socket/src/socket.c
index 0b0835f56..76eb8a674 100644
--- a/mrbgems/mruby-socket/src/socket.c
+++ b/mrbgems/mruby-socket/src/socket.c
@@ -146,6 +146,10 @@ mrb_addrinfo_getaddrinfo(mrb_state *mrb, mrb_value klass)
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"));
if (mrb_cptr_p(lastai)) {
freeaddrinfo((struct addrinfo*)mrb_cptr(lastai));