diff options
Diffstat (limited to 'server/src/httpd.cc')
| -rw-r--r-- | server/src/httpd.cc | 11 | 
1 files changed, 9 insertions, 2 deletions
diff --git a/server/src/httpd.cc b/server/src/httpd.cc index e47cefc..ce1a1ce 100644 --- a/server/src/httpd.cc +++ b/server/src/httpd.cc @@ -39,6 +39,8 @@  #include <microhttpd.h> +#include "debug.h" +  typedef struct {    void *ptr;    bool firstrun; @@ -48,6 +50,8 @@ typedef struct {  int hdit(void *cls, enum MHD_ValueKind kind, const char *key, const char *value)  { +  DEBUG(httpd, "%s: %s\n", key, value); +    headers_t *headers = (headers_t*)cls;    (*headers)[key] = value; @@ -70,8 +74,11 @@ static int request_handler(void *cls,    if(*con_cls == NULL) {      headers_t headers; +    headers_t getargs; -    MHD_get_connection_values(con, MHD_HEADER_KIND, hdit, &headers); +    MHD_get_connection_values(con, MHD_HEADER_KIND, &hdit, &headers); +    int n = MHD_get_connection_values(con, MHD_GET_ARGUMENT_KIND, &hdit, &getargs); +    DEBUG(httpd, "Num args: %d\n", n);      connection_t* c = new connection_t; @@ -81,7 +88,7 @@ static int request_handler(void *cls,        c->total = atoi(headers["Content-Length"].c_str());      }      c->acc = 0; -    c->ptr = httpd->begin(url, method, version, headers); +    c->ptr = httpd->begin(url, method, version, getargs, headers);      *con_cls = c;    }  | 
