--- parser3/src/include/pa_http.h 2021/12/22 21:52:49 1.33 +++ parser3/src/include/pa_http.h 2026/10/16 13:55:16 1.39 @@ -1,14 +1,14 @@ /** @file Parser: commonly used functions. - Copyright (c) 2001-2020 Art. Lebedev Studio (http://www.artlebedev.com) - Author: Alexandr Petrosian (http://paf.design.ru) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) + Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_HTTP_H #define PA_HTTP_H -#define IDENT_PA_HTTP_H "$Id: pa_http.h,v 1.33 2021/12/22 21:52:49 moko Exp $" +#define IDENT_PA_HTTP_H "$Id: pa_http.h,v 1.39 2026/10/16 13:55:16 moko Exp $" #include "pa_vstring.h" #include "pa_vint.h" @@ -22,11 +22,6 @@ #ifdef _MSC_VER #include -#define socklen_t int -#else -#define closesocket close -#define INVALID_SOCKET -1 -typedef int SOCKET; #endif #ifndef DOXYGEN @@ -63,7 +58,7 @@ public: void clear(){ headers.clear(); - content_type=""; + content_type.clear(); content_length=0; } @@ -113,6 +108,13 @@ public: bool read_header(); size_t read_post(char *, size_t); size_t send_body(const void *, size_t); + + /// bytes received after the request headers, not processed yet + String::C unprocessed(); + /// receives up to size bytes, returns 0 if the connection is closed + size_t receive(char *, size_t); + void set_nodelay(); + void set_send_timeout(int timeout_secs); }; class HTTPD_Server : public PA_Allocated {