[Debian-iot-packaging] [openzwave-controlpanel] 69/81: Fixed deprecated warnings
Dara Adib
daradib-guest at moszumanska.debian.org
Thu Dec 22 16:57:55 UTC 2016
This is an automated email from the git hooks/post-receive script.
daradib-guest pushed a commit to branch debian/master
in repository openzwave-controlpanel.
commit cd57aeea27bad0f3c3f90a7825b0c551d17c76f4
Author: Gaston Dombiak <gdombiak at gmail.com>
Date: Fri Jun 24 00:09:52 2016 -0700
Fixed deprecated warnings
---
webserver.cpp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/webserver.cpp b/webserver.cpp
index dce86bd..26bf605 100644
--- a/webserver.cpp
+++ b/webserver.cpp
@@ -106,7 +106,13 @@ static int web_send_data (struct MHD_Connection *connection, const char *data,
struct MHD_Response *response;
int ret;
- response = MHD_create_response_from_data(strlen(data), (void *)data, free ? MHD_YES : MHD_NO, copy ? MHD_YES : MHD_NO);
+ if (!copy && ! free)
+ response = MHD_create_response_from_buffer(strlen(data), (void *) data, MHD_RESPMEM_PERSISTENT);
+ else if (copy)
+ response = MHD_create_response_from_buffer(strlen(data), (void *) data, MHD_RESPMEM_MUST_COPY);
+ else
+ response = MHD_create_response_from_buffer(strlen(data), (void *) data, MHD_RESPMEM_MUST_FREE);
+
if (response == NULL)
return MHD_NO;
if (ct != NULL)
@@ -161,7 +167,7 @@ int web_send_file (struct MHD_Connection *conn, const char *filename, const int
if (stat(filename, &buf) == -1 ||
((fp = fopen(filename, "r")) == NULL)) {
if (strcmp(p, "xml") == 0)
- response = MHD_create_response_from_data(0, (void *)"", MHD_NO, MHD_NO);
+ response = MHD_create_response_from_buffer(0, (void *) "", MHD_RESPMEM_PERSISTENT);
else {
int len = strlen(FNF) + strlen(filename) - 1; // len(%s) + 1 for \0
char *s = (char *)malloc(len);
@@ -170,7 +176,7 @@ int web_send_file (struct MHD_Connection *conn, const char *filename, const int
exit(1);
}
snprintf(s, len, FNF, filename);
- response = MHD_create_response_from_data(len, (void *)s, MHD_YES, MHD_NO); // free
+ response = MHD_create_response_from_buffer(len, (void *) s, MHD_RESPMEM_MUST_FREE); // free
}
} else
response = MHD_create_response_from_callback(buf.st_size, 32 * 1024, &web_read_file, fp,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-iot/openzwave-controlpanel.git
More information about the Debian-iot-packaging
mailing list