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.h37
1 files changed, 30 insertions, 7 deletions
diff --git a/src/daemon/internal.h b/src/daemon/internal.h
index c2d6ab0b..76c17dbc 100644
--- a/src/daemon/internal.h
+++ b/src/daemon/internal.h
@@ -305,6 +305,33 @@ enum MHD_CONNECTION_STATE
305char *MHD_state_to_string (enum MHD_CONNECTION_STATE state); 305char *MHD_state_to_string (enum MHD_CONNECTION_STATE state);
306#endif 306#endif
307 307
308/**
309 * Function to receive plaintext data.
310 *
311 * @param conn the connection struct
312 * @param write_to where to write received data
313 * @param max_bytes maximum number of bytes to receive
314 * @return number of bytes written to write_to
315 */
316typedef ssize_t (*ReceiveCallback)(struct MHD_Connection * conn,
317 void * write_to,
318 size_t max_bytes);
319
320
321/**
322 * Function to transmit plaintext data.
323 *
324 * @param conn the connection struct
325 * @param read_from where to read data to transmit
326 * @param max_bytes maximum number of bytes to transmit
327 * @return number of bytes transmitted
328 */
329typedef ssize_t (*TransmitCallback)(struct MHD_Connection * conn,
330 const void * write_to,
331 size_t max_bytes);
332
333
334
308struct MHD_Connection 335struct MHD_Connection
309{ 336{
310 337
@@ -538,13 +565,9 @@ struct MHD_Connection
538 565
539 int (*idle_handler) (struct MHD_Connection * connection); 566 int (*idle_handler) (struct MHD_Connection * connection);
540 567
541 /** 568 ReceiveCallback recv_cls;
542 * function pointers to the appropriate send & receive funtions 569
543 * according to whether this is a HTTPS / HTTP daemon 570 TransmitCallback send_cls;
544 */
545 ssize_t (*recv_cls) (struct MHD_Connection * connection);
546
547 ssize_t (*send_cls) (struct MHD_Connection * connection);
548 571
549#if HTTPS_SUPPORT 572#if HTTPS_SUPPORT
550 /* TODO rename as this might be an SSL connection */ 573 /* TODO rename as this might be an SSL connection */