summaryrefslogtreecommitdiff
path: root/zen/http.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-01-22 13:56:55 -0500
committerB. Stack <bgstack15@gmail.com>2023-01-22 13:56:55 -0500
commit75e05bc441382db69c842a64c562738cb749214e (patch)
tree698b60b3b4b914bf7958cf1174d0373909bf1e8f /zen/http.cpp
parentadd upstream 11.29 (diff)
downloadFreeFileSync-75e05bc441382db69c842a64c562738cb749214e.tar.gz
FreeFileSync-75e05bc441382db69c842a64c562738cb749214e.tar.bz2
FreeFileSync-75e05bc441382db69c842a64c562738cb749214e.zip
add upstream 12.0
Diffstat (limited to 'zen/http.cpp')
-rw-r--r--zen/http.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/zen/http.cpp b/zen/http.cpp
index 540b4ef6..7eb3fb76 100644
--- a/zen/http.cpp
+++ b/zen/http.cpp
@@ -12,7 +12,7 @@
using namespace zen;
-const int HTTP_ACCESS_TIME_OUT_SEC = 20;
+const int HTTP_ACCESS_TIMEOUT_SEC = 20;
const size_t HTTP_BLOCK_SIZE_DOWNLOAD = 64 * 1024; //libcurl returns blocks of only 16 kB as returned by recv() even if we request larger blocks via CURLOPT_BUFFERSIZE
//- InternetReadFile() is buffered + prefetching
@@ -62,12 +62,12 @@ public:
//caveat: INTERNET_FLAG_RELOAD issues "Pragma: no-cache" instead if "request is going through a proxy"
- auto promiseHeader = std::make_shared<std::promise<std::string>>();
- std::future<std::string> futHeader = promiseHeader->get_future();
+ auto promHeader = std::make_shared<std::promise<std::string>>();
+ std::future<std::string> futHeader = promHeader->get_future();
auto postBytesSent = std::make_shared<std::atomic<int64_t>>(0);
- worker_ = InterruptibleThread([asyncStreamOut = this->asyncStreamIn_, promiseHeader, headers = std::move(headers), postBytesSent,
+ worker_ = InterruptibleThread([asyncStreamOut = this->asyncStreamIn_, promHeader, headers = std::move(headers), postBytesSent,
server, useTls, caCertFilePath, userAgent = utfTo<std::string>(userAgent),
postBuf = postBuf ? std::optional<std::string>(*postBuf) : std::nullopt, //[!] life-time!
serverRelPath = utfTo<std::string>(page)]
@@ -112,7 +112,7 @@ public:
if (headerLine == "\r\n")
{
headerReceived = true;
- promiseHeader->set_value(std::move(headerBuf));
+ promHeader->set_value(std::move(headerBuf));
}
};
@@ -131,7 +131,7 @@ public:
writeResponse /*throw ThreadStopRequest*/,
readRequest,
onHeaderData /*throw SysError*/,
- HTTP_ACCESS_TIME_OUT_SEC); //throw SysError, ThreadStopRequest
+ HTTP_ACCESS_TIMEOUT_SEC); //throw SysError, ThreadStopRequest
if (!headerReceived)
throw SysError(L"HTTP response is missing header.");
@@ -141,7 +141,7 @@ public:
catch (SysError&) //let ThreadStopRequest pass through!
{
if (!headerReceived)
- promiseHeader->set_exception(std::current_exception());
+ promHeader->set_exception(std::current_exception());
asyncStreamOut->setWriteError(std::current_exception());
}
bgstack15