From: cantor Date: Sun, 20 Jun 2010 17:31:29 +0000 (+0000) Subject: Add GetLastError call when client read fails. X-Git-Tag: 2.4~76 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fsp.git;a=commitdiff_plain;h=3accb9990bf57161efde3c35e65afa011cf06e47 Add GetLastError call when client read fails. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/branches/REL_2@3263 cb58f699-b61c-0410-a6fe-9272a202ed29 --- diff --git a/isapi_shib/isapi_shib.cpp b/isapi_shib/isapi_shib.cpp index 58bc86b..9fcecea 100644 --- a/isapi_shib/isapi_shib.cpp +++ b/isapi_shib/isapi_shib.cpp @@ -870,8 +870,11 @@ public: while (datalen) { DWORD buflen=8192; BOOL ret = m_lpECB->ReadClient(m_lpECB->ConnID, buf, &buflen); - if (!ret) - throw IOException("Error reading request body from browser."); + if (!ret) { + char message[65]; + _snprintf(message, 64, "Error reading request body from browser (%x).", GetLastError()); + throw IOException(message); + } else if (!buflen) throw IOException("Socket closed while reading request body from browser."); m_body.append(buf, buflen);