summaryrefslogtreecommitdiff
path: root/ext/socket
AgeCommit message (Collapse)Author
2021-02-04[DOC] Fix typo in ext/socket/socket.c [ci skip]Dimitris Zorbas
Notes: Merged: https://github.com/ruby/ruby/pull/4150
2021-01-05[DOC] Fix grammar: "is same as" -> "is the same as"Marcus Stollsteimer
2020-12-29Fix compile error of sockssocketMasaki Matsushita
The patch is provided by PhobosK (Phobos Kappa). This should be backported to Ruby 3.0. [Feature #17187]
2020-12-22Removed rb_cData entityNobuyoshi Nakada
* Use the wrapper of rb_cObject instead of data access * Replaced rest of extentions * Updated the version guard for Data * Added the version guard of rb_cData Notes: Merged: https://github.com/ruby/ruby/pull/3961
2020-12-18socket is ractor-safe.Koichi Sasada
2020-12-11Remove unimplemented parameter from commentMasaki Matsushita
:resolv_timeout of TCPSocket.new is not implemented for now.
2020-12-10Add connect_timeout to TCPSocketMasaki Matsushita
Add connect_timeout to TCPSocket.new in the same way as Socket.tcp. Closes [Feature #17187]
2020-12-07Revert getaddrinfo_a()Masaki Matsushita
getaddrinfo_a() gets stuck after fork(). To avoid this, we need 1 second sleep to wait for internal worker threads of getaddrinfo_a() to be finished, but that is unacceptable. [Bug #17220] [Feature #17134] [Feature #17187]
2020-12-06Call cleanup function for getaddrinfo_a(3) only before fork()Masaki Matsushita
Previously, rb_getaddrinfo_a_before_exec() is called from before_exec(). However, the function needs to be called only before fork(). The change moves it to before_fork().
2020-12-06Extend sleep time to 1.5 second in rb_getaddrinfo_a_before_exec()Masaki Matsushita
After 94d49ed31c, TestSocket#test_getaddrinfo_after_fork fails in some platforms. To avoid this, the change extends sleep time to 1.5 second.
2020-12-04Add a hook before fork() for getaddrinfo_a()Masaki Matsushita
We need stop worker threads in getaddrinfo_a() before fork(). This change adds a hook before fork() that cancel all outstanding requests and wait for all ongoing requests. Then, it waits for all worker threads to be finished. Fixes [Bug #17220]
2020-11-01ext/socket/rubysocket.h: avoid the conflict of T_DATA definition in AIXRei Odaira
2020-10-28Use public allocators for creating new T_OBJECT objectsAaron Patterson
This way the header flags and object internals are set correctly Notes: Merged: https://github.com/ruby/ruby/pull/3719
2020-09-27ext/socket/ipsocket.c: prevent "warning: unused variable 'resolv_timeout'"Yusuke Endoh
2020-09-25Add comments for resolv_timeoutMasaki Matsushita
2020-09-25Add resolve_timeout to TCPSocket [Feature #17134]Masaki Matsushita
2020-08-29Show deprecation warning on Socket.gethostbyname and Socket.gethostbyaddrMasaki Matsushita
2020-08-28Show deprecation warning on TCPSocket.gethostbynameMasaki Matsushita
2020-08-27Adjust indents [ci skip]Nobuyoshi Nakada
2020-08-27sed -i '/rmodule.h/d'卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3347
2020-08-27Make Socket.getaddrinfo interruptible (#2827)Kir Shatrov
Before, Socket.getaddrinfo was using a blocking getaddrinfo(3) call. That didn't allow to wrap it into Timeout.timeout or interrupt the thread in any way. Combined with the default 10 sec resolv timeout on many Unix systems, this can have a very noticeable effect on production Ruby apps being not resilient to DNS outages and timing out name resolution, and being unable to fail fast even with Timeout.timeout. Since we already have support for getaddrinfo_a(3), the async version of getaddrinfo, we should be able to make Socket.getaddrinfo leverage that when getaddrinfo_a version is available in the system (hence #ifdef HAVE_GETADDRINFO_A). Related tickets: https://bugs.ruby-lang.org/issues/16476 https://bugs.ruby-lang.org/issues/16381 https://bugs.ruby-lang.org/issues/14997 Notes: Merged-By: mmasaki <glass.saga@gmail.com>
2020-08-27sed -i '/r_cast.h/d'卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3346
2020-08-27sed -i '\,2/extern.h,d'卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3338
2020-05-14Thread scheduler for light weight concurrency.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3032 Merged-By: ioquatix <samuel@codeotaku.com>
2020-05-11sed -i 's|ruby/impl|ruby/internal|'卜部昌平
To fix build failures. Notes: Merged: https://github.com/ruby/ruby/pull/3079
2020-05-11sed -i s|ruby/3|ruby/impl|g卜部昌平
This shall fix compile errors. Notes: Merged: https://github.com/ruby/ruby/pull/3079
2020-04-27Fix a typo [ci skip]Kazuhiro NISHIYAMA
2020-04-08Merge pull request #2991 from shyouhei/ruby.h卜部昌平
Split ruby.h Notes: Merged-By: shyouhei <shyouhei@ruby-lang.org>
2020-03-31ext/socket/init.c: do not return uninitialized bufferYusuke Endoh
Resize string buffer only if some data is received in BasicSocket#read_nonblock and some methods. Co-Authored-By: Samuel Williams <samuel.williams@oriontransfer.co.nz>
2019-12-31Updated dependencies on internal/warnings.hNobuyoshi Nakada
Needed for `UNALIGNED_MEMBER_ACCESS` using `COMPILER_WARNING_`* macros. Notes: Merged: https://github.com/ruby/ruby/pull/2799
2019-12-26update dependencies卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/2711
2019-12-26decouple internal.h headers卜部昌平
Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies). Notes: Merged: https://github.com/ruby/ruby/pull/2711
2019-11-18Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans
This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby. Notes: Merged: https://github.com/ruby/ruby/pull/2476
2019-11-18Warn on access/modify of $SAFE, and remove effects of modifying $SAFEJeremy Evans
This removes the security features added by $SAFE = 1, and warns for access or modification of $SAFE from Ruby-level, as well as warning when calling all public C functions related to $SAFE. This modifies some internal functions that took a safe level argument to no longer take the argument. rb_require_safe now warns, rb_require_string has been added as a version that takes a VALUE and does not warn. One public C function that still takes a safe level argument and that this doesn't warn for is rb_eval_cmd. We may want to consider adding an alternative method that does not take a safe level argument, and warn for rb_eval_cmd. Notes: Merged: https://github.com/ruby/ruby/pull/2476
2019-11-01Clean up implementation of SOCKSSocket, its confusing and undocumentedJustin McNally
Notes: Merged: https://github.com/ruby/ruby/pull/2539
2019-11-01Prefer libsocksd over libsocksJustin McNally
Notes: Merged: https://github.com/ruby/ruby/pull/2538
2019-11-01Support libsocksd socks library for SOCKSSocketJustin McNally
Notes: Merged: https://github.com/ruby/ruby/pull/2538
2019-09-10Support timeout for AddrinfoMasaki Matsushita
Addrinfo.getaddrinfo and .foreach now accepts :timeout in seconds as a keyword argument. If getaddrinfo_a(3) is available, the timeout will be applied for name resolution. Otherwise, it will be ignored. Socket.tcp accepts :resolv_timeout to use this feature. This commit is retry of 6382f5cc91ac9e36776bc854632d9a1237250da7. Test was failed on Solaris machines which don't have "http" in /etc/services. In this commit, use "ssh" instead.
2019-09-09Revert "Support timeout for Addrinfo"Masaki Matsushita
This reverts commit 6382f5cc91ac9e36776bc854632d9a1237250da7. test failed on Solaris.
2019-09-09Support timeout for AddrinfoMasaki Matsushita
Addrinfo.getaddrinfo and .foreach now accepts :timeout in seconds as a keyword argument. If getaddrinfo_a(3) is available, the timeout will be applied for name resolution. Otherwise, it will be ignored. Socket.tcp accepts :resolv_timeout to use this feature.
2019-08-29drop-in type check for rb_define_singleton_method卜部昌平
We can check the function pointer passed to rb_define_singleton_method like how we do so in rb_define_method. Doing so revealed many arity mismatches.
2019-08-27rb_ensure now free from ANYARGS卜部昌平
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_ensure, which also revealed many arity / type mismatches.
2019-08-16Hoisted out unixsocket_len, triming NUL chars from sun_pathNobuyoshi Nakada
2019-07-16Constified afamily functionsNobuyoshi Nakada
2019-07-14socket: use frozen string buffer when releasing GVLTanaka Akira
Thanks for the patch by normalperson (Eric Wong) [Bug #14204].
2019-07-14Include ruby/assert.h in ruby/ruby.h so that assertions can be thereNobuyoshi Nakada
2019-06-11* expand tabs.git
2019-06-11ext/socket/ipsocket.c: Use SO_REUSEADDR for local_host/portYusuke Endoh
Sometimes ruby/spec fails when trying to specify local_host and local_port for TCPSocket.open. https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20190610T192504Z.fail.html.gz
2019-05-23Suppress paranoid warnings for external/3rd-party librariesNobuyoshi Nakada
[Feature #15665]
2019-02-08Removed moving toplevel header since r12501nobu
Moving public headers was 12-years ago, no depend files would expect ruby.h in the top source directory now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e