1 |
|
/* ============================================================================ |
2 |
|
* Douglas Thrift's Search Engine License |
3 |
|
* |
4 |
< |
* Copyright (C) 2002, Douglas Thrift. All Rights Reserved. |
4 |
> |
* Copyright (C) 2002-2003, Douglas Thrift. All Rights Reserved. |
5 |
|
* Redistribution and use in source and binary forms, with or without |
6 |
|
* modification, are permitted provided that the following conditions are met: |
7 |
|
* |
89 |
|
#endif // _WIN32 |
90 |
|
SOCKET http; |
91 |
|
char* buffer; |
92 |
– |
unsigned begin; |
92 |
|
string page; |
93 |
|
string type; |
94 |
|
unsigned length; |
95 |
|
string location; |
96 |
|
bool chunked; |
97 |
+ |
void populate(); |
98 |
|
void putline(const string line = ""); |
99 |
|
string getline(); |
100 |
|
void error(const string& prefix, bool host = false); |
101 |
|
public: |
102 |
|
HttpHandler(); |
103 |
|
~HttpHandler(); |
104 |
< |
bool handle(URL& url, bool head = false); |
104 |
> |
bool handle(URL& url, const string referer = "", bool head = false); |
105 |
|
HttpHandler& getline(string& line, char endline = '\n'); |
106 |
< |
bool good(); |
106 |
> |
bool good() { return (page.length() > 0); } |
107 |
|
void clear(); |
108 |
|
string contentType() { return type; } |
109 |
|
unsigned contentLength() { return length; } |