<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/ext/socket, branch ruby_3_3</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) beb85e7eeee4163cd45b69645a60cdb942f72c05: [Backport #21705]</title>
<updated>2025-11-30T01:36:56+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-11-30T01:36:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1974ccabbfdc73e78e758a6ad7ea8542e2119432'/>
<id>1974ccabbfdc73e78e758a6ad7ea8542e2119432</id>
<content type='text'>
	[PATCH] [Bug #21705] Fix segfaults on Windows

	It should check the type of the argument and coercion before
	converting the encoding.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[PATCH] [Bug #21705] Fix segfaults on Windows

	It should check the type of the argument and coercion before
	converting the encoding.
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) d77e02bd85ab7f841df8d473bac214b9a92a3506: [Backport #21497]</title>
<updated>2025-07-20T06:49:08+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-07-20T06:49:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1e37f34eaad715119d49c13e0bf6e6c54c5cbca6'/>
<id>1e37f34eaad715119d49c13e0bf6e6c54c5cbca6</id>
<content type='text'>
	[Bug #21497] [ruby/socket]: add full prototype
	MIME-Version: 1.0
	Content-Type: text/plain; charset=UTF-8
	Content-Transfer-Encoding: 8bit

	otherwise, gcc 15 will complain:

	&gt; init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3
	&gt;   573 |     return (VALUE)Rconnect(arg-&gt;fd, arg-&gt;sockaddr, arg-&gt;len);
	&gt;       |                   ^~~~~~~~ ~~~~~~~
	&gt; In file included from init.c:11:
	&gt; rubysocket.h:294:5: note: declared here
	&gt;   294 | int Rconnect();
	&gt;       |     ^~~~~~~~

	&gt; sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1
	&gt;    33 |         SOCKSinit("ruby");
	&gt;       |         ^~~~~~~~~ ~~~~~~
	&gt; In file included from sockssocket.c:11:
	&gt; rubysocket.h:293:6: note: declared here
	&gt;   293 | void SOCKSinit();
	&gt;       |      ^~~~~~~~~

	Signed-off-by: Z. Liu &lt;zhixu.liu@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #21497] [ruby/socket]: add full prototype
	MIME-Version: 1.0
	Content-Type: text/plain; charset=UTF-8
	Content-Transfer-Encoding: 8bit

	otherwise, gcc 15 will complain:

	&gt; init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3
	&gt;   573 |     return (VALUE)Rconnect(arg-&gt;fd, arg-&gt;sockaddr, arg-&gt;len);
	&gt;       |                   ^~~~~~~~ ~~~~~~~
	&gt; In file included from init.c:11:
	&gt; rubysocket.h:294:5: note: declared here
	&gt;   294 | int Rconnect();
	&gt;       |     ^~~~~~~~

	&gt; sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1
	&gt;    33 |         SOCKSinit("ruby");
	&gt;       |         ^~~~~~~~~ ~~~~~~
	&gt; In file included from sockssocket.c:11:
	&gt; rubysocket.h:293:6: note: declared here
	&gt;   293 | void SOCKSinit();
	&gt;       |      ^~~~~~~~~

	Signed-off-by: Z. Liu &lt;zhixu.liu@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>retry on cancelling of `getaddrinfo` (#11131)</title>
<updated>2024-07-09T15:55:04+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2024-07-09T15:55:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3427a1679a8ca30465c684ac28449f495bff8a22'/>
<id>3427a1679a8ca30465c684ac28449f495bff8a22</id>
<content type='text'>
When the registerred unblock function is called, it should retry
the cancelled blocking function if possible after checkints.

For example, `SIGCHLD` can cancel this method, but it should not
raise any exception if there is no trap handlers.

The following is repro-code:

```ruby
require 'socket'
PN = 10_000

1000000.times{
  p _1
  PN.times{
    fork{
      sleep rand(0.3)
    }
  }
  i = 0
  while i&lt;PN
    cpid = Process.wait -1, Process::WNOHANG
    if cpid
      # p [i, cpid]
      i += 1
    end

    begin
      TCPServer.new(nil, 0).close
    rescue
      p $!
      exit!
    end
  end
}
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the registerred unblock function is called, it should retry
the cancelled blocking function if possible after checkints.

For example, `SIGCHLD` can cancel this method, but it should not
raise any exception if there is no trap handlers.

The following is repro-code:

```ruby
require 'socket'
PN = 10_000

1000000.times{
  p _1
  PN.times{
    fork{
      sleep rand(0.3)
    }
  }
  i = 0
  while i&lt;PN
    cpid = Process.wait -1, Process::WNOHANG
    if cpid
      # p [i, cpid]
      i += 1
    end

    begin
      TCPServer.new(nil, 0).close
    rescue
      p $!
      exit!
    end
  end
}
```</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) fba8aff7, d8c6e91748871ab2287d7703347847fe18a292d2: [Backport #20592]</title>
<updated>2024-07-08T22:58:13+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-07-08T22:58:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9d583dd43a24354e8ae58c089cf091c1243e6e60'/>
<id>9d583dd43a24354e8ae58c089cf091c1243e6e60</id>
<content type='text'>
	[Bug #20592] Fix segfault when sending NULL to freeaddrinfo

	On alpine freeaddrinfo does not accept NULL pointer

	Fix dangling `else`
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #20592] Fix segfault when sending NULL to freeaddrinfo

	On alpine freeaddrinfo does not accept NULL pointer

	Fix dangling `else`
</pre>
</div>
</content>
</entry>
<entry>
<title>Initialize errno variables and fix maybe-uninitialized warnings</title>
<updated>2024-05-29T17:48:19+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-01-24T10:33:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bcf5cd3ba47e70c5c1c6328f61887bbac2f9d41b'/>
<id>bcf5cd3ba47e70c5c1c6328f61887bbac2f9d41b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #20208] Revert "Set AI_ADDRCONFIG when making getaddrinfo(3) calls for outgoi… (#9791)</title>
<updated>2024-03-14T16:27:05+00:00</updated>
<author>
<name>KJ Tsanaktsidis</name>
<email>kj@kjtsanaktsidis.id.au</email>
</author>
<published>2024-03-14T16:27:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=606dd03e9b0d4cf65ef56e52fab063e3ed5ef797'/>
<id>606dd03e9b0d4cf65ef56e52fab063e3ed5ef797</id>
<content type='text'>
Revert "Set AI_ADDRCONFIG when making getaddrinfo(3) calls for outgoing conns"

This reverts commit 673ed41c81cf5a6951bcb2c3dec82d7bd6ea7440.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Revert "Set AI_ADDRCONFIG when making getaddrinfo(3) calls for outgoing conns"

This reverts commit 673ed41c81cf5a6951bcb2c3dec82d7bd6ea7440.</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 6c0e58a54e3fda604386d9c409e2a9998bbc9352: [Backport #20198] (#10252)</title>
<updated>2024-03-14T09:42:28+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>nurse@users.noreply.github.com</email>
</author>
<published>2024-03-14T09:42:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a889304fed63c3206f27d614ab75219271fb4ca9'/>
<id>a889304fed63c3206f27d614ab75219271fb4ca9</id>
<content type='text'>
Make sure the correct error is raised for EAI_SYSTEM resolver fail

	In case of EAI_SYSTEM, getaddrinfo is supposed to set more detail in
	errno; however, because we call getaddrinfo on a thread now, and errno
	is threadlocal, that information is being lost. Instead, we just raise
	whatever errno happens to be on the calling thread (which can be
	something very confusing, like `ECHILD`).

	Fix it by explicitly propagating errno back to the calling thread
	through the getaddrinfo_arg structure.

	[Bug #20198]
	---
	 ext/socket/raddrinfo.c | 25 +++++++++++++++++++------
	 1 file changed, 19 insertions(+), 6 deletions(-)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make sure the correct error is raised for EAI_SYSTEM resolver fail

	In case of EAI_SYSTEM, getaddrinfo is supposed to set more detail in
	errno; however, because we call getaddrinfo on a thread now, and errno
	is threadlocal, that information is being lost. Instead, we just raise
	whatever errno happens to be on the calling thread (which can be
	something very confusing, like `ECHILD`).

	Fix it by explicitly propagating errno back to the calling thread
	through the getaddrinfo_arg structure.

	[Bug #20198]
	---
	 ext/socket/raddrinfo.c | 25 +++++++++++++++++++------
	 1 file changed, 19 insertions(+), 6 deletions(-)</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 1bd98c820da46a05328d2d53b8f748f28e7ee8f7: [Backport #20172] (#9798)</title>
<updated>2024-02-03T15:47:32+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>nurse@users.noreply.github.com</email>
</author>
<published>2024-02-03T15:47:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=53d4e9c4bbba077a569549a01a8263e5e8f59ee8'/>
<id>53d4e9c4bbba077a569549a01a8263e5e8f59ee8</id>
<content type='text'>
Remove setaffinity of pthread for getaddrinfo

	It looks like `sched_getcpu(3)` returns a strange number on some
	(virtual?) environments.

	I decided to remove the setaffinity mechanism because the performance
	does not appear to degrade on a quick benchmark even if removed.

	[Bug #20172]
	---
	 ext/socket/extconf.rb  |  2 --
	 ext/socket/raddrinfo.c | 48 ++++--------------------------------------------
	 2 files changed, 4 insertions(+), 46 deletions(-)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove setaffinity of pthread for getaddrinfo

	It looks like `sched_getcpu(3)` returns a strange number on some
	(virtual?) environments.

	I decided to remove the setaffinity mechanism because the performance
	does not appear to degrade on a quick benchmark even if removed.

	[Bug #20172]
	---
	 ext/socket/extconf.rb  |  2 --
	 ext/socket/raddrinfo.c | 48 ++++--------------------------------------------
	 2 files changed, 4 insertions(+), 46 deletions(-)</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 6aacbd690ccde53f9b97c6673482cb11df3f2955: [Backport #20149]</title>
<updated>2024-02-01T01:39:54+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2024-02-01T01:39:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2886564279dff87a6c293f6e80436eb2b309967e'/>
<id>2886564279dff87a6c293f6e80436eb2b309967e</id>
<content type='text'>
	Free pthread_attr after setting up the thread

	[bug #20149]
	---
	 ext/socket/raddrinfo.c | 12 +++++++++++-
	 1 file changed, 11 insertions(+), 1 deletion(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Free pthread_attr after setting up the thread

	[bug #20149]
	---
	 ext/socket/raddrinfo.c | 12 +++++++++++-
	 1 file changed, 11 insertions(+), 1 deletion(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>Update `BasicSocket#recv` documentation on return value</title>
<updated>2023-12-18T11:58:08+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2023-12-18T09:17:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b2fc1b054e9c1a04c20c696f6889b6143e9b8592'/>
<id>b2fc1b054e9c1a04c20c696f6889b6143e9b8592</id>
<content type='text'>
Ref: https://github.com/ruby/ruby/pull/6407

[Bug #19012]

`0` is now interpreted as closed connection an not an
empty packet, as these are very rare and pretty much
useless.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ref: https://github.com/ruby/ruby/pull/6407

[Bug #19012]

`0` is now interpreted as closed connection an not an
empty packet, as these are very rare and pretty much
useless.
</pre>
</div>
</content>
</entry>
</feed>
