aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/connection.c')
-rw-r--r--src/daemon/connection.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/daemon/connection.c b/src/daemon/connection.c
index 01163154..7abe0205 100644
--- a/src/daemon/connection.c
+++ b/src/daemon/connection.c
@@ -30,6 +30,7 @@
30#include "connection.h" 30#include "connection.h"
31#include "memorypool.h" 31#include "memorypool.h"
32#include "response.h" 32#include "response.h"
33#include "reason_phrase.h"
33 34
34/** 35/**
35 * Message to transmit when http 1.1 request is received 36 * Message to transmit when http 1.1 request is received
@@ -986,12 +987,14 @@ MHD_build_header_response (struct MHD_Connection *connection)
986 size_t size; 987 size_t size;
987 size_t off; 988 size_t off;
988 struct MHD_HTTP_Header *pos; 989 struct MHD_HTTP_Header *pos;
989 char code[32]; 990 char code[128];
990 char date[128]; 991 char date[128];
991 char *data; 992 char *data;
992 993
993 MHD_add_extra_headers (connection); 994 MHD_add_extra_headers (connection);
994 SPRINTF (code, "%s %u\r\n", MHD_HTTP_VERSION_1_1, connection->responseCode); 995 const char* reason_phrase = MHD_get_reason_phrase_for(connection->responseCode);
996 _REAL_SNPRINTF (code, 128, "%s %u %s\r\n", MHD_HTTP_VERSION_1_1,
997 connection->responseCode, reason_phrase);
995 off = strlen (code); 998 off = strlen (code);
996 /* estimate size */ 999 /* estimate size */
997 size = off + 2; /* extra \r\n at the end */ 1000 size = off + 2; /* extra \r\n at the end */