diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index d7205db8ec..765182df94 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -546,7 +546,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) long sslHostV(0L); long dnsCacheTimeout(-1L); long nobody(0L); - long last_modified(0L); // GetIfModified request + curl_off_t lastModified(0L); if (mReqOptions) { @@ -555,7 +555,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) sslHostV = mReqOptions->getSSLVerifyHost() ? 2L : 0L; dnsCacheTimeout = mReqOptions->getDNSCacheTimeout(); nobody = mReqOptions->getHeadersOnly() ? 1L : 0L; - last_modified = mReqOptions->getLastModified(); // GetIfModified request + lastModified = (curl_off_t)mReqOptions->getLastModified(); } check_curl_easy_setopt(mCurlHandle, CURLOPT_FOLLOWLOCATION, follow_redirect); @@ -564,13 +564,16 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) check_curl_easy_setopt(mCurlHandle, CURLOPT_NOBODY, nobody); - // GetIfModified request - if (last_modified > 0) + if (lastModified) { check_curl_easy_setopt(mCurlHandle, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE); - check_curl_easy_setopt(mCurlHandle, CURLOPT_TIMEVALUE, last_modified); +#if (LIBCURL_VERSION_NUM >= 0x073B00) + // requires curl 7.59.0 + check_curl_easy_setopt(mCurlHandle, CURLOPT_TIMEVALUE_LARGE, lastModified); +#else + check_curl_easy_setopt(mCurlHandle, CURLOPT_TIMEVALUE, (long)lastModified); +#endif } - // // The Linksys WRT54G V5 router has an issue with frequent // DNS lookups from LAN machines. If they happen too often, diff --git a/indra/llcorehttp/httpoptions.cpp b/indra/llcorehttp/httpoptions.cpp index ceeb3b51c5..5abd28e211 100644 --- a/indra/llcorehttp/httpoptions.cpp +++ b/indra/llcorehttp/httpoptions.cpp @@ -47,8 +47,8 @@ HttpOptions::HttpOptions() : mVerifyPeer(sDefaultVerifyPeer), mVerifyHost(false), mDNSCacheTimeout(-1L), - mNoBody(false), - mLastModified(0) // GetIfModified request + mLastModified(0), + mNoBody(false) {} @@ -130,16 +130,14 @@ void HttpOptions::setHeadersOnly(bool nobody) } } +void HttpOptions::setLastModified(time_t lastModified) +{ + mLastModified = lastModified; +} + void HttpOptions::setDefaultSSLVerifyPeer(bool verify) { sDefaultVerifyPeer = verify; } -// GetIfModified request -void HttpOptions::setLastModified(long last_modified) -{ - mLastModified = last_modified; -} -// - } // end namespace LLCore diff --git a/indra/llcorehttp/httpoptions.h b/indra/llcorehttp/httpoptions.h index ca558c05eb..fdb277c66e 100644 --- a/indra/llcorehttp/httpoptions.h +++ b/indra/llcorehttp/httpoptions.h @@ -178,6 +178,13 @@ public: return mNoBody; } + // Default: 0 + void setLastModified(time_t lastModified); + time_t getLastModified() const + { + return mLastModified; + } + /// Sets default behavior for verifying that the name in the /// security certificate matches the name of the host contacted. /// Defaults false if not set, but should be set according to @@ -185,14 +192,6 @@ public: /// NoVerifySSLCert static void setDefaultSSLVerifyPeer(bool verify); - // GetIfModified request - void setLastModified(long last_modified); - long getLastModified() const - { - return mLastModified; - } - // - protected: bool mWantHeaders; int mTracing; @@ -207,10 +206,9 @@ protected: bool mVerifyHost; int mDNSCacheTimeout; bool mNoBody; + time_t mLastModified; static bool sDefaultVerifyPeer; - - long mLastModified; // GetIfModified request }; // end class HttpOptions diff --git a/indra/newview/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp index 1ec663622f..ef3e045214 100644 --- a/indra/newview/fsgridhandler.cpp +++ b/indra/newview/fsgridhandler.cpp @@ -949,7 +949,7 @@ std::string LLGridManager::getGridLabel(const std::string& grid) { std::string grid_label; std::string grid_name = getGrid(grid); - if (!grid.empty()) + if (!grid_name.empty()) { grid_label = mGridList[grid_name][GRID_LABEL_VALUE].asString(); } @@ -1099,7 +1099,7 @@ std::string LLGridManager::getGridId(const std::string& grid) { std::string grid_id; std::string grid_name = getGrid(grid); - if (!grid.empty()) + if (!grid_name.empty()) { // FS:AW FIRE-7468 // NOTE: GRID_ID_VALUE has a different meaning in llviewernetwork diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index f62aa01002..9b4b730bf5 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -468,7 +468,7 @@ std::string LLGridManager::getGridLabel(const std::string& grid) { std::string grid_label; std::string grid_name = getGrid(grid); - if (!grid.empty()) + if (!grid_name.empty()) { grid_label = mGridList[grid_name][GRID_LABEL_VALUE].asString(); } @@ -484,7 +484,7 @@ std::string LLGridManager::getGridId(const std::string& grid) { std::string grid_id; std::string grid_name = getGrid(grid); - if (!grid.empty()) + if (!grid_name.empty()) { grid_id = mGridList[grid_name][GRID_ID_VALUE].asString(); } diff --git a/scripts/packages-formatter.py b/scripts/packages-formatter.py index 84fa27ca65..08a17e572f 100755 --- a/scripts/packages-formatter.py +++ b/scripts/packages-formatter.py @@ -42,7 +42,7 @@ _autobuild_env=os.environ.copy() # Coerce stdout encoding to utf-8 as cygwin's will be detected as cp1252 otherwise. _autobuild_env["PYTHONIOENCODING"] = "utf-8" -pkg_line=re.compile('^([\w-]+):\s+(.*)$') +pkg_line=re.compile(r'^([\w-]+):\s+(.*)$') def autobuild(*args): """