[openssl/openssl] 55067d: Remove the rio_notifier run_once routine

"'Neil Horman' via openssl-commits" <[email protected]> Mon, 13 Jul 2026 07:38:33 -0700
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/openssl-3.6/[email protected]>
  Branch: refs/heads/openssl-3.6
  Home:   https://github.com/openssl/openssl
  Commit: 55067d0830047a14701008688b22784022992c8f
      https://github.com/openssl/openssl/commit/55067d0830047a14701008688b22784022992c8f
  Author: Neil Horman <[email protected]>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    M ssl/rio/rio_notifier.c

  Log Message:
  -----------
  Remove the rio_notifier run_once routine

We do this odd thing in rio_notifier.  when we initalize it, we call a
run_once routine to call WSAStartup(), create a lock and init a
refcount.  The purpose of those last two items is to track the refcount
so that we record how many times we init that rio notifier.  when the
refcount reaches zero, we tear down the windows socket api by calling
WSA cleanup, destroy the lock and refcount, and then re-initzlize the
run_once gate.

That last step is sketchy.  Even though our implementations of run_once
allow doing so, we should never be re-initing those gates, as its going
to be very prone to races, and they are, well, run_once, so we should
only run them once.

It would be nice to get rid of that behavior, which we can fortunately
do.

https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-wsastartup

Indicates that WSAStartup is internally refcounted, so instead of just
calling it once and tracking when we need to correspondingly call
WSACleanup(), just call it every time we initalize an rio_notifier
object, and call WSACleanup when we tear it down.  The Winsock api will
take care of knowing when it actually needs to be cleaned up for us.  As
such we can eliminate the run_once routine, the refcount and the lock
entirely.

Reviewed-by: Bob Beck <[email protected]>
Reviewed-by: Nikola Pajkovsky <[email protected]>
MergeDate: Mon Jul 13 14:26:58 2026
(Merged from https://github.com/openssl/openssl/pull/31777)

(cherry picked from commit f1be99832fcb614f24c68a7888a7d0269268ad00)



To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups "openssl-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-commits/openssl/openssl/push/refs/heads/openssl-3.6/eec366-55067d%40github.com.