At 01:09 PM 9/17/2003, Brad Nicholes wrote:
>Ah yeah, I noticed the problem with the JMP_BUF but for some reason I
>missed the local statics.  I am assuming that these local variables are
>static simply to accomodate the setjmp() call.  If I get rid of setjmp()
>and simply set the recv/send timeouts on the socket itself, there
>shouldn't be any reason to have the locals declared as static.
>
>See the attached .diff file.  Seems to work fine on NetWare.

First - ewwww.... not diff -u and no file reference in the .diff :-?

One more critical observation, if no longer static - this becomes evil:

> #if (defined(NETWARE) || defined(WIN32))
>     if (setsocktimeout(sock, ap_rfc1413_timeout) == 0) {
>         if (get_rfc1413(sock, &conn->local_addr, &conn->remote_addr, user, srv) >= 0)
>             result = user;

result points to stack - promptly trashed.  We will need to allocate
char* user from a pool, although I suggest we keep the fixed length buffer
and simply pstrdup into conn->pool after invoking rfc1413.

Do we in 1.3 already protect against invoking this multiple times for
a keep-alive connection?  We should if we don't - it's expensive.

Bill


Reply via email to