You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brad Nicholes <BN...@novell.com> on 2001/10/16 18:50:21 UTC

Why does Apache 1.3.x assert...

In the following code in buff.c of 1.3.x, why does Apache call ap_assert() rather than just returning the socket error?  Calling ap_assert() results in calling exit() and bringing the process down.  Is a socket error really worth terminating the process?


int recvwithtimeout(int sock, char *buf, int len, int flags)
{
    int iostate = 1;
    fd_set fdset;
    struct timeval tv;
    int err = WSAEWOULDBLOCK;
    int rv;
    int retry;

    if (!(tv.tv_sec = ap_check_alarm()))
	return (recv(sock, buf, len, flags));

    rv = ioctlsocket(sock, FIONBIO, (u_long*)&iostate);
    iostate = 0;
    ap_assert(!rv);

...
}

thanks,
Brad