lib: rewind BEFORE request instead of AFTER previous

This makes a big difference for cases when the rewind is not actually
necessary to perofm (for example HTTP response code 301 converts to GET)
and therefore the rewind can be avoided. In particular for situations
when that rewind fails, for example when reading from a pipe or similar.

Reported-by: Ali Utku Selen

Fixes #9735
Closes #9958
This commit is contained in:
Daniel Stenberg 2022-11-22 08:25:50 +01:00
parent 9ecebb5d00
commit 1b3973180b
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 115 additions and 121 deletions

View file

@ -204,9 +204,6 @@ static void tunnel_go_state(struct Curl_cfilter *cf,
case TUNNEL_ESTABLISHED:
infof(data, "CONNECT phase completed");
if(cf->conn)
/* make sure this isn't set for the document request */
cf->conn->bits.rewindaftersend = FALSE;
data->state.authproxy.done = TRUE;
data->state.authproxy.multipass = FALSE;
/* FALLTHROUGH */