[Common-dev] Fwd: Re: Crash in CHXSocket. (when writing to a closed socket.)
Liam Murray liamm at real.comThis avoids the crash. How does Write() behave when you write to a closed socket? Does it return an error code? It seems writing after close should be an error. Liam At 11:45 AM 9/23/2004, Sujeet Kharkar wrote: >I will like to check in following change done by Tom Marshall to >common/netio/platform/posix/sockimp.cpp > >This fixes the crash in CHXSocket, which was occuring if writing to a >closed socket. > >I have verified the fix on windows & linux with producer. > >Thanks >Sujeet > >>Delivered-To: skharkar at real.com >>Date: Fri, 17 Sep 2004 11:15:58 -0700 >>From: Tom Marshall <tmarshall at real.com> >>To: Sujeet Kharkar <skharkar at real.com> >>Subject: Re: Crash in CHXSocket. >>User-Agent: Mutt/1.5.6+20040722i >>Sender: Tom Marshall <tommy at hashi.dev.prognet.com> >> >>On Thu, Sep 16, 2004 at 02:59:27PM -0700, Sujeet Kharkar wrote: >> > At 11:43 AM 9/16/2004 -0700, you wrote: >> > >> > So will you be fixing this one. >> > I can verify it once fixed. >> >>This should fix the socket crash (item 1): >> >> Index: platform/posix/sockimp.cpp >> =================================================================== >> RCS file: /cvsroot/common/netio/platform/posix/sockimp.cpp,v >> retrieving revision 1.44 >> diff -u -d -r1.44 sockimp.cpp >> --- platform/posix/sockimp.cpp 8 Sep 2004 00:05:55 -0000 1.44 >> +++ platform/posix/sockimp.cpp 17 Sep 2004 18:14:13 -0000 >> @@ -1116,6 +1116,7 @@ >> CHXSocket::~CHXSocket(void) >> { >> Close(); >> + HX_DELETE(m_pSendBuffer); >> HX_RELEASE(m_pScheduler); >> HX_RELEASE(m_pCCF); >> HX_RELEASE(m_punkContext); >> @@ -1620,7 +1621,6 @@ >> CHXSocket::Close(void) >> { >> HX_RESULT hxr = HXR_OK; >> - HX_DELETE(m_pSendBuffer); >> HX_RELEASE(m_pEnumerator); //XXXTDM: need to cancel >> HX_RELEASE(m_pResponse); >> if (m_hIdleCallback) >> >>Feel free to test and then send out a CR. >> >>If you won't be fixing the others, you should file bugs. >> >>-- >>You can complain because roses have thorns, or you can rejoice because >>thorns have roses. >> -- Abraham Lincoln > > >_______________________________________________ >Common-dev mailing list >Common-dev at lists.helixcommunity.org >http://lists.helixcommunity.org/mailman/listinfo/common-dev