10 #ifndef __WVHTTPPOOL_H 11 #define __WVHTTPPOOL_H 15 #include "wvistreamlist.h" 16 #include "wvstreamclone.h" 18 #include "wvhashtable.h" 19 #include "wvbufstream.h" 28 static const WvString DEFAULT_ANON_PW(
"weasels@");
35 : name(_name), value(_value)
59 WvStream *content_source,
bool _create_dirs,
bool _pipeline_test);
74 : linkname(_linkname), url(_url)
90 WvHTTPHeaderDict headers;
98 const char *wstype()
const {
return "WvBufUrlStream"; }
114 : remaddr(_remaddr), username(_username) {}
118 bool operator== (
const Target &n2)
const 119 {
return (username == n2.username && remaddr == n2.remaddr); }
122 static int max_requests;
126 WvUrlRequestList urls, waiting_urls;
129 virtual void doneurl() = 0;
130 virtual void request_next() = 0;
136 log(logname, WvLog::Debug)
144 virtual void close() = 0;
148 virtual size_t remaining()
151 virtual void execute() = 0;
154 const char *wstype()
const {
return "WvUrlStream"; }
165 static bool global_enable_pipelining;
166 bool enable_pipelining;
169 int pipeline_test_count;
171 bool sent_url_request;
172 WvIPPortAddrTable &pipeline_incompatible;
173 WvString http_response, pipeline_test_response;
176 enum { Unknown, Chunked, ContentLength, Infinity,
177 PostHeadInfinity, PostHeadChunked, PostHeadStream,
178 ChuckInfinity, ChuckChunked, ChuckStream } encoding;
179 size_t bytes_remaining;
180 bool in_chunk_trailer, last_was_pipeline_test, in_doneurl;
182 virtual void doneurl();
183 virtual void request_next();
184 void start_pipeline_test(
WvUrl *url);
187 void pipelining_is_broken(
int why);
191 bool ssl, WvIPPortAddrTable &_pipeline_incompatible);
194 virtual void close();
197 virtual void execute();
198 virtual size_t remaining()
199 {
return bytes_remaining; }
202 const char *wstype()
const {
return "WvHttpStream"; }
208 bool logged_in, pasv_acked;
211 time_t last_request_time;
214 virtual void doneurl();
215 virtual void request_next();
219 char *get_important_line();
226 WvString parse_for_links(
char *line);
229 void* real_execute(
void*);
237 virtual void close();
238 virtual void execute();
241 const char *wstype()
const {
return "WvFtpStream"; }
250 WvUrlStreamDict conns;
251 WvUrlRequestList urls;
252 int num_streams_created;
255 WvIPPortAddrTable pipeline_incompatible;
263 virtual void execute();
268 bool create_dirs =
false);
279 {
return !urls.count(); }
282 const char *wstype()
const {
return "WvHttpPool"; }
286 #endif // __WVHTTPPOOL_H A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
An IP+Port address also includes a port number, with the resulting form www.xxx.yyy.zzz:pppp.
WvCont provides "continuations", which are apparently also known as semi-coroutines.
Unified support for streams, that is, sequences of bytes that may or may not be ready for read/write ...
ASynchronous DNS resolver functions, so that we can do non-blocking lookups.
the data structure used by pre_select()/post_select() and internally by select(). ...
WvTCPConn tries to make all outgoing connections asynchronously (in the background).
WvBufStream stores data written by write(), and returns it later on in read().
WvString is an implementation of a simple and efficient printable-string class.
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's...
WvStreamClone simply forwards all requests to the "cloned" stream.
WvStreamList holds a list of WvStream objects – and its select() and callback() functions know how t...