author | Michael Krelin <hacker@klever.net> | 2011-04-27 10:10:00 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2011-04-27 10:10:00 (UTC) |
commit | d097b824b7fcad001c9581fb2e322bf3e3e5961d (patch) (unidiff) | |
tree | 5a1c55e82c4b0ff4acca276b8e1122547530cc0b | |
parent | 65981784977659461f08b48f537be9f9f77a2112 (diff) | |
download | pumpkin-d097b824b7fcad001c9581fb2e322bf3e3e5961d.zip pumpkin-d097b824b7fcad001c9581fb2e322bf3e3e5961d.tar.gz pumpkin-d097b824b7fcad001c9581fb2e322bf3e3e5961d.tar.bz2 |
fix for misleading error message about unexpected source
along with a double-freeing offense. When I fail to receive packet not only
I diagnose this unfortunate development, but also start talking about
packet from unexpected source which is kinda weird considering there's
no packet at all.
Signed-off-by: Michael Krelin <hacker@klever.net>
-rwxr-xr-x[-rw-r--r--] | PumpKINDlg.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/PumpKINDlg.cpp b/PumpKINDlg.cpp index f41b69f..3ff1500 100644..100755 --- a/PumpKINDlg.cpp +++ b/PumpKINDlg.cpp | |||
@@ -592,24 +592,25 @@ void CXferSocket::OnReceive(int nErrorCode) | |||
592 | m_Daddy->LogLine(IDS_LOG_XFERRECEIVE); | 592 | m_Daddy->LogLine(IDS_LOG_XFERRECEIVE); |
593 | return; | 593 | return; |
594 | } | 594 | } |
595 | ASSERT(m_Daddy); | 595 | ASSERT(m_Daddy); |
596 | DWORD fionread = 0; | 596 | DWORD fionread = 0; |
597 | VERIFY(IOCtl(FIONREAD,&fionread)); | 597 | VERIFY(IOCtl(FIONREAD,&fionread)); |
598 | tftp *p = tftp::Allocate(fionread); | 598 | tftp *p = tftp::Allocate(fionread); |
599 | ASSERT(p); | 599 | ASSERT(p); |
600 | SOCKADDR_IN sin; | 600 | SOCKADDR_IN sin; |
601 | if(!p->Receive(this,fionread,&sin)){ | 601 | if(!p->Receive(this,fionread,&sin)){ |
602 | m_Daddy->LogLine(IDS_LOG_XFERUDPRECEIVE); | 602 | m_Daddy->LogLine(IDS_LOG_XFERUDPRECEIVE); |
603 | delete p; | 603 | delete p; |
604 | return; | ||
604 | }else | 605 | }else |
605 | if(m_Peer.sin_addr.s_addr==INADDR_NONE){ | 606 | if(m_Peer.sin_addr.s_addr==INADDR_NONE){ |
606 | m_Peer.sin_addr=sin.sin_addr; | 607 | m_Peer.sin_addr=sin.sin_addr; |
607 | m_Peer.sin_port=sin.sin_port; | 608 | m_Peer.sin_port=sin.sin_port; |
608 | } | 609 | } |
609 | BOOL alive = TRUE; | 610 | BOOL alive = TRUE; |
610 | if(state==stateInit){ | 611 | if(state==stateInit){ |
611 | state=stateXfer; | 612 | state=stateXfer; |
612 | m_Peer.sin_port=sin.sin_port; | 613 | m_Peer.sin_port=sin.sin_port; |
613 | UpdateList(); | 614 | UpdateList(); |
614 | } | 615 | } |
615 | if(sin.sin_addr.s_addr!=m_Peer.sin_addr.s_addr || sin.sin_port!=m_Peer.sin_port){ | 616 | if(sin.sin_addr.s_addr!=m_Peer.sin_addr.s_addr || sin.sin_port!=m_Peer.sin_port){ |