@@ -106,9 +106,9 @@ namespace
106106 * the socket is coming from a previous instantiation of the network
107107 * stack.
108108 */
109- template <bool IsCloseOperation = false >
110109 int with_sealed_socket (FunctionWrapper<int (SealedSocket *socket)> operation,
111- Sealed<SealedSocket> sealedSocket)
110+ Sealed<SealedSocket> sealedSocket,
111+ bool isCloseOperation = false)
112112 {
113113 return with_restarting_checks (
114114 [&]() {
@@ -126,7 +126,7 @@ namespace
126126 " (epochs mismatch: socket = {}; current = {})." ,
127127 socket->socketEpoch ,
128128 currentSocketEpoch.load ());
129- if constexpr (!IsCloseOperation )
129+ if (!isCloseOperation )
130130 {
131131 // This should push the caller to free the socket.
132132 return -ENOTCONN;
@@ -792,7 +792,7 @@ int network_socket_close(Timeout *t,
792792 {
793793 return -EINVAL;
794794 }
795- return with_sealed_socket< true /* this is a close operation */ > (
795+ return with_sealed_socket (
796796 [=](SealedSocket *socket) {
797797 // We will fail to lock if the socket is coming from
798798 // a previous instance of the network stack as it set
@@ -969,7 +969,8 @@ int network_socket_close(Timeout *t,
969969 }
970970 return -ETIMEDOUT;
971971 },
972- sealedSocket);
972+ sealedSocket,
973+ true /* this is a close operation */ );
973974}
974975
975976NetworkReceiveResult
0 commit comments