|
Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
|
Parser for multipart/form-data POST requests.
Each field is delivered through formData; files are delivered through fileBegin and fileData callbacks. File bytes are streamed rather than stored as one complete file. Field values must fit in the parser's working storage. The parser does not create files or decode Content-Transfer-Encoding values.
Use start() for dispatcher-driven input or run() for blocking input. All five callbacks are required. Callback cleanup rules differ between these modes: asynchronous completion/error must detach or destroy the parser; synchronous callbacks must keep its storage alive until run() returns. Do not reuse one parser concurrently or switch a completed blocking instance to asynchronous mode.
#include <MultipartUpload.h>
Public Member Functions | |
| MultipartUpload () | |
| Uninitialized storage; call MultipartUpload_constructor before use. More... | |
| MultipartUpload (HttpServer *server, MultipartUpload_EndOfReq onEndOfReq, MultipartUpload_FormData onFormData, MultipartUpload_FileBegin onFileBegin, MultipartUpload_FileData onFileData, MultipartUpload_Error onError, U32 bufferSize, AllocatorIntf *allocator=0) | |
| ~MultipartUpload () | |
| Detach from the dispatcher, free parsing storage, and close the embedded asynchronous connection if still owned. More... | |
| int | start (HttpRequest *req) |
| Start asynchronous multipart input, taking the request connection. More... | |
| int | run (HttpRequest *req, bool setKeepAlive=true) |
| Parse multipart input synchronously, blocking for additional bytes. More... | |
| HttpConnection * | getCon (MultipartUpload *o) |
| Detach the asynchronous parser and release parsing buffers for a handoff. More... | |
| HttpServer * | getServer () |
| Get the server supplied to the constructor. More... | |
| MultipartUpload::MultipartUpload | ( | ) |
Uninitialized storage; call MultipartUpload_constructor before use.