summaryrefslogtreecommitdiff
path: root/ext/socket
AgeCommit message (Collapse)Author
2014-12-27* ext/socket/socket.c: improved document for YARD doc.hsbt
[fix GH-795][ci skip] Patch by @tlewin git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-19Update dependencies.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-07* ext/socket/basicsocket.c, ext/socket/sockssocket.c:ktsj
remove code for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-05socket/option.c: fix inet_ntop link error on mswinnobu
* ext/socket/option.c (inet_ntop): link aliased inet_ntop in libruby on mswin not rb_w32_inet_ntop which fails to link for unknown reason. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-04socket/option.c: use rb_w32_inet_ntopnobu
* ext/socket/option.c (inet_ntop): the fallback implementaion is always available on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-21Update dependency.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* internal.h: Include ruby.h and ruby/encoding.h to beakr
includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15Mark auogenerated part.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* common.mk: Remove comments in Dependency lines.akr
Notified by usa. * enc/depend: Ditto. * ext/**/depend: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* tool/update-deps: Extend to fix dependencies.akr
* common.mk: Dependencies updated by tool/update-deps. * enc/depend: Ditto. * ext/**/depend: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-11* ext/socket/unixsocket.c: [DOC] Fix example to render in HTMLzzak
properly, with a patch by @eval [Fixes GH-733] https://github.com/ruby/ruby/pull/733 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-30protoize no-arguments functionsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-22ext/socket/*.c: trivial struct packing for 64-bitnormal
* ext/socket/ancdata.c ({send,recv}msg_args_struct): 24 => 16 bytes * ext/socket/init.c (connect_arg): ditto * ext/socket/raddrinfo.c (getnameinfo_arg): 56 => 48 bytes Other big stack reductions are less trivial. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-17socket (rsock_connect): fix and refactor for blockingnormal
* ext/socket/init.c (rsock_connect): refactor for blocking (wait_connectable): clear error before wait [Bug #9356] We no longer use non-blocking sockets to emulate blocking behavior, so eliminate error-prone and confusing platform-dependent code. According to POSIX, connect() only needs to be called once in the face of EINTR, so do not loop on it. Before waiting on connect, drop any pending errors, since rb_wait_for_single_fd may not clear the existing error properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-25introduce ZALLOC{,_N} to replace ALLOC{,_N}+MEMZERO usenormal
Using calloc where possible reduces code and binary sizes. * include/ruby/ruby.h (ZALLOC, ZALLOC_N): implement (Data_Make_Struct, TypedData_Make_Struct): ZALLOC replaces ALLOC+memset * compile.c (iseq_seq_sequence): ZALLOC_N replaces ALLOC_N+MEMZERO * cont.c (fiber_t_alloc): ZALLOC replaces ALLOC+MEMZERO * io.c (rb_io_reopen): ditto * iseq.c (prepare_iseq_build): ditto * parse.y (new_args_tail_gen, parser_new, ripper_s_allocate): ditto * re.c (match_alloc): ditto * variable.c (rb_const_set): ditto * ext/socket/raddrinfo.c (get_addrinfo): ditto * ext/strscan/strscan.c (strscan_s_allocate): ditto * gc.c (rb_objspace_alloc): calloc replaces malloc+MEMZERO git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-25* ext/socket/socket.c (sock_gethostname): Use NI_MAXHOST to supportcharliesome
hostnames longer than 64 characters if the system supports it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28* ext/socket/unixsocket.c (rsock_init_unixsock): Open a socketakr
after path length check. This fixes a fd leak by TestSocket_UNIXSocket#test_too_long_path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-27* ext/socket/ifaddr.c (ifaddr_inspect_flags): support IFF_SIMPLEX.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-23* ext/socket/mkconstants.rb: More constantsakr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-22* ext/socket/mkconstants.rb: More TCP option constants.akr
Describe Linux and glibc versions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-21* ext/socket/option.c: Fix complation error on Android.akr
Bionic doesn't define TCP state constants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-19* ext/socket/extconf.rb: Don't check fields of struct tcp_info if theakr
structure is not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-19* ext/socket/option.c (inspect_tcp_info): Permit longer data. (glibcakr
2.7 adds tcpi_rcv_rtt, tcpi_rcv_space and tcpi_total_retrans to struct tcp_info.) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-19* ext/socket/option.c (inspect_tcp_info): New function to inspect struct ↵akr
tcp_info. (sockopt_inspect): Use inspect_tcp_info. * ext/socket/extconf.rb: Check tcp_info related things. * ext/socket/rubysocket.h: Include netinet/tcp_fsm.h if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-11* ext/socket/ifaddr.c (IS_IFADDRS): Unused macro removed.akr
* ext/strscan/strscan.c (BUFSIZE): Ditto. * ext/zlib/zlib.c (OBJ_IS_FREED): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-05* ext/socket/mkconstants.rb: Add IP_TRANSPARENT.akr
IP_TRANSPARENT is provieded since glibc-2.12. Reported by Eliezer Croitoru. [ruby-core:50372] [Bug #7476] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-07* ext/socket/socket.c (sock_s_getnameinfo): Save errno for EAI_SYSTEM.akr
Reported by Saravana kumar. [ruby-core:61820] [Bug #9697] Fixed by Heesob Park. [ruby-core:61868] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-23option.c: use rb_w32_inet_ptonnobu
* ext/socket/option.c (inet_pton): use rb_w32_inet_pton, instead of inet_ntop directly, which is unavailable on older version Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-23raddrinfo.c: suppress warningsnobu
* ext/socket/raddrinfo.c (numeric_getaddrinfo): move conditionally used variables inside the block, to suppress warnings on platforms where inet_pton() is not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-22Fix a filename.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21fix second argument of MEMZEROkazu
* ext/socket/raddrinfo.c (rb_getaddrinfo): second argument of MEMZERO is type. Coverity Scan found this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21* ext/socket/init.c (wait_connectable): break if the socket isshugo
writable to avoid infinite loops on FreeBSD and other platforms which conforms to SUSv3. This problem cannot be reproduced with loopback interfaces, so it's hard to write test code. rsock_connect() and wait_connectable() are overly complicated, so they should be refactored, but I commit this fix as a workaround for the release of Ruby 1.9.3 scheduled on Feb 24. [ruby-core:60940] [Bug #9547] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21socket: sendmsg/recvmsg only retries blocking on errorsnormal
* ext/socket/ancdata.c (bsock_sendmsg_internal): only retry on error (bsock_recvmsg_internal): ditto * test/socket/test_unix.rb: test above for infinite loop git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-20* ext/socket/raddrinfo.c (numeric_getaddrinfo): Use xcalloc.akr
Suggested by Eric Wong. https://bugs.ruby-lang.org/issues/9525#note-14 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-19* ext/socket: Bypass getaddrinfo() if node and serv are numeric.akr
Reporeted by Naotoshi Seo. [ruby-core:60801] [Bug #9525] * ext/socket/extconf.rb: Detect struct sockaddr_in6.sin6_len. * ext/socket/sockport.h (SET_SIN6_LEN): New macro. (INIT_SOCKADDR_IN6): Ditto. * ext/socket/rubysocket.h (struct rb_addrinfo): Add allocated_by_malloc field. * ext/socket/raddrinfo.c (numeric_getaddrinfo): New function. (rb_getaddrinfo): Call numeric_getaddrinfo at first. (rb_freeaddrinfo): Free struct addrinfo properly when it is allocated by numeric_getaddrinfo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-19* ext/socket: Wrap struct addrinfo by struct rb_addrinfo.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-19* ext/socket/ipsocket.c (ip_s_getaddress): Don't access freed memory.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-14* include/ruby/intern.h,akr
include/ruby/io.h, include/ruby/ruby.h, include/ruby/win32.h, include/ruby/backward/rubysig.h, bignum.c, gc.c, io.c, process.c, safe.c, struct.c, thread.c, ext/socket/rubysocket.h, ext/-test-/old_thread_select: Remove deprecated definitions [ruby-core:60581] [Feature #9502] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-31socket: split out SOCK_CLOEXEC versions of wrappers for readabilitynormal
* ext/socket/init.c (rsock_socket0): split out SOCK_CLOEXEC version * ext/socket/socket.c (rsock_socketpair0): ditto [ruby-core:60377] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-31socket.c: suppress warningsnobu
* ext/socket/init.c (rsock_socket0): suppress unused label warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-29socket.c: suppress warningsnobu
* ext/socket/socket.c (rsock_socketpair0): suppress unused label warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28* ext/socket: Avoid redundant fcntl/fstat syscalls for cloexecakr
sockets. Patch by Eric Wong. [ruby-core:59429] [Feature #9330] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-21Several more OS information for TYPE_IP_MULTICAST_LOOP andakr
TYPE_IP_MULTICAST_TTL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20ext/socket/option.c: fix typonobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20* ext/socket/option.c: Use "int" for IP_MULTICAST_LOOP andakr
IP_MULTICAST_TTL on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20* ext/socket/option.c: Use "int" for IP_MULTICAST_LOOP andakr
IP_MULTICAST_TTL on Mac OS X. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20* ext/socket/option.c: Use "byte" as default argument forakr
IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket option to follow the original multicast implementation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20* ext/socket/option.c: Use preprocessor macros to avoid repeatedakr
conditionals. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19socket/option.c: helper functionsnobu
* ext/socket/option.c (sockopt_pack_byte, sockopt_pack_int): extract helper functions to pack integers in a String. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19socket/option.c: revert r44647nobu
* ext/socket/option.c (NUM2SOCKOPT, sockopt_value): revert because these names are confusing. [ruby-dev:47903] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e