[wt4hq] Broken Pipe

Mario Lorenz ml at vdazone.org
Tue Jun 12 19:35:23 CEST 2007


Am 12. Jun 2007, um 16:03:42 schrieb Mikael Larsmark:
> Process 2998 detached
> 
> Anybody have an idea of what could be wrong?

Your client connection timed out (the client just vanished?).

After cursory investigation, I believe that

			/* Try to send the bloc of data to the client */
                        /* Note that one must not send the null-terminal character! */
			nBytesSent =  _send(tun->sock, szBuffer, nBufferLen - 1, 0) + 1;

			if (nBufferLen == SOCKET_ERROR) {

should read:
			if (nBytesSent == SOCKET_ERROR) {

(buffer_read seems never to return -1 anyway...)
And the following case statement should probably handle EINTR as well.


Also, I suggest commenting out the if (reason) _send ...
in closeconn(), since closeconn is called (with a reason) if recv()
fails. This could also cause send() into a connection that no longer
exists, earning you a SIGPIPE...

73s,
Mario
-- 
Mario Lorenz                            Internet:    <ml at vdazone.org>
                                        Ham Radio:   DL5MLO at DB0ERF.#THR.DEU.EU
* Newsflash: Microsoft announces Visual Edlin for Windows98!


More information about the Wt4hq mailing list