Skip to content

Commit

Permalink
lib: move client writer into own source
Browse files Browse the repository at this point in the history
Refactoring of the client writer that passes the data to the
client/application's callback functions.

- split out into own source cw-out.[ch] from sendf.c

- move tempwrite and tempcount from data->state into the context of the
  client writer

- redesign the 3 tempwrite dynbufs as a linked list of dynbufs. On
  paused transfers, this allows to "record" interleaved HEADER/BODY
  chunks to be "played back" in the same order on unpausing.

- keep the overall size limit of all buffered data to DYN_PAUSE_BUFFER.
  On exceeding that, return CURLE_TOO_LARGE instead of
  CURLE_OUT_OF_MEMORY as before.

- add method to be called when a transfer is DONE to allow writing of
  any data still buffered

- when paused, record HEADER writes exactly as they come for later
  playback. HEADERs are documented to be written one-by-one.

Closes curl#12898
  • Loading branch information
icing authored and bagder committed Feb 26, 2024
1 parent 2254551 commit 463472a
Show file tree
Hide file tree
Showing 10 changed files with 538 additions and 227 deletions.
2 changes: 2 additions & 0 deletions lib/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ LIB_CFILES = \
curl_sspi.c \
curl_threads.c \
curl_trc.c \
cw-out.c \
dict.c \
doh.c \
dynbuf.c \
Expand Down Expand Up @@ -283,6 +284,7 @@ LIB_HFILES = \
curl_threads.h \
curl_trc.h \
curlx.h \
cw-out.h \
dict.h \
doh.h \
dynbuf.h \
Expand Down

0 comments on commit 463472a

Please sign in to comment.