--- parser3/src/include/pa_socks.h 2002/08/01 11:26:47 1.9 +++ parser3/src/include/pa_socks.h 2026/10/16 13:55:16 1.26 @@ -1,18 +1,33 @@ /** @file Parser: socks initialization/finalization decls. - Copyright (c) 2001, 2002 ArtLebedev Group (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_SOCKS_H #define PA_SOCKS_H -static const char* IDENT_SOCKS_H="$Id: pa_socks.h,v 1.9 2002/08/01 11:26:47 paf Exp $"; +#define IDENT_PA_SOCKS_H "$Id: pa_socks.h,v 1.26 2026/10/16 13:55:16 moko Exp $" -#include "pa_pool.h" +#ifdef _MSC_VER +#define socklen_t int +#else +#define closesocket close +#define INVALID_SOCKET -1 +typedef int SOCKET; +#endif + +void pa_socks_init(); +void pa_socks_done(); + +int pa_socks_errno(); +const char* pa_socks_strerr(int no); + +/// true if the error means that the connection is reset or aborted +bool pa_socks_is_reset(int no); -void init_socks(Pool& pool); -void done_socks(); +/// waits up to timeout_ms for the socket to be ready for reading (or writing): >0 ready, 0 timeout, <0 error +int pa_sock_ready(SOCKET sock, bool for_write, int timeout_ms); #endif