aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_send.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/mhd_send.c')
-rw-r--r--src/microhttpd/mhd_send.c44
1 files changed, 12 insertions, 32 deletions
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 78acdc8c..246e6c96 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -660,25 +660,11 @@ post_send_setopt (struct MHD_Connection *connection,
660} 660}
661 661
662 662
663/**
664 * Send buffer to the client, push data from network buffer if requested
665 * and full buffer is sent.
666 *
667 * @param connection the MHD_Connection structure
668 * @param buffer content of the buffer to send
669 * @param buffer_size the size of the @a buffer (in bytes)
670 * @param push_data set to true to force push the data to the network from
671 * system buffers (usually set for the last piece of data),
672 * set to false to prefer holding incomplete network packets
673 * (more data will be send for the same reply).
674 * @return sum of the number of bytes sent from both buffers or
675 * error code (negative)
676 */
677ssize_t 663ssize_t
678MHD_send_on_connection_ (struct MHD_Connection *connection, 664MHD_send_data_ (struct MHD_Connection *connection,
679 const char *buffer, 665 const char *buffer,
680 size_t buffer_size, 666 size_t buffer_size,
681 bool push_data) 667 bool push_data)
682{ 668{
683 MHD_socket s = connection->socket_fd; 669 MHD_socket s = connection->socket_fd;
684 ssize_t ret; 670 ssize_t ret;
@@ -865,10 +851,10 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
865#endif /* ! (HAVE_SENDMSG || HAVE_WRITEV) */ 851#endif /* ! (HAVE_SENDMSG || HAVE_WRITEV) */
866 ) 852 )
867 { 853 {
868 ret = MHD_send_on_connection_ (connection, 854 ret = MHD_send_data_ (connection,
869 header, 855 header,
870 header_size, 856 header_size,
871 push_hdr); 857 push_hdr);
872 if ( ((size_t) header_size == ret) && 858 if ( ((size_t) header_size == ret) &&
873 (((size_t) SSIZE_MAX > header_size)) && 859 (((size_t) SSIZE_MAX > header_size)) &&
874 (0 != body_size) ) 860 (0 != body_size) )
@@ -885,10 +871,10 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
885 push_body = complete_response; 871 push_body = complete_response;
886 } 872 }
887 873
888 ret2 = MHD_send_on_connection_ (connection, 874 ret2 = MHD_send_data_ (connection,
889 body, 875 body,
890 body_size, 876 body_size,
891 push_body); 877 push_body);
892 if (0 < ret2) 878 if (0 < ret2)
893 return ret + ret2; /* Total data sent */ 879 return ret + ret2; /* Total data sent */
894 if (MHD_ERR_AGAIN_ == ret2) 880 if (MHD_ERR_AGAIN_ == ret2)
@@ -1000,12 +986,6 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
1000 986
1001 987
1002#if defined(_MHD_HAVE_SENDFILE) 988#if defined(_MHD_HAVE_SENDFILE)
1003/**
1004 * Function for sending responses backed by file FD.
1005 *
1006 * @param connection the MHD connection structure
1007 * @return actual number of bytes sent
1008 */
1009ssize_t 989ssize_t
1010MHD_send_sendfile_ (struct MHD_Connection *connection) 990MHD_send_sendfile_ (struct MHD_Connection *connection)
1011{ 991{