|
|
| version 1.13, 2002/02/08 08:30:16 | version 1.18.2.1, 2003/01/28 12:11:50 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: socks initialization/finalization. | Parser: socks initialization/finalization. |
| Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| $Id$ | |
| */ | */ |
| static const char* IDENT_SOCKS_C="$Date$"; | |
| #define NO_UNISTD_H | #define NO_UNISTD_H |
| #include "pa_config_includes.h" | #include "pa_config_includes.h" |
| #ifndef HAVE_SYS_SELECT_H | #ifdef HAVE_WINSOCK_H |
| #include "pa_exception.h" | #include "pa_exception.h" |
| #include "pa_socks.h" | #include "pa_socks.h" |
| Line 18 | Line 18 |
| WSADATA wsaData; | WSADATA wsaData; |
| void init_socks(Pool& pool) { | void pa_init_socks() { |
| WORD wVersionRequested; | WORD wVersionRequested; |
| int err; | int err; |
| wVersionRequested = MAKEWORD( 1, 1 ); | wVersionRequested = MAKEWORD( 1, 1 ); |
| Line 27 void init_socks(Pool& pool) { | Line 27 void init_socks(Pool& pool) { |
| if ( err != 0 ) { | if ( err != 0 ) { |
| /* Tell the user that we could not find a usable */ | /* Tell the user that we could not find a usable */ |
| /* WinSock DLL. */ | /* WinSock DLL. */ |
| throw Exception(0, 0, | throw Exception(0, |
| 0, | Exception::undefined_source, |
| "can not WSAStartup, err=%d", | "can not WSAStartup, err=%d", |
| err); | err); |
| } | } |
| } | } |
| void done_socks() { | void pa_done_socks() { |
| /* Confirm that the WinSock DLL supports 2.2.*/ | /* Confirm that the WinSock DLL supports 2.2.*/ |
| /* Note that if the DLL supports versions greater */ | /* Note that if the DLL supports versions greater */ |
| /* than 2.2 in addition to 2.2, it will still return */ | /* than 2.2 in addition to 2.2, it will still return */ |
| Line 49 void done_socks() { | Line 49 void done_socks() { |
| #else | #else |
| #include "pa_pool.h" | void pa_init_socks() {} |
| void pa_done_socks() {} | |
| void init_socks(Pool& pool) {} | |
| void done_socks() {} | |
| #endif | #endif |