projects
/
psensor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
acd9541
)
avoid to mix code/decl
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Wed, 24 Sep 2014 09:32:16 +0000
(11:32 +0200)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Wed, 24 Sep 2014 09:32:16 +0000
(11:32 +0200)
src/server/server.c
patch
|
blob
|
history
diff --git
a/src/server/server.c
b/src/server/server.c
index
f416147
..
410bd40
100644
(file)
--- a/
src/server/server.c
+++ b/
src/server/server.c
@@
-245,12
+245,13
@@
static struct MHD_Response *create_response_file(const char *nurl,
static struct MHD_Response *
create_response(const char *nurl, const char *method, unsigned int *rp_code)
{
static struct MHD_Response *
create_response(const char *nurl, const char *method, unsigned int *rp_code)
{
+ char *page, *fpath;
struct MHD_Response *resp = NULL;
if (!strncmp(nurl, URL_BASE_API_1_1, strlen(URL_BASE_API_1_1))) {
resp = create_response_api(nurl, method, rp_code);
} else {
struct MHD_Response *resp = NULL;
if (!strncmp(nurl, URL_BASE_API_1_1, strlen(URL_BASE_API_1_1))) {
resp = create_response_api(nurl, method, rp_code);
} else {
-
char *
fpath = get_path(nurl, server_data.www_dir);
+ fpath = get_path(nurl, server_data.www_dir);
resp = create_response_file(nurl, method, rp_code, fpath);
resp = create_response_file(nurl, method, rp_code, fpath);
@@
-260,7
+261,7
@@
create_response(const char *nurl, const char *method, unsigned int *rp_code)
if (resp)
return resp;
if (resp)
return resp;
-
char *
page = strdup(PAGE_NOT_FOUND);
+ page = strdup(PAGE_NOT_FOUND);
*rp_code = MHD_HTTP_NOT_FOUND;
return MHD_create_response_from_data(strlen(page),
*rp_code = MHD_HTTP_NOT_FOUND;
return MHD_create_response_from_data(strlen(page),