Laird Nelson writes:
> 
> inetd programs are supposed to be able to simply read from STDIN,
> right?  I'm trying to write a wrapper program around cvs pserver that
> gets invoked, obviously, from STDIN.  I'd like to peek at the
> conversation between client and server, and I thought I could get at
> this conversation by simply reading from STDIN.  But my program blocks
> infinitely.  Is the cvs client/server protocol such that it is started
> by the server (the Cederqvist says no)?

I'm not entirely clear on what it is you're doing, but a program started
by inetd has the client socket as its STDIN and STDOUT.  If you're
trying to snoop on the traffic between the client and server, you'll
need to create another socket to use to communicate with the cvs pserver
and then you have to copy everything you read from STDIN to the pserver
and everything you read from the pserver to STDOUT.  This needs to
happen more-or-less simultaneously to avoid getting stuck in a deadly
embrace (e.g., you block trying to write to pserver which is blocked
trying to write to you).

Note that the simplest way to snoop on the traffic between the client
and server if you're just curious is to set the CVS_CLIENT_LOG
environment variable on the client side.

-Larry Jones

He piqued my curiosity. -- Calvin

Reply via email to