Re: [OpenSIPStack] Problem with last change in SIPUDPTransport::ReadPacket()
Brought to you by:
joegenbaclor
From: Joegen E. B. <joe...@gm...> - 2007-07-25 15:28:40
|
You may safely return here. I've patched CVS accordingly. Gustavo Curetti wrote: > Hi Joegen: > =20 > I have a problem with the last change in SIPUDPTransport::ReadPacket():= > =20 > if( length =3D=3D 0 ) > { > packet.SetSize(0); > return TRUE; ----> return FALSE; > } > =20 > when SIPUDPTransport::ReadPacket() return false,=20 > SIPTransport::ProcessRead() also return false and > SIPTransport::ReadThread::Main() finish and no more sip messages are=20 > processed. > =20 > when I debugged SIPUDPSocketList::ReadFrom(), i found this: > =20 > BOOL SIPUDPSocketList::ReadFrom() > BOOL ok =3D socket.ReadFrom( bytes, len, addr, port ) --> len =3D 2048= ,=20 > addr =3D 127.0.0.1, port =3D 38890 > if (os_recvfrom(buf, len, 0, sa, &size))=20 > int recvResult =3D ::recvfrom(os_handle, (char *)buf, len, flags,=20 > from, fromlen); > if (!ConvertOSError(recvResult, LastReadError))--> recvResult =3D -1= ,=20 > LastReadError =3D 0 > BOOL ok =3D ConvertOSError(status, lastError, osError); > return PChannel::ConvertOSError(-2, lastError, osError); > osError =3D GetLastError(); *(osError =3D 10054 =3D WSAECONNRESET= )=20 > (Connection reset by peer) > * osError |=3D PWIN32ErrorFlag; (osError =3D 1073751878) > lastError =3D Miscellaneous; (lastError =3D 12) > return lastReadCount > 0; (lastReadCount =3D 0) > LOG( LogError(), "UDP Socket Read Error (" << socket.GetErrorText()=20 > << ")" );=20 > PString PChannel::GetErrorText(Errors lastError, int osError)=20 > (lastError =3D 12) (osError =3D 1073751881) > DWORD err =3D osError & ~PWIN32ErrorFlag; *(err =3D 10057 =3D=20 > WSAENOTCONN) (Socket not connected) > * /49:28:50.887 ERR: [CID=3D0x0000] UDP Socket Read Error (Socket not=20 > connected) > / bytesRead =3D 0; > return TRUE; /// return TRUE here. error in ReadFrom is benign > > I don't understand why the errors are differents, but when I searched=20 > for the original error (10054), i found this: > =20 > "If sending a datagram using the sendto function results in an "ICMP=20 > port unreachable" response and the select function is set for readfds, = > the program returns 1 and the subsequent call to the recvfrom function = > does not work with a WSAECONNRESET (10054) error response" > =20 > Maybe some ICMP validation go wrong with winsock. I attach a log. > =20 > Thanks for your help. > =20 > Gustavo > =20 > > -----------------------------------------------------------------------= - > Env=EDa mensajes de correo electr=F3nico directamente a tu blog con MSN= =2E=20 > Carga chistes, fotograf=EDas y muchas otras cosas. Es gratis.=20 > <http://clk.atdmt.com/MSN/go/msnnksac0030000001msn/direct/01/?href=3Dht= tp://www.imagine-msn.com/spaces> |