From 50ff5d905eddd46f8780a0b1bebc04ed40dd3c12 Mon Sep 17 00:00:00 2001 From: David Steele Date: Wed, 15 Jul 2020 13:54:01 -0400 Subject: [PATCH] Update comment and parameter in HttpRequest. --- doc/xml/release.xml | 5 +++++ src/common/io/http/request.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/doc/xml/release.xml b/doc/xml/release.xml index 32d6dd3e4..5d484e62c 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -57,6 +57,11 @@ + + + + +

Asynchronous S3 multipart upload.

diff --git a/src/common/io/http/request.c b/src/common/io/http/request.c index 274f8aa14..9ad256ec7 100644 --- a/src/common/io/http/request.c +++ b/src/common/io/http/request.c @@ -60,11 +60,11 @@ OBJECT_DEFINE_GET(Header, const, HTTP_REQUEST, const HttpHeader *, header); Process the request ***********************************************************************************************************************************/ static HttpResponse * -httpRequestProcess(HttpRequest *this, bool requestOnly, bool contentCache) +httpRequestProcess(HttpRequest *this, bool waitForResponse, bool contentCache) { FUNCTION_LOG_BEGIN(logLevelDebug) FUNCTION_LOG_PARAM(HTTP_REQUEST, this); - FUNCTION_LOG_PARAM(BOOL, requestOnly); + FUNCTION_LOG_PARAM(BOOL, waitForResponse); FUNCTION_LOG_PARAM(BOOL, contentCache); FUNCTION_LOG_END(); @@ -128,13 +128,13 @@ httpRequestProcess(HttpRequest *this, bool requestOnly, bool contentCache) // Flush all writes ioWriteFlush(httpSessionIoWrite(session)); - // If only performing the request then move the session to the object context - if (requestOnly) + // If not waiting for the response then move the session to the object context + if (!waitForResponse) this->session = httpSessionMove(session, this->memContext); } // Wait for response - if (!requestOnly) + if (waitForResponse) { result = httpResponseNew(session, this->verb, contentCache); @@ -152,7 +152,7 @@ httpRequestProcess(HttpRequest *this, bool requestOnly, bool contentCache) } CATCH_ANY() { - // Retry if wait time has not expired + // Sleep and then retry unless the total wait time has expired if (waitMore(wait)) { LOG_DEBUG_FMT("retry %s: %s", errorTypeName(errorType()), errorMessage()); @@ -209,7 +209,7 @@ httpRequestNew(HttpClient *client, const String *verb, const String *uri, HttpRe }; // Send the request - httpRequestProcess(this, true, false); + httpRequestProcess(this, false, false); httpClientStat.request++; } MEM_CONTEXT_NEW_END(); @@ -228,7 +228,7 @@ httpRequestResponse(HttpRequest *this, bool contentCache) ASSERT(this != NULL); - FUNCTION_LOG_RETURN(HTTP_RESPONSE, httpRequestProcess(this, false, contentCache)); + FUNCTION_LOG_RETURN(HTTP_RESPONSE, httpRequestProcess(this, true, contentCache)); } /**********************************************************************************************************************************/