46 |
|
// |
47 |
|
// Douglas Thrift |
48 |
|
// |
49 |
< |
// $Id: HttpHandler.h,v 1.17 2003/07/18 07:17:10 douglas Exp $ |
49 |
> |
// $Id: HttpHandler.h,v 1.18 2003/07/20 01:46:12 douglas Exp $ |
50 |
|
|
51 |
|
#ifndef _HttpHandler_h_ |
52 |
|
#define _HttpHandler_h_ |
59 |
|
// Windows Sockets |
60 |
|
#include <winsock2.h> |
61 |
|
#include <windows.h> |
62 |
+ |
|
63 |
+ |
inline int getpid() { return GetCurrentProcessId(); } |
64 |
|
#else |
65 |
|
// BSD Sockets |
66 |
|
typedef int SOCKET; |
67 |
+ |
|
68 |
+ |
#define INVALID_SOCKET -1 |
69 |
+ |
#define SOCKET_ERROR -1 |
70 |
+ |
|
71 |
+ |
inline int closesocket(SOCKET s) { return close(s); } |
72 |
|
#endif // _WIN32 |
73 |
|
|
74 |
|
#ifdef _OpenSSL_ |
110 |
|
HttpHandler(); |
111 |
|
~HttpHandler(); |
112 |
|
bool handle(URL& url, const string referer = "", bool head = false); |
113 |
< |
istream& pageStream() { return page; } |
113 |
> |
iostream& pageStream() { return page; } |
114 |
|
istream& getline(string& line) { return std::getline(page, line); } |
115 |
|
istream& getline(string& line, char end) { return std::getline(page, line, |
116 |
|
end); } |