<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/net/http/utils.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/net-http] Refactor HTTPS tests</title>
<updated>2025-12-15T06:08:39+00:00</updated>
<author>
<name>Kazuki Yamaguchi</name>
<email>k@rhe.jp</email>
</author>
<published>2025-12-13T08:30:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=700487ce21f0991fb5d4042707d12b2966670f1e'/>
<id>700487ce21f0991fb5d4042707d12b2966670f1e</id>
<content type='text'>
This contains various improvements in tests for openssl integration:

  - Remove DHE parameters from test servers. OpenSSL is almost always
    compiled with ECC support nowadays and will prefer ECDHE over DHE.
  - Remove an outdated omission for a bug in OpenSSL 1.1.0h released in
    2018. None of our CI systems use this specific OpenSSL version.
  - Use top-level return to skip tests if openssl is unavailable.
  - Refactor tests for Net::HTTP#verify_callback.

https://github.com/ruby/net-http/commit/35c1745a26
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This contains various improvements in tests for openssl integration:

  - Remove DHE parameters from test servers. OpenSSL is almost always
    compiled with ECC support nowadays and will prefer ECDHE over DHE.
  - Remove an outdated omission for a bug in OpenSSL 1.1.0h released in
    2018. None of our CI systems use this specific OpenSSL version.
  - Use top-level return to skip tests if openssl is unavailable.
  - Refactor tests for Net::HTTP#verify_callback.

https://github.com/ruby/net-http/commit/35c1745a26
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/net-http] Fixed test case for default content-type.</title>
<updated>2025-06-11T03:35:12+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-06-11T01:45:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=82e3312493a26fc56e2823c07e261d1bf61edd42'/>
<id>82e3312493a26fc56e2823c07e261d1bf61edd42</id>
<content type='text'>
I changed content-type of request to "application/octet-stream" if request didn't have
content-type.

https://github.com/ruby/net-http/commit/fc5870d2ac
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I changed content-type of request to "application/octet-stream" if request didn't have
content-type.

https://github.com/ruby/net-http/commit/fc5870d2ac
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/net-http] Don't double-interrupt the test HTTP server</title>
<updated>2024-12-31T10:00:41+00:00</updated>
<author>
<name>Charles Oliver Nutter</name>
<email>headius@headius.com</email>
</author>
<published>2024-12-10T05:40:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=89c9a9fd03df264cb11314dd4264d79eff7be3d9'/>
<id>89c9a9fd03df264cb11314dd4264d79eff7be3d9</id>
<content type='text'>
The shutdown process here attempted to terminate the test server
by interrupting it with Thread#kill, and then proceeded to close
the server and join the thread. The kill does indeed interrupt
the accept call, but the close call could also interrupt the
thread as part of notifying blocked threads waiting on that
socket call.

In JRuby, where all of this can happen at the same time, it leads
to the following scenario:

* The server thread enters TCPServer#accept and blocks.
* The main thread calls Thread#kill to interrupt the accept call.
* The server thread wakes up and starts to propagate the kill.
  There is a slight delay between this wakeup and removing the
  server thread from the TCPServer's blocked threads list.
* The main thread calls TCPServer#close, which sees that the server
  thread is still in the blocked list, so it initiates a second
  interrupt to raise IOError "closed in another thread" on the
  server thread.
* As the kill is bubbling out, another check for interrupts occurs,
  causing it to see the new raise interrupt and propagate that
  instead of the active kill.
* Because the server is now closed and the rescue here is empty,
  the server loop will endlessly attempt and fail to call accept.

I was unable to determine how CRuby avoids this race. There may be
code that prevents an active kill interrupt from triggering
further interrupts.

In order to get these tests running on JRuby, I've made the
following changes:

* Only kill the thread; one interrupt is sufficient to break it
  out of the accept call.
* Ensure outside the server loop that the server gets closed. This
  happens within the server thread, so triggers no new interrupts.
* Minor cleanup for the pattern of using @ssl_server or @server.

This change avoids the race in JRuby (and possibly other parallel-
threaded implementations) and does not impact the behavior of the
tests.

https://github.com/ruby/net-http/commit/54025b3870
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The shutdown process here attempted to terminate the test server
by interrupting it with Thread#kill, and then proceeded to close
the server and join the thread. The kill does indeed interrupt
the accept call, but the close call could also interrupt the
thread as part of notifying blocked threads waiting on that
socket call.

In JRuby, where all of this can happen at the same time, it leads
to the following scenario:

* The server thread enters TCPServer#accept and blocks.
* The main thread calls Thread#kill to interrupt the accept call.
* The server thread wakes up and starts to propagate the kill.
  There is a slight delay between this wakeup and removing the
  server thread from the TCPServer's blocked threads list.
