diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-29 07:46:56 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-29 07:46:56 +0000 |
commit | 11fef7fd630528ac1b6c55739cb1affb2208944c (patch) | |
tree | 5d1eae8d65818174f6f94d57880e625fdfacc48a /ext/socket | |
parent | 1e965f4f9a7ab6dc368ee256ed71fe6c2f2e62dc (diff) | |
download | ruby-11fef7fd630528ac1b6c55739cb1affb2208944c.tar.gz |
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r-- | ext/socket/socket.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c index d46092f119..bd39d7eb7c 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -104,7 +104,7 @@ struct sockaddr_storage { }; #endif -#if defined(INET6) && (defined(LOOKUP_ORDER_HACK_INET) || defined(LOOKUP_ORDER_HACK_INET)) +#if defined(INET6) && (defined(LOOKUP_ORDER_HACK_INET) || defined(LOOKUP_ORDER_HACK_INET6)) #define LOOKUP_ORDERS 3 static int lookup_order_table[LOOKUP_ORDERS] = { #if defined(LOOKUP_ORDER_HACK_INET) @@ -381,7 +381,7 @@ bsock_send(argc, argv, sock) retry: rb_thread_fd_writable(fd); m = rb_str2cstr(msg, &mlen); - if (RTEST(to)) { + if (!NIL_P(to)) { t = rb_str2cstr(to, &tlen); n = sendto(fd, m, mlen, NUM2INT(flags), (struct sockaddr*)t, tlen); @@ -611,15 +611,6 @@ ip_addrsetup(host, port) return res; } -static VALUE -ip_recvfrom(argc, argv, sock) - int argc; - VALUE *argv; - VALUE sock; -{ - return s_recvfrom(sock, argc, argv, RECV_IP); -} - static void setipaddr(name, addr) VALUE name; @@ -1168,6 +1159,15 @@ ip_peeraddr(sock) } static VALUE +ip_recvfrom(argc, argv, sock) + int argc; + VALUE *argv; + VALUE sock; +{ + return s_recvfrom(sock, argc, argv, RECV_IP); +} + +static VALUE ip_s_getaddress(obj, host) VALUE obj, host; { @@ -1259,7 +1259,7 @@ udp_send(argc, argv, sock) int mlen; struct addrinfo *res0, *res; - if (argc == 2) { + if (argc == 2 || argc == 3) { return bsock_send(argc, argv, sock); } rb_secure(4); |