--- parser3/src/include/pa_http.h 2020/10/10 09:05:42 1.21 +++ parser3/src/include/pa_http.h 2020/10/11 23:25:09 1.23 @@ -8,7 +8,7 @@ #ifndef PA_HTTP_H #define PA_HTTP_H -#define IDENT_PA_HTTP_H "$Id: pa_http.h,v 1.21 2020/10/10 09:05:42 moko Exp $" +#define IDENT_PA_HTTP_H "$Id: pa_http.h,v 1.23 2020/10/11 23:25:09 moko Exp $" #include "pa_vstring.h" #include "pa_vint.h" @@ -88,6 +88,15 @@ public: const char *content_type(); uint64_t content_length(); + const char *query(){ + if(uri()){ + const char *result=strchr(uri(), '?'); + if(result++ && *result) + return result; + } + return NULL; + } + void read_header(); size_t read_post(char *, size_t); size_t send_body(const void *buf, size_t size); @@ -95,7 +104,7 @@ public: class HTTPD_Server : public PA_Allocated { public: - static int bind(const char *host, int port); + static int bind(const char *host_port); static HTTPD_Connection *accept(int sock, int timeout_value); };