Commit a337ffc6 authored by John Selbie's avatar John Selbie

fix logging issue where an error would get displayed when sendto succeeded

parent 6b2666a9
...@@ -379,6 +379,7 @@ HRESULT CStunSocketThread::ProcessRequestAndSendResponse() ...@@ -379,6 +379,7 @@ HRESULT CStunSocketThread::ProcessRequestAndSendResponse()
HRESULT hr = S_OK; HRESULT hr = S_OK;
int sendret = -1; int sendret = -1;
int sockout = -1; int sockout = -1;
int err = 0;
// Reset the reader object and re-attach the buffer // Reset the reader object and re-attach the buffer
_reader.Reset(); _reader.Reset();
...@@ -400,14 +401,12 @@ HRESULT CStunSocketThread::ProcessRequestAndSendResponse() ...@@ -400,14 +401,12 @@ HRESULT CStunSocketThread::ProcessRequestAndSendResponse()
// find the socket that matches the role specified by msgOut // find the socket that matches the role specified by msgOut
sendret = ::sendto(sockout, _spBufferOut->GetData(), _spBufferOut->GetSize(), 0, _msgOut.addrDest.GetSockAddr(), _msgOut.addrDest.GetSockAddrLength()); sendret = ::sendto(sockout, _spBufferOut->GetData(), _spBufferOut->GetSize(), 0, _msgOut.addrDest.GetSockAddr(), _msgOut.addrDest.GetSockAddrLength());
err = (sendret == -1) ? errno : 0;
if (Logging::GetLogLevel() >= LL_VERBOSE) if (Logging::GetLogLevel() >= LL_VERBOSE)
{ {
Logging::LogMsg(LL_VERBOSE, "sendto returns %d (err == %d)\n", sendret, errno); Logging::LogMsg(LL_VERBOSE, "sendto returns %d (err == %d)\n", sendret, err);
} }
Cleanup: Cleanup:
return hr; return hr;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment