18 #include "wvistreamlist.h"
23 int main(
int argc,
char **argv)
25 WvLog log(
"http", WvLog::Info);
26 WvURL url(
"http://www.net-itech.com/");
27 WvHTTPStream http(url);
28 WvFile out(
"http.out", O_WRONLY | O_TRUNC | O_CREAT);
29 WvHTTPStream::State last_state = WvHTTPStream::Done;
30 static char buf[10240];
34 l.add_after(l.tail, &http,
false);
36 while (http.isok() && out.isok())
38 if (last_state != http.state)
40 log(
"\nNow in state %s\n", http.state);
41 last_state = http.state;
49 len = http.read(buf,
sizeof(buf));
55 if (!http.isok() && http.geterr())
56 log(
"http: %s\n", http.errstr());