Skip to content

doc/man3/SSL_set_fd.pod: add note about Windows compiler warning#16699

Closed
mspncp wants to merge 1 commit intoopenssl:masterfrom
mspncp:pr-man-ssl-set-fd-add-note
Closed

doc/man3/SSL_set_fd.pod: add note about Windows compiler warning#16699
mspncp wants to merge 1 commit intoopenssl:masterfrom
mspncp:pr-man-ssl-set-fd-add-note

Conversation

@mspncp
Copy link
Contributor

@mspncp mspncp commented Sep 28, 2021

According to an old stackoverflow thread [1], citing an even older comment by
Andy Polyakov (1875e6d, Pull up Win64 support from 0.9.8., 2005-07-05),
a cast of 'SOCKET' (UINT_PTR) to 'int' does not create a problem, because although
the documentation [2] claims that the upper limit is INVALID_SOCKET-1 (2^64 - 2),
in practice the socket() implementation on Windows returns an index into the kernel
handle table, the size of which is limited to 2^24 [3].

Add this note to the manual page to avoid unnecessary roundtrips to StackOverflow.

[1] https://stackoverflow.com/questions/1953639/is-it-safe-to-cast-socket-to-int-under-win64
[2] https://docs.microsoft.com/en-us/windows/win32/winsock/socket-data-type-2
[3] https://docs.microsoft.com/en-us/windows/win32/sysinfo/kernel-objects

This patch applies cleanly to 3.0 and 1.1.1 as well, so I will cherry-pick it if there are no objections.

Checklist
  • documentation is added or updated
  • tests are added or updated

@mspncp mspncp added branch: master Applies to master branch branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL) branch: 3.0 Applies to openssl-3.0 branch labels Sep 28, 2021
According to an old stackoverflow thread [1], citing an even older comment by
Andy Polyakov (1875e6d, Pull up Win64 support from 0.9.8., 2005-07-05),
a cast of 'SOCKET' (UINT_PTR) to 'int' does not create a problem, because although
the documentation [2] claims that the upper limit is INVALID_SOCKET-1 (2^64 - 2),
in practice the socket() implementation on Windows returns an index into the kernel
handle table, the size of which is limited to 2^24 [3].

Add this note to the manual page to avoid unnecessary roundtrips to StackOverflow.

[1] https://stackoverflow.com/questions/1953639/is-it-safe-to-cast-socket-to-int-under-win64
[2] https://docs.microsoft.com/en-us/windows/win32/winsock/socket-data-type-2
[3] https://docs.microsoft.com/en-us/windows/win32/sysinfo/kernel-objects
@mspncp mspncp force-pushed the pr-man-ssl-set-fd-add-note branch from 8c2fdfc to e3f00b3 Compare September 28, 2021 14:29
@mspncp mspncp added the approval: review pending This pull request needs review by a committer label Sep 28, 2021
Copy link
Contributor

@paulidale paulidale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for all three branches.

@paulidale paulidale added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Sep 28, 2021
@t8m t8m added the triaged: documentation The issue/pr deals with documentation (errors) label Sep 29, 2021
@openssl-machine openssl-machine added approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: done This pull request has the required number of approvals labels Sep 30, 2021
@openssl-machine
Copy link
Collaborator

This pull request is ready to merge

openssl-machine pushed a commit that referenced this pull request Sep 30, 2021
According to an old stackoverflow thread [1], citing an even older comment by
Andy Polyakov (1875e6d, Pull up Win64 support from 0.9.8., 2005-07-05),
a cast of 'SOCKET' (UINT_PTR) to 'int' does not create a problem, because although
the documentation [2] claims that the upper limit is INVALID_SOCKET-1 (2^64 - 2),
in practice the socket() implementation on Windows returns an index into the kernel
handle table, the size of which is limited to 2^24 [3].

Add this note to the manual page to avoid unnecessary roundtrips to StackOverflow.

[1] https://stackoverflow.com/questions/1953639/is-it-safe-to-cast-socket-to-int-under-win64
[2] https://docs.microsoft.com/en-us/windows/win32/winsock/socket-data-type-2
[3] https://docs.microsoft.com/en-us/windows/win32/sysinfo/kernel-objects

Reviewed-by: Paul Dale <[email protected]>
(Merged from #16699)
openssl-machine pushed a commit that referenced this pull request Sep 30, 2021
According to an old stackoverflow thread [1], citing an even older comment by
Andy Polyakov (1875e6d, Pull up Win64 support from 0.9.8., 2005-07-05),
a cast of 'SOCKET' (UINT_PTR) to 'int' does not create a problem, because although
the documentation [2] claims that the upper limit is INVALID_SOCKET-1 (2^64 - 2),
in practice the socket() implementation on Windows returns an index into the kernel
handle table, the size of which is limited to 2^24 [3].

Add this note to the manual page to avoid unnecessary roundtrips to StackOverflow.

[1] https://stackoverflow.com/questions/1953639/is-it-safe-to-cast-socket-to-int-under-win64
[2] https://docs.microsoft.com/en-us/windows/win32/winsock/socket-data-type-2
[3] https://docs.microsoft.com/en-us/windows/win32/sysinfo/kernel-objects

Reviewed-by: Paul Dale <[email protected]>
(Merged from #16699)

(cherry picked from commit f8dd586)
openssl-machine pushed a commit that referenced this pull request Sep 30, 2021
According to an old stackoverflow thread [1], citing an even older comment by
Andy Polyakov (1875e6d, Pull up Win64 support from 0.9.8., 2005-07-05),
a cast of 'SOCKET' (UINT_PTR) to 'int' does not create a problem, because although
the documentation [2] claims that the upper limit is INVALID_SOCKET-1 (2^64 - 2),
in practice the socket() implementation on Windows returns an index into the kernel
handle table, the size of which is limited to 2^24 [3].

Add this note to the manual page to avoid unnecessary roundtrips to StackOverflow.

[1] https://stackoverflow.com/questions/1953639/is-it-safe-to-cast-socket-to-int-under-win64
[2] https://docs.microsoft.com/en-us/windows/win32/winsock/socket-data-type-2
[3] https://docs.microsoft.com/en-us/windows/win32/sysinfo/kernel-objects

Reviewed-by: Paul Dale <[email protected]>
(Merged from #16699)

(cherry picked from commit f8dd586)
@mspncp
Copy link
Contributor Author

mspncp commented Sep 30, 2021

Merged, thank you!

c23abef doc/man3/SSL_set_fd.pod: add note about Windows compiler warning (1.1.1)
d31e951 doc/man3/SSL_set_fd.pod: add note about Windows compiler warning (3.0)
f8dd586 doc/man3/SSL_set_fd.pod: add note about Windows compiler warning (master)