You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/06/07 12:09:22 UTC

[incubator-nuttx-apps] 05/05: webclient: Clear WGET_FLAG_GOT_CONTENT_LENGTH for each request

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 610b04fa97bfb6e200e21fc5952920def983aeed
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Mon Jun 6 18:04:06 2022 +0900

    webclient: Clear WGET_FLAG_GOT_CONTENT_LENGTH for each request
    
    Otherwise, a stale value might be used after a redirection.
---
 netutils/webclient/webclient.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/netutils/webclient/webclient.c b/netutils/webclient/webclient.c
index e3763265a..4dc673021 100644
--- a/netutils/webclient/webclient.c
+++ b/netutils/webclient/webclient.c
@@ -577,7 +577,8 @@ static inline int wget_parsestatus(struct webclient_context *ctx,
            */
 
           ws->state = WEBCLIENT_STATE_HEADERS;
-          ws->internal_flags &= ~(WGET_FLAG_CHUNKED |
+          ws->internal_flags &= ~(WGET_FLAG_GOT_CONTENT_LENGTH |
+                                  WGET_FLAG_CHUNKED |
                                   WGET_FLAG_GOT_LOCATION);
           ndx = 0;
           break;