~ubuntu-branches/ubuntu/trusty/wvstreams/trusty

« back to all changes in this revision

Viewing changes to urlget/t/wvhttppool.t.cc

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut
  • Date: 2008-04-05 14:47:52 UTC
  • mfrom: (0.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080405144752-gka8v86xuo52fmto
Tags: 4.4.1-0.2
* Non-maintainer upload.
* Fixed dependency information LSB header in init.d script
  (closes: #470067)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "wvtest.h"
2
2
#include "wvhttppool.h"
3
3
#include <stdio.h>
 
4
 
 
5
#ifndef _WIN32
4
6
#include <netdb.h>
 
7
#endif
5
8
 
6
9
static void close_callback(WvStream& s)
7
10
{
16
19
        WvHttpPool pool;
17
20
 
18
21
        WvIStreamList l;
19
 
        l.append(&pool, false);
 
22
        l.append(&pool, false, "WvHttpPool");
20
23
 
21
24
        WvStream *buf;
22
25
        WVPASS(buf = pool.addurl("http://www.google.com"));
23
26
        WVPASS(buf->isok());
24
27
        buf->autoforward(*wvcon);
25
28
        buf->setclosecallback(close_callback);
26
 
        l.append(buf, true);
 
29
        l.append(buf, true, "buf stream");
27
30
        while (buf->isok() && (wvcon->isok() || !pool.idle()))
28
31
            l.runonce();
29
32
        WVPASS(!(buf->isok()));
41
44
        WvHttpPool pool;
42
45
 
43
46
        WvIStreamList l;
44
 
        l.append(&pool, false);
 
47
        l.append(&pool, false, "WvHttpPool");
45
48
 
46
49
        WvStream *buf;
47
50
        WVPASS(buf = pool.addurl("http://www.google.com", "HEAD"));
48
51
        WVPASS(buf->isok());
49
52
        buf->autoforward(*wvcon);
50
53
        buf->setclosecallback(close_callback);
51
 
        l.append(buf, true);
 
54
        l.append(buf, true, "buf stream");
52
55
        while (buf->isok() && (wvcon->isok() || !pool.idle()))
53
56
        {
54
57
            if (l.select(-1))
142
145
           num_requests);
143
146
    WvHttpPool pool;
144
147
    WvIStreamList bufs;
145
 
    l.append(&pool, false);
146
 
    l.append(&bufs, false);
 
148
    l.append(&pool, false, "WvHttpPool");
 
149
    l.append(&bufs, false, "list of bufs");
147
150
 
148
151
    http_conns = 0;
149
152
    WvStream *buf;