Skip to content

Commit

Permalink
Remove deprecated libmicrohttpd functions. #246
Browse files Browse the repository at this point in the history
  • Loading branch information
zobelhelas committed Mar 24, 2016
1 parent f72dbc5 commit cd2556f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/local.cpp
Expand Up @@ -212,15 +212,15 @@ int handle_request(
}

json_str = json_object_to_json_string(json_obj);
response = MHD_create_response_from_data(strlen(json_str), (void *) json_str, FALSE, TRUE);
response = MHD_create_response_from_buffer(strlen(json_str), static_cast<void *>(const_cast<char *> (json_str)), MHD_RESPMEM_MUST_COPY);
json_object_put(json_obj);

MHD_add_response_header(response, "Content-type", "application/json");
}
else {
char *response_str = strdup("not implemented\n");

response = MHD_create_response_from_data(strlen(response_str), (void *) response_str, TRUE, FALSE);
response = MHD_create_response_from_buffer(strlen(response_str), static_cast<void *>(const_cast<char *> (response_str)), MHD_RESPMEM_MUST_COPY);
response_code = MHD_HTTP_METHOD_NOT_ALLOWED;

MHD_add_response_header(response, "Content-type", "text/text");
Expand Down

0 comments on commit cd2556f

Please sign in to comment.