Skip to content
Snippets Groups Projects
Commit 85c48c65 authored by Tod Kurt's avatar Tod Kurt
Browse files

blink1-tiny-server: update mongoose from 7.5 to 7.7

parent 14e66b38
No related branches found
No related tags found
No related merge requests found
...@@ -230,7 +230,7 @@ static void log_access(struct mg_connection *c, char* uri_str, int resp_code) { ...@@ -230,7 +230,7 @@ static void log_access(struct mg_connection *c, char* uri_str, int resp_code) {
char date_str[100]; char date_str[100];
strftime(date_str, sizeof(date_str), "%d/%b/%Y:%H:%M:%S %z", localtime(&rawtime)); strftime(date_str, sizeof(date_str), "%d/%b/%Y:%H:%M:%S %z", localtime(&rawtime));
char ip_str[20]; char ip_str[20];
mg_ntoa( &(c->peer), ip_str, sizeof(ip_str)); mg_ntoa( &(c->rem), ip_str, sizeof(ip_str));
printf("%s - [%s] \"%s %s HTTP/1.1\" %d %d\n", ip_str, date_str, "GET", uri_str, resp_code, 0 ); // can't get response length I guess printf("%s - [%s] \"%s %s HTTP/1.1\" %d %d\n", ip_str, date_str, "GET", uri_str, resp_code, 0 ); // can't get response length I guess
} }
...@@ -262,7 +262,7 @@ static void ev_handler(struct mg_connection *c, int ev, void *ev_data, void *fn_ ...@@ -262,7 +262,7 @@ static void ev_handler(struct mg_connection *c, int ev, void *ev_data, void *fn_
struct mg_str* uri = &hm->uri; struct mg_str* uri = &hm->uri;
struct mg_str* querystr = &hm->query; struct mg_str* querystr = &hm->query;
snprintf(uri_str, uri->len+1, "%s", uri->ptr); // uri->ptr gives us char ptr mg_snprintf(uri_str, uri->len+1, "%s", uri->ptr); // uri->ptr gives us char ptr
DictionaryInsert(resultsdict, "uri", uri_str); DictionaryInsert(resultsdict, "uri", uri_str);
DictionaryInsert(resultsdict, "version", blink1_server_version); DictionaryInsert(resultsdict, "version", blink1_server_version);
...@@ -658,7 +658,7 @@ int main(int argc, char *argv[]) { ...@@ -658,7 +658,7 @@ int main(int argc, char *argv[]) {
mg_mgr_init(&mgr); mg_mgr_init(&mgr);
if ((c = mg_http_listen(&mgr, http_listen_url, ev_handler, &mgr)) == NULL) { if ((c = mg_http_listen(&mgr, http_listen_url, ev_handler, &mgr)) == NULL) {
LOG(LL_ERROR, ("Cannot listen on %s.", http_listen_url)); MG_LOG(MG_LL_ERROR, ("Cannot listen on %s.", http_listen_url));
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
......
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment