I found a tiny bug today with shutting down. It looks like the gCmdSock never gets released, nor gets set back to zero. Therefore if you initialize, shutdown, initialize, and shutdown again (without doing anything else is the simple case), a message tries to get sent out on the gCmdSock, which gets back a SIG_PIPE back from it because the other side has been shut down. This error trickles back up and causes exit(-1) to be called.

The fix is easier than the explanation -- when the other socket is closed in ooCloseCmdConnection(), close the gCmdChan as well. This makes since since gCmdChan is allocated in the reciprocal function ooCreateCmdConnection().

        Patch with those two new lines is attached.

                                        -- Philippe Chaintreuil
                                           [EMAIL PROTECTED]
Index: ooCmdChannel.c
===================================================================
--- ooCmdChannel.c      (revision 177)
+++ ooCmdChannel.c      (working copy)
@@ -100,6 +100,8 @@
 {
    ooSocketClose(gH323ep.cmdSock);
    gH323ep.cmdSock = 0;
+   ooSocketClose(gCmdChan);
+   gCmdChan = 0;
 
    return OO_OK;
 }

Reply via email to