]> git.ipfire.org Git - thirdparty/curl.git/commit
lib: enhance client reader resume + rewind
authorStefan Eissing <stefan@eissing.org>
Thu, 29 Feb 2024 09:12:39 +0000 (10:12 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 5 Mar 2024 12:26:05 +0000 (13:26 +0100)
commit14bcea074a78227248b00bb6fb22462e0c1b65aa
treec0293a0c447b8aee7f2688ca8c073c1ef073e71c
parent9c7768cd8820c80a452211f88dd1339d41f22a80
lib: enhance client reader resume + rewind

- update client reader documentation
- client reader, add rewind capabilities
    - tell creader to rewind on next start
    - Curl_client_reset() will keep reader for future rewind if requested
    - add Curl_client_cleanup() for freeing all resources independent of
      rewinds
    - add Curl_client_start() to trigger rewinds
    - move rewind code from multi.c to sendf.c and make part of
      "cr-in"'s implementation
- http, move the "resume_from" handling into the client readers
    - the setup of a HTTP request is reshuffled to follow:
      * determine method, target, auth negotiation
      * install the client reader(s) for the request, including crlf
        conversions and "chunked" encoding
      * apply ranges to client reader
      * concat request headers, upgrades, cookies, etc.
      * complete request by determining Content-Length of installed
        readers in combination with method
      * send
    - add methods for client readers to
      * return the overall length they will generate (or -1 when unknown)
      * return the amount of data on the CLIENT level, so that
        expect-100 can decide if it want to apply itself
      * set a "resume_from" offset or fail if unsupported
    - struct HTTP has become largely empty now
- rename `Client_reader_*` to `Curl_creader_*`

Closes #13026
15 files changed:
docs/CLIENT-READERS.md
lib/c-hyper.c
lib/http.c
lib/http.h
lib/http_chunks.c
lib/multi.c
lib/request.c
lib/request.h
lib/rtsp.c
lib/sendf.c
lib/sendf.h
lib/smtp.c
lib/transfer.c
lib/urldata.h
scripts/singleuse.pl