aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/internal.h')
-rw-r--r--src/daemon/internal.h44
1 files changed, 34 insertions, 10 deletions
diff --git a/src/daemon/internal.h b/src/daemon/internal.h
index 1596e8df..de4ae725 100644
--- a/src/daemon/internal.h
+++ b/src/daemon/internal.h
@@ -273,7 +273,7 @@ struct MHD_Connection
273 * Position where we currently append data in 273 * Position where we currently append data in
274 * read_buffer (last valid position). 274 * read_buffer (last valid position).
275 */ 275 */
276 size_t readLoc; 276 size_t read_buffer_offset;
277 277
278 /** 278 /**
279 * Size of write_buffer (in bytes). 279 * Size of write_buffer (in bytes).
@@ -283,32 +283,33 @@ struct MHD_Connection
283 /** 283 /**
284 * Offset where we are with sending from write_buffer. 284 * Offset where we are with sending from write_buffer.
285 */ 285 */
286 size_t writePos; 286 size_t write_buffer_send_offset;
287 287
288 /** 288 /**
289 * Last valid location in write_buffer. 289 * Last valid location in write_buffer (where do we
290 * append and up to where is it safe to send?)
290 */ 291 */
291 size_t writeLoc; 292 size_t write_buffer_append_offset;
292 293
293 /** 294 /**
294 * Current write position in the actual response 295 * Current write position in the actual response
295 * (excluding headers, content only; should be 0 296 * (excluding headers, content only; should be 0
296 * while sending headers). 297 * while sending headers).
297 */ 298 */
298 size_t messagePos; 299 size_t response_write_position;
299 300
300 /** 301 /**
301 * Remaining (!) number of bytes in the upload. 302 * Remaining (!) number of bytes in the upload.
302 * Set to -1 for unknown (connection will close 303 * Set to -1 for unknown (connection will close
303 * to indicate end of upload). 304 * to indicate end of upload).
304 */ 305 */
305 size_t uploadSize; 306 size_t remaining_upload_size;
306 307
307 /** 308 /**
308 * Position in the 100 CONTINUE message that 309 * Position in the 100 CONTINUE message that
309 * we need to send when receiving http 1.1 requests. 310 * we need to send when receiving http 1.1 requests.
310 */ 311 */
311 size_t continuePos; 312 size_t continue_message_write_offset;
312 313
313 /** 314 /**
314 * Length of the foreign address. 315 * Length of the foreign address.
@@ -343,18 +344,18 @@ struct MHD_Connection
343 * possible that the NEXT request is already 344 * possible that the NEXT request is already
344 * (partially) waiting in the read buffer. 345 * (partially) waiting in the read buffer.
345 */ 346 */
346 int headersReceived; 347 int have_received_headers;
347 348
348 /** 349 /**
349 * Have we finished receiving the data from a 350 * Have we finished receiving the data from a
350 * potential file-upload? 351 * potential file-upload?
351 */ 352 */
352 int bodyReceived; 353 int have_received_body;
353 354
354 /** 355 /**
355 * Have we finished sending all of the headers yet? 356 * Have we finished sending all of the headers yet?
356 */ 357 */
357 int headersSent; 358 int have_sent_headers;
358 359
359 /** 360 /**
360 * HTTP response code. Only valid if response object 361 * HTTP response code. Only valid if response object
@@ -371,6 +372,29 @@ struct MHD_Connection
371 */ 372 */
372 int response_unready; 373 int response_unready;
373 374
375 /**
376 * Are we receiving with chunked encoding? This will be set to
377 * MHD_YES after we parse the headers and are processing the body
378 * with chunks. After we are done with the body and we are
379 * processing the footers; once the footers are also done, this will
380 * be set to MHD_NO again (before the final call to the handler).
381 */
382 int have_chunked_upload;
383
384 /**
385 * If we are receiving with chunked encoding, where are we right
386 * now? Set to 0 if we are waiting to receive the chunk size;
387 * otherwise, this is the size of the current chunk. A value of
388 * zero is also used when we're at the end of the chunks.
389 */
390 unsigned int current_chunk_size;
391
392 /**
393 * If we are receiving with chunked encoding, where are we currently
394 * with respect to the current chunk (at what offset / position)?
395 */
396 unsigned int current_chunk_offset;
397
374}; 398};
375 399
376 400