--- parser3/src/lib/smtp/smtp.h 2004/02/24 10:36:16 1.3 +++ parser3/src/lib/smtp/smtp.h 2006/04/09 13:38:47 1.7 @@ -1,11 +1,11 @@ /** @file Parser: SMTP sender decl. - Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_SMTP_H="$Date: 2004/02/24 10:36:16 $"; +static const char * const IDENT_SMTP_H="$Date: 2006/04/09 13:38:47 $"; #include "pa_string.h" @@ -19,27 +19,70 @@ typedef u_int SOCKET; int PASCAL closesocket(SOCKET); #else # if defined(WIN32) +# define WINVER 0x0400 # include # else typedef char CHAR; typedef u_int SOCKET; # define closesocket close inline int WSAGetLastError() { return errno; } + +#ifdef EPROTONOSUPPORT # define WSAEPROTONOSUPPORT EPROTONOSUPPORT +#else +# define WSAEPROTONOSUPPORT (10000) +#endif +#ifdef ESOCKTNOSUPPORT # define WSAESOCKTNOSUPPORT ESOCKTNOSUPPORT +#else +# define WSAESOCKTNOSUPPORT (10001) +#endif +#ifdef ENOTCONN # define WSAENOTCONN ENOTCONN +#else +# define WSAENOTCONN (10002) +#endif +#ifdef ESHUTDOWN # define WSAENETDOWN ESHUTDOWN +#else +# define WSAENETDOWN (10003) +#endif +#ifdef EHOSTUNREACH # define WSAENETUNREACH EHOSTUNREACH +#else +# define WSAENETUNREACH (10004) +#endif +#ifdef ENETRESET # define WSAENETRESET ENETRESET +#else +# define WSAENETRESET (10005) +#endif +#ifdef ECONNABORTED # define WSAECONNABORTED ECONNABORTED +#else +# define WSAECONNABORTED (10006) +#endif +#ifdef ECONNRESET # define WSAECONNRESET ECONNRESET +#else +# define WSAECONNRESET (10007) +#endif +#ifdef EWOULDBLOCK # define WSAEWOULDBLOCK EWOULDBLOCK +#else +# define WSAEWOULDBLOCK (10008) +#endif +#ifdef ECONNREFUSED # define WSAECONNREFUSED ECONNREFUSED +#else +# define WSAECONNREFUSED (10009) +#endif +# define WSAHOST_NOT_FOUND (10010) -# define WSAHOST_NOT_FOUND (2) # ifndef INADDR_NONE # define INADDR_NONE ((unsigned long) -1) # endif + # ifndef INVALID_SOCKET # define INVALID_SOCKET (SOCKET)(~0) # endif @@ -55,7 +98,8 @@ int PASCAL closesocket(SOCKET); #define ERR_CLOSING 4012 #define WAIT_A_BIT 4013 -#define MAXOUTLINE 255 +/// must be >=SOCKET_BUFFER_SIZE, thanks to Lev Walkin for pointing that out +#define MAXOUTLINE (SOCKET_BUFFER_SIZE*2) //////////////////////////////////////////////////////////////////////////////