aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/test_upgrade.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/test_upgrade.c')
-rw-r--r--src/microhttpd/test_upgrade.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index fa91f7dc..0bbb08e9 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -628,14 +628,14 @@ term_reason_str (enum MHD_RequestTerminationCode term_code)
628 * 628 *
629 * @param cls client-defined closure 629 * @param cls client-defined closure
630 * @param connection connection handle 630 * @param connection connection handle
631 * @param con_cls value as set by the last call to 631 * @param req_cls value as set by the last call to
632 * the #MHD_AccessHandlerCallback 632 * the #MHD_AccessHandlerCallback
633 * @param toe reason for request termination 633 * @param toe reason for request termination
634 */ 634 */
635static void 635static void
636notify_completed_cb (void *cls, 636notify_completed_cb (void *cls,
637 struct MHD_Connection *connection, 637 struct MHD_Connection *connection,
638 void **con_cls, 638 void **req_cls,
639 enum MHD_RequestTerminationCode toe) 639 enum MHD_RequestTerminationCode toe)
640{ 640{
641 (void) cls; 641 (void) cls;
@@ -647,15 +647,15 @@ notify_completed_cb (void *cls,
647 (toe != MHD_REQUEST_TERMINATED_CLIENT_ABORT) && 647 (toe != MHD_REQUEST_TERMINATED_CLIENT_ABORT) &&
648 (toe != MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN) ) 648 (toe != MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN) )
649 mhdErrorExitDesc ("notify_completed_cb() called with wrong code"); 649 mhdErrorExitDesc ("notify_completed_cb() called with wrong code");
650 if (NULL == con_cls) 650 if (NULL == req_cls)
651 mhdErrorExitDesc ("'con_cls' parameter is NULL"); 651 mhdErrorExitDesc ("'req_cls' parameter is NULL");
652 if (NULL == *con_cls) 652 if (NULL == *req_cls)
653 mhdErrorExitDesc ("'*con_cls' pointer is NULL"); 653 mhdErrorExitDesc ("'*req_cls' pointer is NULL");
654 if (! pthread_equal (**((pthread_t **) con_cls), 654 if (! pthread_equal (**((pthread_t **) req_cls),
655 pthread_self ())) 655 pthread_self ()))
656 mhdErrorExitDesc ("notify_completed_cb() is called in wrong thread"); 656 mhdErrorExitDesc ("notify_completed_cb() is called in wrong thread");
657 free (*con_cls); 657 free (*req_cls);
658 *con_cls = NULL; 658 *req_cls = NULL;
659} 659}
660 660
661 661
@@ -700,7 +700,7 @@ log_cb (void *cls,
700 * @param socket_context socket-specific pointer where the 700 * @param socket_context socket-specific pointer where the
701 * client can associate some state specific 701 * client can associate some state specific
702 * to the TCP connection; note that this is 702 * to the TCP connection; note that this is
703 * different from the "con_cls" which is per 703 * different from the "req_cls" which is per
704 * HTTP request. The client can initialize 704 * HTTP request. The client can initialize
705 * during #MHD_CONNECTION_NOTIFY_STARTED and 705 * during #MHD_CONNECTION_NOTIFY_STARTED and
706 * cleanup during #MHD_CONNECTION_NOTIFY_CLOSED 706 * cleanup during #MHD_CONNECTION_NOTIFY_CLOSED
@@ -956,7 +956,7 @@ run_usock_client (void *cls)
956 * @param connection original HTTP connection handle, 956 * @param connection original HTTP connection handle,
957 * giving the function a last chance 957 * giving the function a last chance
958 * to inspect the original HTTP request 958 * to inspect the original HTTP request
959 * @param con_cls last value left in `con_cls` of the `MHD_AccessHandlerCallback` 959 * @param req_cls last value left in `req_cls` of the `MHD_AccessHandlerCallback`
960 * @param extra_in if we happened to have read bytes after the 960 * @param extra_in if we happened to have read bytes after the
961 * HTTP header already (because the client sent 961 * HTTP header already (because the client sent
962 * more than the HTTP header of the request before 962 * more than the HTTP header of the request before
@@ -981,7 +981,7 @@ run_usock_client (void *cls)
981static void 981static void
982upgrade_cb (void *cls, 982upgrade_cb (void *cls,
983 struct MHD_Connection *connection, 983 struct MHD_Connection *connection,
984 void *con_cls, 984 void *req_cls,
985 const char *extra_in, 985 const char *extra_in,
986 size_t extra_in_size, 986 size_t extra_in_size,
987 MHD_socket sock, 987 MHD_socket sock,
@@ -989,7 +989,7 @@ upgrade_cb (void *cls,
989{ 989{
990 (void) cls; 990 (void) cls;
991 (void) connection; 991 (void) connection;
992 (void) con_cls; 992 (void) req_cls;
993 (void) extra_in; /* Unused. Silent compiler warning. */ 993 (void) extra_in; /* Unused. Silent compiler warning. */
994 994
995 usock = wr_create_from_plain_sckt (sock); 995 usock = wr_create_from_plain_sckt (sock);
@@ -1028,7 +1028,7 @@ upgrade_cb (void *cls,
1028 * @param upload_data_size set initially to the size of the 1028 * @param upload_data_size set initially to the size of the
1029 * @a upload_data provided; the method must update this 1029 * @a upload_data provided; the method must update this
1030 * value to the number of bytes NOT processed; 1030 * value to the number of bytes NOT processed;
1031 * @param con_cls pointer that the callback can set to some 1031 * @param req_cls pointer that the callback can set to some
1032 * address and that will be preserved by MHD for future 1032 * address and that will be preserved by MHD for future
1033 * calls for this request; since the access handler may 1033 * calls for this request; since the access handler may
1034 * be called many times (i.e., for a PUT/POST operation 1034 * be called many times (i.e., for a PUT/POST operation
@@ -1037,7 +1037,7 @@ upgrade_cb (void *cls,
1037 * If necessary, this state can be cleaned up in the 1037 * If necessary, this state can be cleaned up in the
1038 * global #MHD_RequestCompletedCallback (which 1038 * global #MHD_RequestCompletedCallback (which
1039 * can be set with the #MHD_OPTION_NOTIFY_COMPLETED). 1039 * can be set with the #MHD_OPTION_NOTIFY_COMPLETED).
1040 * Initially, `*con_cls` will be NULL. 1040 * Initially, `*req_cls` will be NULL.
1041 * @return #MHD_YES if the connection was handled successfully, 1041 * @return #MHD_YES if the connection was handled successfully,
1042 * #MHD_NO if the socket must be closed due to a serious 1042 * #MHD_NO if the socket must be closed due to a serious
1043 * error while handling the request 1043 * error while handling the request
@@ -1050,7 +1050,7 @@ ahc_upgrade (void *cls,
1050 const char *version, 1050 const char *version,
1051 const char *upload_data, 1051 const char *upload_data,
1052 size_t *upload_data_size, 1052 size_t *upload_data_size,
1053 void **con_cls) 1053 void **req_cls)
1054{ 1054{
1055 struct MHD_Response *resp; 1055 struct MHD_Response *resp;
1056 (void) cls; 1056 (void) cls;
@@ -1060,11 +1060,11 @@ ahc_upgrade (void *cls,
1060 (void) upload_data; 1060 (void) upload_data;
1061 (void) upload_data_size; /* Unused. Silent compiler warning. */ 1061 (void) upload_data_size; /* Unused. Silent compiler warning. */
1062 1062
1063 if (NULL == con_cls) 1063 if (NULL == req_cls)
1064 mhdErrorExitDesc ("'con_cls' is NULL"); 1064 mhdErrorExitDesc ("'req_cls' is NULL");
1065 if (NULL == *con_cls) 1065 if (NULL == *req_cls)
1066 mhdErrorExitDesc ("'*con_cls' value is NULL"); 1066 mhdErrorExitDesc ("'*req_cls' value is NULL");
1067 if (! pthread_equal (**((pthread_t **) con_cls), pthread_self ())) 1067 if (! pthread_equal (**((pthread_t **) req_cls), pthread_self ()))
1068 mhdErrorExitDesc ("ahc_upgrade() is called in wrong thread"); 1068 mhdErrorExitDesc ("ahc_upgrade() is called in wrong thread");
1069 resp = MHD_create_response_for_upgrade (&upgrade_cb, 1069 resp = MHD_create_response_for_upgrade (&upgrade_cb,
1070 NULL); 1070 NULL);