summarylogtreecommitdiffstats
path: root/psensor-libmicrohttpd.patch
blob: b161bd491f1c496fb7188f58b59c39b58982198c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--- a/src/server/server.c
+++ b/src/server/server.c
@@ -192,8 +192,8 @@
 	if (page) {
 		*rp_code = MHD_HTTP_OK;
 
-		resp = MHD_create_response_from_data(strlen(page), page,
-						     MHD_YES, MHD_NO);
+		resp = MHD_create_response_from_buffer(strlen(page), page,
+						     MHD_RESPMEM_MUST_FREE);
 
 		MHD_add_response_header(resp, MHD_HTTP_HEADER_CONTENT_TYPE,
 					"application/json");
@@ -223,8 +223,8 @@
 
 			if (!st.st_size) {
 				fclose(file);
-				return MHD_create_response_from_data
-					(0, NULL, MHD_NO, MHD_NO);
+				return MHD_create_response_from_buffer
+					(0, NULL, MHD_RESPMEM_PERSISTENT);
 			}
 
 			return MHD_create_response_from_callback
@@ -263,10 +263,9 @@
 	char *page = strdup(PAGE_NOT_FOUND);
 	*rp_code = MHD_HTTP_NOT_FOUND;
 
-	return MHD_create_response_from_data(strlen(page),
+	return MHD_create_response_from_buffer(strlen(page),
 					     page,
-					     MHD_YES,
-					     MHD_NO);
+					     MHD_RESPMEM_MUST_FREE);
 }
 
 static int cbk_http_request(void *cls,