aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-08 13:11:51 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-08 13:11:51 +0000
commita25dc0d379c0017e265729ab50e82715043ec0c4 (patch)
tree78474217f825c22e341815da684b659eb3f15242
parent45769f4501980b8ff6fe19f06dd337233c1d257c (diff)
downloadlibmicrohttpd-a25dc0d379c0017e265729ab50e82715043ec0c4.tar.gz
libmicrohttpd-a25dc0d379c0017e265729ab50e82715043ec0c4.zip
-minor code cleanup
-rw-r--r--src/microhttpd/connection.c44
1 files changed, 30 insertions, 14 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index edae11b5..8f94ebd7 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -655,6 +655,7 @@ try_grow_read_buffer (struct MHD_Connection *connection)
655 * HTTPd's response. 655 * HTTPd's response.
656 * 656 *
657 * @param connection the connection 657 * @param connection the connection
658 * @return #MHD_YES on success, #MHD_NO on failure (out of memory)
658 */ 659 */
659static int 660static int
660build_header_response (struct MHD_Connection *connection) 661build_header_response (struct MHD_Connection *connection)
@@ -970,6 +971,9 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection)
970 * far too long, close the connection. If no line is 971 * far too long, close the connection. If no line is
971 * found (incomplete, buffer too small, line too long), 972 * found (incomplete, buffer too small, line too long),
972 * return NULL. Otherwise return a pointer to the line. 973 * return NULL. Otherwise return a pointer to the line.
974 *
975 * @param connection connection we're processing
976 * @return NULL if no full line is available
973 */ 977 */
974static char * 978static char *
975get_next_header_line (struct MHD_Connection *connection) 979get_next_header_line (struct MHD_Connection *connection)
@@ -1020,7 +1024,7 @@ get_next_header_line (struct MHD_Connection *connection)
1020 * @param kind kind of the value 1024 * @param kind kind of the value
1021 * @param key key for the value 1025 * @param key key for the value
1022 * @param value the value itself 1026 * @param value the value itself
1023 * @return MHD_NO on failure (out of memory), MHD_YES for success 1027 * @return #MHD_NO on failure (out of memory), #MHD_YES for success
1024 */ 1028 */
1025static int 1029static int
1026connection_add_header (struct MHD_Connection *connection, 1030connection_add_header (struct MHD_Connection *connection,
@@ -1049,7 +1053,7 @@ connection_add_header (struct MHD_Connection *connection,
1049 * @param kind header kind to use for adding to the connection 1053 * @param kind header kind to use for adding to the connection
1050 * @param connection connection to add headers to 1054 * @param connection connection to add headers to
1051 * @param args argument URI string (after "?" in URI) 1055 * @param args argument URI string (after "?" in URI)
1052 * @return MHD_NO on failure (out of memory), MHD_YES for success 1056 * @return #MHD_NO on failure (out of memory), #MHD_YES for success
1053 */ 1057 */
1054static int 1058static int
1055parse_arguments (enum MHD_ValueKind kind, 1059parse_arguments (enum MHD_ValueKind kind,
@@ -1226,7 +1230,7 @@ parse_cookie_header (struct MHD_Connection *connection)
1226 * 1230 *
1227 * @param connection the connection (updated) 1231 * @param connection the connection (updated)
1228 * @param line the first line 1232 * @param line the first line
1229 * @return MHD_YES if the line is ok, MHD_NO if it is malformed 1233 * @return #MHD_YES if the line is ok, #MHD_NO if it is malformed
1230 */ 1234 */
1231static int 1235static int
1232parse_initial_message_line (struct MHD_Connection *connection, char *line) 1236parse_initial_message_line (struct MHD_Connection *connection, char *line)
@@ -1275,6 +1279,8 @@ parse_initial_message_line (struct MHD_Connection *connection, char *line)
1275 * Call the handler of the application for this 1279 * Call the handler of the application for this
1276 * connection. Handles chunking of the upload 1280 * connection. Handles chunking of the upload
1277 * as well as normal uploads. 1281 * as well as normal uploads.
1282 *
1283 * @param connection connection we're processing
1278 */ 1284 */
1279static void 1285static void
1280call_connection_handler (struct MHD_Connection *connection) 1286call_connection_handler (struct MHD_Connection *connection)
@@ -1307,6 +1313,8 @@ call_connection_handler (struct MHD_Connection *connection)
1307 * Call the handler of the application for this 1313 * Call the handler of the application for this
1308 * connection. Handles chunking of the upload 1314 * connection. Handles chunking of the upload
1309 * as well as normal uploads. 1315 * as well as normal uploads.
1316 *
1317 * @param connection connection we're processing
1310 */ 1318 */
1311static void 1319static void
1312process_request_body (struct MHD_Connection *connection) 1320process_request_body (struct MHD_Connection *connection)
@@ -1483,8 +1491,9 @@ process_request_body (struct MHD_Connection *connection)
1483 * Try reading data from the socket into the 1491 * Try reading data from the socket into the
1484 * read buffer of the connection. 1492 * read buffer of the connection.
1485 * 1493 *
1486 * @return MHD_YES if something changed, 1494 * @param connection connection we're processing
1487 * MHD_NO if we were interrupted or if 1495 * @return #MHD_YES if something changed,
1496 * #MHD_NO if we were interrupted or if
1488 * no space was available 1497 * no space was available
1489 */ 1498 */
1490static int 1499static int
@@ -1534,8 +1543,9 @@ do_read (struct MHD_Connection *connection)
1534 * Try writing data to the socket from the 1543 * Try writing data to the socket from the
1535 * write buffer of the connection. 1544 * write buffer of the connection.
1536 * 1545 *
1537 * @return MHD_YES if something changed, 1546 * @param connection connection we're processing
1538 * MHD_NO if we were interrupted 1547 * @return #MHD_YES if something changed,
1548 * #MHD_NO if we were interrupted
1539 */ 1549 */
1540static int 1550static int
1541do_write (struct MHD_Connection *connection) 1551do_write (struct MHD_Connection *connection)
@@ -1608,6 +1618,10 @@ check_write_done (struct MHD_Connection *connection,
1608 * We have received (possibly the beginning of) a line in the 1618 * We have received (possibly the beginning of) a line in the
1609 * header (or footer). Validate (check for ":") and prepare 1619 * header (or footer). Validate (check for ":") and prepare
1610 * to process. 1620 * to process.
1621 *
1622 * @param connection connection we're processing
1623 * @param line line from the header to process
1624 * @return #MHD_YES on success, #MHD_NO on error (malformed @a line)
1611 */ 1625 */
1612static int 1626static int
1613process_header_line (struct MHD_Connection *connection, char *line) 1627process_header_line (struct MHD_Connection *connection, char *line)
@@ -1616,7 +1630,7 @@ process_header_line (struct MHD_Connection *connection, char *line)
1616 1630
1617 /* line should be normal header line, find colon */ 1631 /* line should be normal header line, find colon */
1618 colon = strchr (line, ':'); 1632 colon = strchr (line, ':');
1619 if (colon == NULL) 1633 if (NULL == colon)
1620 { 1634 {
1621 /* error in header line, die hard */ 1635 /* error in header line, die hard */
1622 CONNECTION_CLOSE_ERROR (connection, 1636 CONNECTION_CLOSE_ERROR (connection,
@@ -1719,6 +1733,8 @@ process_broken_line (struct MHD_Connection *connection,
1719 * Parse the various headers; figure out the size 1733 * Parse the various headers; figure out the size
1720 * of the upload and make sure the headers follow 1734 * of the upload and make sure the headers follow
1721 * the protocol. Advance to the appropriate state. 1735 * the protocol. Advance to the appropriate state.
1736 *
1737 * @param connection connection we're processing
1722 */ 1738 */
1723static void 1739static void
1724parse_connection_headers (struct MHD_Connection *connection) 1740parse_connection_headers (struct MHD_Connection *connection)
@@ -1827,7 +1843,7 @@ update_last_activity (struct MHD_Connection *connection)
1827 * determined that there is data to be read off a socket. 1843 * determined that there is data to be read off a socket.
1828 * 1844 *
1829 * @param connection connection to handle 1845 * @param connection connection to handle
1830 * @return always MHD_YES (we should continue to process the 1846 * @return always #MHD_YES (we should continue to process the
1831 * connection) 1847 * connection)
1832 */ 1848 */
1833int 1849int
@@ -1889,7 +1905,7 @@ MHD_connection_handle_read (struct MHD_Connection *connection)
1889 * been determined that the socket can be written to. 1905 * been determined that the socket can be written to.
1890 * 1906 *
1891 * @param connection connection to handle 1907 * @param connection connection to handle
1892 * @return always MHD_YES (we should continue to process the 1908 * @return always #MHD_YES (we should continue to process the
1893 * connection) 1909 * connection)
1894 */ 1910 */
1895int 1911int
@@ -2086,8 +2102,8 @@ cleanup_connection (struct MHD_Connection *connection)
2086 * has to happen even if the socket cannot be read or written to. 2102 * has to happen even if the socket cannot be read or written to.
2087 * 2103 *
2088 * @param connection connection to handle 2104 * @param connection connection to handle
2089 * @return MHD_YES if we should continue to process the 2105 * @return #MHD_YES if we should continue to process the
2090 * connection (not dead yet), MHD_NO if it died 2106 * connection (not dead yet), #MHD_NO if it died
2091 */ 2107 */
2092int 2108int
2093MHD_connection_handle_idle (struct MHD_Connection *connection) 2109MHD_connection_handle_idle (struct MHD_Connection *connection)
@@ -2520,8 +2536,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
2520 * the epoll() set if needed. 2536 * the epoll() set if needed.
2521 * 2537 *
2522 * @param connection connection to process 2538 * @param connection connection to process
2523 * @return MHD_YES if we should continue to process the 2539 * @return #MHD_YES if we should continue to process the
2524 * connection (not dead yet), MHD_NO if it died 2540 * connection (not dead yet), #MHD_NO if it died
2525 */ 2541 */
2526int 2542int
2527MHD_connection_epoll_update_ (struct MHD_Connection *connection) 2543MHD_connection_epoll_update_ (struct MHD_Connection *connection)