aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r--src/microhttpd/connection.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index bfe5b820..b7a9a31a 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3674,6 +3674,7 @@ call_connection_handler (struct MHD_Connection *connection)
3674 return; /* already queued a response */ 3674 return; /* already queued a response */
3675 processed = 0; 3675 processed = 0;
3676 connection->rq.client_aware = true; 3676 connection->rq.client_aware = true;
3677 connection->in_access_handler = true;
3677 if (MHD_NO == 3678 if (MHD_NO ==
3678 daemon->default_handler (daemon->default_handler_cls, 3679 daemon->default_handler (daemon->default_handler_cls,
3679 connection, 3680 connection,
@@ -3684,12 +3685,14 @@ call_connection_handler (struct MHD_Connection *connection)
3684 &processed, 3685 &processed,
3685 &connection->rq.client_context)) 3686 &connection->rq.client_context))
3686 { 3687 {
3688 connection->in_access_handler = false;
3687 /* serious internal error, close connection */ 3689 /* serious internal error, close connection */
3688 CONNECTION_CLOSE_ERROR (connection, 3690 CONNECTION_CLOSE_ERROR (connection,
3689 _ ("Application reported internal error, " \ 3691 _ ("Application reported internal error, " \
3690 "closing connection.")); 3692 "closing connection."));
3691 return; 3693 return;
3692 } 3694 }
3695 connection->in_access_handler = false;
3693} 3696}
3694 3697
3695 3698
@@ -3898,6 +3901,7 @@ process_request_body (struct MHD_Connection *connection)
3898 } 3901 }
3899 left_unprocessed = to_be_processed; 3902 left_unprocessed = to_be_processed;
3900 connection->rq.client_aware = true; 3903 connection->rq.client_aware = true;
3904 connection->in_access_handler = true;
3901 if (MHD_NO == 3905 if (MHD_NO ==
3902 daemon->default_handler (daemon->default_handler_cls, 3906 daemon->default_handler (daemon->default_handler_cls,
3903 connection, 3907 connection,
@@ -3908,12 +3912,15 @@ process_request_body (struct MHD_Connection *connection)
3908 &left_unprocessed, 3912 &left_unprocessed,
3909 &connection->rq.client_context)) 3913 &connection->rq.client_context))
3910 { 3914 {
3915 connection->in_access_handler = false;
3911 /* serious internal error, close connection */ 3916 /* serious internal error, close connection */
3912 CONNECTION_CLOSE_ERROR (connection, 3917 CONNECTION_CLOSE_ERROR (connection,
3913 _ ("Application reported internal error, " \ 3918 _ ("Application reported internal error, " \
3914 "closing connection.")); 3919 "closing connection."));
3915 return; 3920 return;
3916 } 3921 }
3922 connection->in_access_handler = false;
3923
3917 if (left_unprocessed > to_be_processed) 3924 if (left_unprocessed > to_be_processed)
3918 MHD_PANIC (_ ("libmicrohttpd API violation.\n")); 3925 MHD_PANIC (_ ("libmicrohttpd API violation.\n"));
3919 3926
@@ -7102,10 +7109,12 @@ MHD_queue_response (struct MHD_Connection *connection,
7102 struct MHD_Daemon *daemon; 7109 struct MHD_Daemon *daemon;
7103 bool reply_icy; 7110 bool reply_icy;
7104 7111
7105 reply_icy = (0 != (status_code & MHD_ICY_FLAG));
7106 status_code &= ~MHD_ICY_FLAG;
7107 if ((NULL == connection) || (NULL == response)) 7112 if ((NULL == connection) || (NULL == response))
7108 return MHD_NO; 7113 return MHD_NO;
7114 if (! connection->in_access_handler)
7115 return MHD_NO;
7116 reply_icy = (0 != (status_code & MHD_ICY_FLAG));
7117 status_code &= ~MHD_ICY_FLAG;
7109 7118
7110 daemon = connection->daemon; 7119 daemon = connection->daemon;
7111 7120