File: wvhttpcomponent.cc

package info (click to toggle)
wvstreams 4.6.1-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,420 kB
  • sloc: cpp: 64,196; ansic: 4,154; sh: 4,025; makefile: 546; perl: 402
file content (40 lines) | stat: -rw-r--r-- 826 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * Worldvisions Weaver Software:
 *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
 * 
 * Componentization stuff for wvhttppool.h.  Constitutes cheating.
 */
#include "wvhttppool.h"
#include "wvmoniker.h"
#include "wvistreamlist.h"

static WvHttpPool *pool;


static void pool_init()
{
    // FIXME: we never free it!
    if (!pool)
    {
	pool = new WvHttpPool;
	WvIStreamList::globallist.append(pool, false, "pool_init urlpool");
    }
}


static IWvStream *creator(WvStringParm s, IObject*)
{
    pool_init();
    return pool->addurl(WvString("http:%s", s), "GET");
}


static IWvStream *screator(WvStringParm s, IObject*)
{
    pool_init();
    return pool->addurl(WvString("https:%s", s), "GET");
}


static WvMoniker<IWvStream> reg("http", creator);
static WvMoniker<IWvStream> regs("https", screator);