curl_easy_setopt(fEasy, CURLOPT_MAXREDIRS, 6);
// Default settings.
- curl_easy_setopt(fEasy, CURLOPT_CONNECTTIMEOUT,15);
- curl_easy_setopt(fEasy, CURLOPT_TIMEOUT,30);
+ curl_easy_setopt(fEasy, CURLOPT_CONNECTTIMEOUT,30);
+ curl_easy_setopt(fEasy, CURLOPT_TIMEOUT,60);
curl_easy_setopt(fEasy, CURLOPT_HTTPAUTH,0);
curl_easy_setopt(fEasy, CURLOPT_USERPWD,NULL);
curl_easy_setopt(fEasy, CURLOPT_SSL_VERIFYHOST, 2);
/*\r
* Copyright 2001-2009 Internet2\r
- * \r
+ *\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
* You may obtain a copy of the License at\r
\r
/**\r
* @file ReloadableXMLFile.cpp\r
- * \r
+ *\r
* Base class for file-based XML configuration.\r
*/\r
\r
}\r
else\r
m_local=false;\r
- \r
+\r
if (source && *source) {\r
const XMLCh* flag=e->getAttributeNS(NULL,validate);\r
m_validate=(XMLString::equals(flag,xmlconstants::XML_TRUE) || XMLString::equals(flag,xmlconstants::XML_ONE));\r
\r
auto_ptr_char temp(source);\r
m_source=temp.get();\r
- \r
+\r
if (!m_local && !strstr(m_source.c_str(),"://")) {\r
log.warn("deprecated usage of uri/url attribute for a local resource, use path instead");\r
m_local=true;\r
m_log.debug("backing up remote resource to (%s)", m_backing.c_str());\r
try {\r
ofstream backer(m_backing.c_str());\r
- backer << *(doc->getDocumentElement());\r
+ backer << *doc;\r
}\r
catch (exception& ex) {\r
m_log.crit("exception while backing up resource: %s", ex.what());\r
{\r
if (!m_lock)\r
return this;\r
- \r
+\r
m_lock->rdlock();\r
\r
// Check if we need to refresh.\r
#endif\r
if (m_filestamp>=stat_buf.st_mtime)\r
return this;\r
- \r
+\r
// Elevate lock and recheck.\r
m_log.debug("timestamp of local resource changed, elevating to a write lock");\r
m_lock->unlock();\r
m_filestamp = now;\r
m_log.info("reloading remote resource...");\r
}\r
- \r
+\r
// Do this once...\r
try {\r
// At this point we're holding the write lock, so make sure we pop it.\r
} catch (exception& ex) {\r
m_log.crit("maintaining existing configuration, error reloading resource (%s): %s", m_source.c_str(), ex.what());\r
}\r
- \r
+\r
// If we made it here, the swap may or may not have worked, but we need to relock.\r
m_log.debug("attempt to update resource complete, relocking");\r
m_lock->rdlock();\r