<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/curl.git/lib/select.c, branch bagder/configure-dis-https-proxy</title>
<subtitle>github.com: bagder/curl.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/curl.git/'/>
<entry>
<title>select: align poll emulation to return all relevant events</title>
<updated>2020-09-02T14:26:20+00:00</updated>
<author>
<name>Marc Hoersken</name>
<email>info@marc-hoersken.de</email>
</author>
<published>2020-08-31T08:49:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/curl.git/commit/?id=20d74b7393d5aedcc9d54c92b8ed56cae473d04e'/>
<id>20d74b7393d5aedcc9d54c92b8ed56cae473d04e</id>
<content type='text'>
The poll emulation via select already consumes POLLRDNORM,
POLLWRNORM and POLLRDBAND as input events. Therefore it
should also return them as output events if signaled.

Also fix indentation in input event handling block.

Assisted-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Replaces #5852
Closes #5883
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The poll emulation via select already consumes POLLRDNORM,
POLLWRNORM and POLLRDBAND as input events. Therefore it
should also return them as output events if signaled.

Also fix indentation in input event handling block.

Assisted-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Replaces #5852
Closes #5883
</pre>
</div>
</content>
</entry>
<entry>
<title>select: simplify return code handling for poll and select</title>
<updated>2020-08-29T07:48:59+00:00</updated>
<author>
<name>Marc Hoersken</name>
<email>info@marc-hoersken.de</email>
</author>
<published>2020-08-28T16:21:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/curl.git/commit/?id=05729b66c56fe67ce96a1a0a037cd4946aa46e36'/>
<id>05729b66c56fe67ce96a1a0a037cd4946aa46e36</id>
<content type='text'>
poll and select already return -1 on error according to POSIX,
so there is no need to perform a &lt;0 to -1 conversion in code.

Also we can just use one check with &lt;= 0 on the return code.

Assisted-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Replaces #5852
Closes #5880
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
poll and select already return -1 on error according to POSIX,
so there is no need to perform a &lt;0 to -1 conversion in code.

Also we can just use one check with &lt;= 0 on the return code.

Assisted-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Replaces #5852
Closes #5880
</pre>
</div>
</content>
</entry>
<entry>
<title>select: reduce duplication of Curl_poll in Curl_socket_check</title>
<updated>2020-08-25T09:21:44+00:00</updated>
<author>
<name>Marc Hoersken</name>
<email>info@marc-hoersken.de</email>
</author>
<published>2020-04-19T18:27:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/curl.git/commit/?id=17f58c8d98a0de2e88d49cdba1cc1e0145cada91'/>
<id>17f58c8d98a0de2e88d49cdba1cc1e0145cada91</id>
<content type='text'>
Change Curl_socket_check to use select-fallback in Curl_poll
instead of implementing it in Curl_socket_check and Curl_poll.

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Replaces #5262 and #5492
Closes #5707
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change Curl_socket_check to use select-fallback in Curl_poll
instead of implementing it in Curl_socket_check and Curl_poll.

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Replaces #5262 and #5492
Closes #5707
</pre>
</div>
</content>
</entry>
<entry>
<title>select: fix poll-based check not detecting connect failure</title>
<updated>2020-08-25T09:20:58+00:00</updated>
<author>
<name>Marc Hoersken</name>
<email>info@marc-hoersken.de</email>
</author>
<published>2020-07-21T18:17:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/curl.git/commit/?id=e21bd22f842dc07ee953fac6a1edd0c054f123d4'/>
<id>e21bd22f842dc07ee953fac6a1edd0c054f123d4</id>
<content type='text'>
This commit changes Curl_socket_check to use POLLPRI to
check for connect failure on the write socket, because
POLLPRI maps to fds_err. This is in line with select(2).

The select-based socket check correctly checks for connect
failures by adding the write socket also to fds_err.

The poll-based implementation (which internally can itself
fallback to select again) did not previously check for
connect failure by using POLLPRI with the write socket.

See the follow up commit to this for more information.

This commit makes sure connect failures can be detected
and handled if HAVE_POLL_FINE is defined, eg. on msys2-devel.

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Replaces #5509
Prepares #5707
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit changes Curl_socket_check to use POLLPRI to
check for connect failure on the write socket, because
POLLPRI maps to fds_err. This is in line with select(2).

The select-based socket check correctly checks for connect
failures by adding the write socket also to fds_err.

The poll-based implementation (which internally can itself
fallback to select again) did not previously check for
connect failure by using POLLPRI with the write socket.

See the follow up commit to this for more information.

