From: Jim Morris Date: Fri, 7 Sep 2018 13:31:37 +0000 (+0100) Subject: better way to do the query string X-Git-Url: http://git.hcoop.net/clinton/Smoothieware.git/commitdiff_plain/e83d6fddda61419a5c8d787c7599213cead87f84 better way to do the query string --- diff --git a/src/libs/Network/uip/webserver/httpd.c b/src/libs/Network/uip/webserver/httpd.c index 4bdaa5b6..7db3d537 100644 --- a/src/libs/Network/uip/webserver/httpd.c +++ b/src/libs/Network/uip/webserver/httpd.c @@ -319,6 +319,7 @@ static PT_THREAD(send_headers(struct httpd_state *s, const char *statushdr)) static PT_THREAD(handle_output(struct httpd_state *s)) { + const char *str= NULL; PT_BEGIN(&s->outputpt); if (s->method == OPTIONS) { @@ -359,7 +360,8 @@ PT_THREAD(handle_output(struct httpd_state *s)) if (strcmp(s->filename, "/query") == 0) { // query short cut PT_WAIT_THREAD(&s->outputpt, send_headers(s, http_header_200)); - PSOCK_SEND_STR(&s->sout, get_query_string()); + str= get_query_string(); + PSOCK_SEND_STR(&s->sout, str); } else if (!fs_open(s)) { // Note this has the side effect of opening the file DEBUG_PRINTF("404 file not found\n");