Roy T. Fielding wrote:

>      if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &just_say_no,
>             sizeof(int)) < 0) {
> +        char buf[128];
> +
> +        if (sin_client) {
> +            ap_snprintf(buf, sizeof(buf),
> +                        ", client %pA probably dropped the connection",
> +                        &sin_client->sin_addr);
> +        }
>  #ifdef NETWARE
>          errno = WSAGetLastError();
>  #endif
>      ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf,
> -            "setsockopt: (TCP_NODELAY)");
> +            "setsockopt: (TCP_NODELAY)%s",
> +                     sin_client ? buf : "");
>      }
>  }


First, the NETWARE part has to be above your additions.

The reason I put the NETWARE part below the first new code was because
I assumed (perhaps incorrectly) that there was no way that Apache or
library functions it called were going to mess with the value returned
by WSAGetLastError(), but possibly they might mess with errno, so by
setting errno right before calling ap_log_error() there wouldn't be any
problems.

  Second,
change the ap_log_error to the variable args version rather than
using a temporary buffer and ap_snprintf.
I'm afraid you've lost me here.  What function is there to use in
place of ap_log_error()?  Somehow use ap_pstrcat() and pass the buffer
it builds to ap_log_error()?

Sorry :( (and thanks)

Reply via email to