webcit-ng: fixed the way HTTP uploads are fed into the MIME Parser.
authorArt Cancro <ajc@citadel.org>
Mon, 6 Nov 2023 21:56:55 +0000 (16:56 -0500)
committerArt Cancro <ajc@citadel.org>
Mon, 6 Nov 2023 21:56:55 +0000 (16:56 -0500)
commita054aa798b13cbc18e86b744357ec7a13932708c
tree6b233999133d78d8f075937b6dbc5d5e78879e19
parentc74f0c5ea9e707dbf02f00cd00a708c77cfa02a7
webcit-ng: fixed the way HTTP uploads are fed into the MIME Parser.

mime_parser() expects HEADERS+CONTENT but our h.request_body only contains CONTENT.
The fix: our transaction struct now has h.request_body_with_synth_headers that
begins with a synthetic Content-Type: header followed by a blank line and then the
request body.  h.request_body is now just a pointer into that buffer, starting at
the position where the actual body begins.

This gives us the ability to supply the body with or without headers, without having
to make two copies of it.
libcitadel/lib/mime_parser.c
webcit-ng/server/http.c
webcit-ng/server/upload.c
webcit-ng/server/webcit.h