httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman Tuttle <ntut...@photon.poly.edu>
Subject Patch closes socket before reopening in open_socket in case of TIME_WAIT exhaustion; issue of memory allocation checking in the APR
Date Thu, 16 Oct 2003 21:09:27 GMT
This patch makes the open_socket() function non-recursive, providing the 
benefits of iterative functions in terms of performance, also replacing 
the close_socket (same level) reference with the lower level 
apr_socket_close(), since this would reserve close_socket() for a case 
where the open_socket() successfully occurred. This socket closure now 
also occurs in the case where a socket is to be reopened in the case of 
TIME_WAIT exhaustion, which was the recursive condition. Please examine 
and apply this change, which was made to the current CVS tree, without 
reference to my former submission.

-Norman Tuttle, OpenDemand Systems Developer, ntuttle@opendemand.com

PS: The conditions of lack of success for apr_socket_create() (found
within apr_socket_open() function) should include a case where memory
wasn't available to allocate for the creation of the APR socket structure,
but I did not see evidence of this in either the Win32 or Unix versions of
the APR library. Both functions call a void function alloc_socket() which
does the allocation and then immediately sets members of the allocated
socket, so they are obviously assuming the allocation occurred.
Unfortunately, real software cannot be so sure. I was wondering if (1) the
APR provided alternate functions which check for this failure case, and
(2) how many APR functions are doing memory checking. I am dittoing this
comment to the APR mailing list.



Mime
View raw message