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.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index b86f1e52..95835d59 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -489,7 +489,7 @@ need_100_continue (struct MHD_Connection *connection)
489 (MHD_str_equal_caseless_(expect, 489 (MHD_str_equal_caseless_(expect,
490 "100-continue")) && 490 "100-continue")) &&
491 (connection->continue_message_write_offset < 491 (connection->continue_message_write_offset <
492 strlen (HTTP_100_CONTINUE)) ); 492 MHD_STATICSTR_LEN_ (HTTP_100_CONTINUE)) );
493} 493}
494 494
495 495
@@ -1201,11 +1201,11 @@ build_header_response (struct MHD_Connection *connection)
1201 } 1201 }
1202 1202
1203 if (must_add_close) 1203 if (must_add_close)
1204 size += strlen ("Connection: close\r\n"); 1204 size += MHD_STATICSTR_LEN_ ("Connection: close\r\n");
1205 if (must_add_keep_alive) 1205 if (must_add_keep_alive)
1206 size += strlen ("Connection: Keep-Alive\r\n"); 1206 size += MHD_MACROSTR_LEN_ ("Connection: Keep-Alive\r\n");
1207 if (must_add_chunked_encoding) 1207 if (must_add_chunked_encoding)
1208 size += strlen ("Transfer-Encoding: chunked\r\n"); 1208 size += MHD_MACROSTR_LEN_ ("Transfer-Encoding: chunked\r\n");
1209 if (must_add_content_length) 1209 if (must_add_content_length)
1210 size += content_length_len; 1210 size += content_length_len;
1211 EXTRA_CHECK (! (must_add_close && must_add_keep_alive) ); 1211 EXTRA_CHECK (! (must_add_close && must_add_keep_alive) );
@@ -1241,24 +1241,24 @@ build_header_response (struct MHD_Connection *connection)
1241 /* we must add the 'Connection: close' header */ 1241 /* we must add the 'Connection: close' header */
1242 memcpy (&data[off], 1242 memcpy (&data[off],
1243 "Connection: close\r\n", 1243 "Connection: close\r\n",
1244 strlen ("Connection: close\r\n")); 1244 MHD_STATICSTR_LEN_ ("Connection: close\r\n"));
1245 off += strlen ("Connection: close\r\n"); 1245 off += MHD_STATICSTR_LEN_ ("Connection: close\r\n");
1246 } 1246 }
1247 if (must_add_keep_alive) 1247 if (must_add_keep_alive)
1248 { 1248 {
1249 /* we must add the 'Connection: Keep-Alive' header */ 1249 /* we must add the 'Connection: Keep-Alive' header */
1250 memcpy (&data[off], 1250 memcpy (&data[off],
1251 "Connection: Keep-Alive\r\n", 1251 "Connection: Keep-Alive\r\n",
1252 strlen ("Connection: Keep-Alive\r\n")); 1252 MHD_STATICSTR_LEN_ ("Connection: Keep-Alive\r\n"));
1253 off += strlen ("Connection: Keep-Alive\r\n"); 1253 off += MHD_STATICSTR_LEN_ ("Connection: Keep-Alive\r\n");
1254 } 1254 }
1255 if (must_add_chunked_encoding) 1255 if (must_add_chunked_encoding)
1256 { 1256 {
1257 /* we must add the 'Transfer-Encoding: chunked' header */ 1257 /* we must add the 'Transfer-Encoding: chunked' header */
1258 memcpy (&data[off], 1258 memcpy (&data[off],
1259 "Transfer-Encoding: chunked\r\n", 1259 "Transfer-Encoding: chunked\r\n",
1260 strlen ("Transfer-Encoding: chunked\r\n")); 1260 MHD_STATICSTR_LEN_ ("Transfer-Encoding: chunked\r\n"));
1261 off += strlen ("Transfer-Encoding: chunked\r\n"); 1261 off += MHD_STATICSTR_LEN_ ("Transfer-Encoding: chunked\r\n");
1262 } 1262 }
1263 if (must_add_content_length) 1263 if (must_add_content_length)
1264 { 1264 {
@@ -2343,7 +2343,7 @@ parse_connection_headers (struct MHD_Connection *connection)
2343#endif 2343#endif
2344 EXTRA_CHECK (NULL == connection->response); 2344 EXTRA_CHECK (NULL == connection->response);
2345 response = 2345 response =
2346 MHD_create_response_from_buffer (strlen (REQUEST_LACKS_HOST), 2346 MHD_create_response_from_buffer (MHD_STATICSTR_LEN_ (REQUEST_LACKS_HOST),
2347 REQUEST_LACKS_HOST, 2347 REQUEST_LACKS_HOST,
2348 MHD_RESPMEM_PERSISTENT); 2348 MHD_RESPMEM_PERSISTENT);
2349 MHD_queue_response (connection, 2349 MHD_queue_response (connection,
@@ -2535,7 +2535,7 @@ MHD_connection_handle_write (struct MHD_Connection *connection)
2535 ret = connection->send_cls (connection, 2535 ret = connection->send_cls (connection,
2536 &HTTP_100_CONTINUE 2536 &HTTP_100_CONTINUE
2537 [connection->continue_message_write_offset], 2537 [connection->continue_message_write_offset],
2538 strlen (HTTP_100_CONTINUE) - 2538 MHD_STATICSTR_LEN_ (HTTP_100_CONTINUE) -
2539 connection->continue_message_write_offset); 2539 connection->continue_message_write_offset);
2540 if (ret < 0) 2540 if (ret < 0)
2541 { 2541 {
@@ -2912,7 +2912,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
2912 continue; 2912 continue;
2913 case MHD_CONNECTION_CONTINUE_SENDING: 2913 case MHD_CONNECTION_CONTINUE_SENDING:
2914 if (connection->continue_message_write_offset == 2914 if (connection->continue_message_write_offset ==
2915 strlen (HTTP_100_CONTINUE)) 2915 MHD_STATICSTR_LEN_ (HTTP_100_CONTINUE))
2916 { 2916 {
2917 connection->state = MHD_CONNECTION_CONTINUE_SENT; 2917 connection->state = MHD_CONNECTION_CONTINUE_SENT;
2918 if (MHD_NO != socket_flush_possible (connection)) 2918 if (MHD_NO != socket_flush_possible (connection))