This commit makes sure connect failures can be detected
and handled if HAVE_POLL_FINE is defined, eg. on msys2-devel.

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Replaces #5509
Prepares #5707
</pre>
</div>
</content>
</entry>
<entry>
<title>select: remove the unused ELAPSED_MS() macro</title>
<updated>2020-06-17T22:11:25+00:00</updated>
<author>
<name>Daniel Stenberg</name>
<email>daniel@haxx.se</email>
</author>
<published>2020-06-17T06:44:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/curl.git/commit/?id=3bf18cdadd91bbd5250b257bc1b933f0c02a9591'/>
<id>3bf18cdadd91bbd5250b257bc1b933f0c02a9591</id>
<content type='text'>
Closes #5573
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #5573
</pre>
</div>
</content>
</entry>
<entry>
<title>select: always use Sleep in Curl_wait_ms on Win32</title>
<updated>2020-06-01T06:32:21+00:00</updated>
<author>
<name>Marc Hoersken</name>
<email>info@marc-hoersken.de</email>
</author>
<published>2020-06-01T06:32:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/curl.git/commit/?id=5325b92a0a3c2b29a4be03ed88c14972114774af'/>
<id>5325b92a0a3c2b29a4be03ed88c14972114774af</id>
<content type='text'>
Since Win32 almost always will also have USE_WINSOCK,
we can reduce complexity and always use Sleep there.

Assisted-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Follow up to #5343
Closes #5489
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since Win32 almost always will also have USE_WINSOCK,
we can reduce complexity and always use Sleep there.

Assisted-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Follow up to #5343
Closes #5489
</pre>
</div>
</content>
</entry>
<entry>
<title>select: add overflow checks for timeval conversions</title>
<updated>2020-05-30T08:21:23+00:00</updated>
<author>
<name>Marc Hoersken</name>
<email>info@marc-hoersken.de</email>
</author>
<published>2020-05-27T15:24:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/curl.git/commit/?id=fc55c723c4ecebabf12c32caddd0f9bc9d169ed4'/>
<id>fc55c723c4ecebabf12c32caddd0f9bc9d169ed4</id>
<content type='text'>
Using time_t and suseconds_t if suseconds_t is available,
long on Windows (maybe others in the future) and int elsewhere.

Also handle case of ULONG_MAX being greater or equal to INFINITE.

Assisted-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Part of #5343
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using time_t and suseconds_t if suseconds_t is available,
long on Windows (maybe others in the future) and int elsewhere.

Also handle case of ULONG_MAX being greater or equal to INFINITE.

Assisted-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Part of #5343
</pre>
</div>
</content>
</entry>
<entry>
<title>select: use timediff_t instead of time_t and int for timeout_ms</title>
<updated>2020-05-30T08:20:40+00:00</updated>
<author>
<name>Marc Hoersken</name>
<email>info@marc-hoersken.de</email>
</author>
<published>2020-05-05T19:39:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/curl.git/commit/?id=4a8f459837e2b7dc146825fc9a864045f7d1ae4a'/>
<id>4a8f459837e2b7dc146825fc9a864045f7d1ae4a</id>
<content type='text'>
Make all functions in select.[ch] take timeout_ms as timediff_t
which should always be large enough and signed on all platforms
to take all possible timeout values and avoid type conversions.

Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Replaces #5107 and partially #5262
Related to #5240 and #5286
Closes #5343
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make all functions in select.[ch] take timeout_ms as timediff_t
which should always be large enough and signed on all platforms
to take all possible timeout values and avoid type conversions.

Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Replaces #5107 and partially #5262
Related to #5240 and #5286
Closes #5343
</pre>
</div>
</content>
</entry>
<entry>
<title>select: fix overflow protection in Curl_socket_check</title>
<updated>2020-05-02T19:02:20+00:00</updated>
<author>
<name>Jay Satiro</name>
<email>raysatiro@yahoo.com</email>
</author>
<published>2020-04-23T19:08:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/curl.git/commit/?id=85eda4e87aa54b6412a81f8544939430fc89b8d9'/>
<id>85eda4e87aa54b6412a81f8544939430fc89b8d9</id>
<content type='text'>
Follow-up to a96c752 which changed the timeout_ms type from time_t to
timediff_t.

Ref: https://github.com/curl/curl/pull/5240

Closes https://github.com/curl/curl/pull/5286
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow-up to a96c752 which changed the timeout_ms type from time_t to
timediff_t.

Ref: https://github.com/curl/curl/pull/5240

Closes https://github.com/curl/curl/pull/5286
</pre>
</div>
</content>
</entry>
<entry>
<title>select: make Curl_socket_check take timediff_t timeout</title>
<updated>2020-04-23T13:57:23+00:00</updated>
<author>
<name>Daniel Stenberg</name>
<email>daniel@haxx.se</email>
</author>
<published>2020-04-15T08:27:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/curl.git/commit/?id=a96c7529eb31498a464910935a7d1a5e88ce3914'/>
<id>a96c7529eb31498a464910935a7d1a5e88ce3914</id>
<content type='text'>
Coverity found CID 1461718:

Integer handling issues (CONSTANT_EXPRESSION_RESULT) "timeout_ms &gt;
9223372036854775807L" is always false regardless of the values of its
operands. This occurs as the logical second operand of "||".

Closes #5240
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Coverity found CID 1461718:

Integer handling issues (CONSTANT_EXPRESSION_RESULT) "timeout_ms &gt;
9223372036854775807L" is always false regardless of the values of its
operands. This occurs as the logical second operand of "||".

Closes #5240
</pre>
</div>
</content>
</entry>
</feed>
