Modify select call to match example and Xerces trunk.
[shibboleth/xmltooling.git] / xmltooling / util / CurlURLInputStream.cpp
index bba89a3..1923a50 100644 (file)
@@ -41,6 +41,7 @@
 #include <xercesc/util/TranscodingException.hpp>
 #include <xercesc/util/PlatformUtils.hpp>
 
+#include <xmltooling/logging.h>
 #include <xmltooling/util/CurlURLInputStream.hpp>
 
 using namespace xmltooling;
@@ -222,6 +223,9 @@ CurlURLInputStream::readBytes(XMLByte* const          toFill
                 break;
 
             default:
+                logging::Category::getInstance(XMLTOOLING_LOGCAT"libcurl.NetAccessor").error(
+                    "curl NetAccessor encountered error from libcurl (%d)", msg->data.result
+                    );
                 ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_InternalError, fURLSource.getURLText(), fMemoryManager);
                                break;
                        }
@@ -250,7 +254,7 @@ CurlURLInputStream::readBytes(XMLByte* const          toFill
                        timeval tv;
                        tv.tv_sec  = 2;
                        tv.tv_usec = 0;
-                       (void) select(fdcnt, &readSet, &writeSet, &exceptSet, &tv);
+                       (void) select(fdcnt+1, &readSet, &writeSet, &exceptSet, &tv);
                }
        }