* The main thread calls TCPServer#close, which sees that the server
  thread is still in the blocked list, so it initiates a second
  interrupt to raise IOError "closed in another thread" on the
  server thread.
* As the kill is bubbling out, another check for interrupts occurs,
  causing it to see the new raise interrupt and propagate that
  instead of the active kill.
* Because the server is now closed and the rescue here is empty,
  the server loop will endlessly attempt and fail to call accept.

I was unable to determine how CRuby avoids this race. There may be
code that prevents an active kill interrupt from triggering
further interrupts.

In order to get these tests running on JRuby, I've made the
following changes:

* Only kill the thread; one interrupt is sufficient to break it
  out of the accept call.
* Ensure outside the server loop that the server gets closed. This
  happens within the server thread, so triggers no new interrupts.
* Minor cleanup for the pattern of using @ssl_server or @server.

This change avoids the race in JRuby (and possibly other parallel-
threaded implementations) and does not impact the behavior of the
tests.

https://github.com/ruby/net-http/commit/54025b3870
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/net-http] Prevent warnings</title>
<updated>2024-09-13T02:39:11+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-09-13T02:30:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6ae05584bdceb8e8fc5db248d8f4fa7e2c8022c7'/>
<id>6ae05584bdceb8e8fc5db248d8f4fa7e2c8022c7</id>
<content type='text'>
```
/home/chkbuild/chkbuild/tmp/build/20240913T003003Z/ruby/test/net/http/utils.rb:32: warning: assigned but unused variable - e
/home/chkbuild/chkbuild/tmp/build/20240913T003003Z/ruby/test/net/http/utils.rb:61: warning: assigned but unused variable - version
/home/chkbuild/chkbuild/tmp/build/20240913T003003Z/ruby/test/net/http/utils.rb:124: warning: method redefined; discarding old query
```

https://github.com/ruby/net-http/commit/6f818346ce
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
/home/chkbuild/chkbuild/tmp/build/20240913T003003Z/ruby/test/net/http/utils.rb:32: warning: assigned but unused variable - e
/home/chkbuild/chkbuild/tmp/build/20240913T003003Z/ruby/test/net/http/utils.rb:61: warning: assigned but unused variable - version
/home/chkbuild/chkbuild/tmp/build/20240913T003003Z/ruby/test/net/http/utils.rb:124: warning: method redefined; discarding old query
```

https://github.com/ruby/net-http/commit/6f818346ce
</pre>
</div>
</content>
</entry>
<entry>
<title>Wait for server threads to finish</title>
<updated>2024-07-29T23:33:43+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-07-29T08:27:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=30f57637ee2399d754cf78f09e8aa275923dff0d'/>
<id>30f57637ee2399d754cf78f09e8aa275923dff0d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/net-http] Removed needless NullWriter class</title>
<updated>2024-07-26T01:45:02+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-07-25T08:50:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=83a99bdbe606d3e50fbaa7ea3e260d01c2b76fc8'/>
<id>83a99bdbe606d3e50fbaa7ea3e260d01c2b76fc8</id>
<content type='text'>
https://github.com/ruby/net-http/commit/ddb2a81aed
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/net-http/commit/ddb2a81aed
</pre>
</div>
</content>
</entry>
<entry>
<title>To avoid fd leak with fetch request for SSL server</title>
<updated>2024-07-17T08:37:57+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-07-17T03:49:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2a12e4ffec99f1e7e83b3b2bdfbec1ace2b1202f'/>
<id>2a12e4ffec99f1e7e83b3b2bdfbec1ace2b1202f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/net-http] Removed needless warning</title>
<updated>2024-07-10T23:06:10+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-07-10T10:41:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=492b505d95440a5493d675002bebaeae550b43cd'/>
<id>492b505d95440a5493d675002bebaeae550b43cd</id>
<content type='text'>
https://github.com/ruby/net-http/commit/d867edc0fe
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/net-http/commit/d867edc0fe
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/net-http] Write log after server start, not handling request</title>
<updated>2024-07-10T23:06:09+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-07-10T08:12:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e77bc17e5d11e54b14e8122fffc17e1637aa600e'/>
<id>e77bc17e5d11e54b14e8122fffc17e1637aa600e</id>
<content type='text'>
https://github.com/ruby/net-http/commit/205bac757a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/net-http/commit/205bac757a
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/net-http] Support chunked data and fixed test failure with multipart/form-data</title>
<updated>2024-07-10T23:06:08+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-07-10T08:00:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4e6463ad7a56d7cf55726ff913129790b942ffb9'/>
<id>4e6463ad7a56d7cf55726ff913129790b942ffb9</id>
<content type='text'>
https://github.com/ruby/net-http/commit/b38c2795a9
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/net-http/commit/b38c2795a9
</pre>
</div>
</content>
</entry>
</feed>
