You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Randy Terbush <ra...@zyzzyva.com> on 1996/06/10 15:06:07 UTC

Re: inetd fix

The fix makes sense.

As an aside, how did you debug this? How do I get an inetd configured
server into the debugger?


> Sometimes the fixes for these things are too darn simple... just spent
> nintey minutes tracing through the entire Apache handling of an inetd
> request before I finially realized what the problem was. Here's a
> patch. We should probably put it in 1.1b3; it makes inetd requests
> work correctly. Thoughts?
> 
> *** http_main.c	1996/06/08 21:34:21	1.36
> --- http_main.c	1996/06/10 06:29:32
> ***************
> *** 1557,1562 ****
> --- 1557,1565 ----
>             r = read_request (conn);
>             if (r) process_request (r);
>           }
> + 
> + 	bflush(cio);
> + 	bclose(cio);
>       }
>       exit (0);
>   }
> 
> 
> -- 
> ________________________________________________________________________
> Alexei Kosut <ak...@nueva.pvt.k12.ca.us>      The Apache HTTP Server
> URL: http://www.nueva.pvt.k12.ca.us/~akosut/   http://www.apache.org/




Re: inetd fix

Posted by Tom Tromey <tr...@creche.cygnus.com>.
>> As an aside, how did you debug this? How do I get an inetd configured
>> server into the debugger?

Alexei> I wish I knew; would have made my life easier.

My standard trick for debugging such programs is to put a sigsuspend()
or the moral equivalent at the beginning of main().  Then I attach to
the running process with gdb.  The attach causes the sigsuspend() to
return.

"attach" isn't universally available, so YMMV.

Tom
-- 
tromey@cygnus.com                 Member, League for Programming Freedom

Re: inetd fix

Posted by Alexei Kosut <ak...@nueva.pvt.k12.ca.us>.
On Mon, 10 Jun 1996, Randy Terbush wrote:

> The fix makes sense.
> 
> As an aside, how did you debug this? How do I get an inetd configured
> server into the debugger?

I wish I knew; would have made my life easier. No, I debugged this the
old-fashioned way, put in a lot of printf() statements and ran the
program and saw how many of them appeared. (as it turned out, all of
them, which is when I began to get suspicious). Then you just try
things until it works.

Yeah, a debugger would be nice...

-- 
________________________________________________________________________
Alexei Kosut <ak...@nueva.pvt.k12.ca.us>      The Apache HTTP Server
URL: http://www.nueva.pvt.k12.ca.us/~akosut/   http://www.apache.org/