*** empty log message ***
[mmondor.git] / tests / bktr_httpd / client.c
CommitLineData
ce436d0b
MM
1/* $Id: client.c,v 1.1 2008/01/19 00:29:02 mmondor Exp $ */
2
3/*
4 * Copyright (c) 2008, Matthew Mondor
5 * ALL RIGHTS RESERVED.
6 */
7
8
9#include <stdlib.h>
10
11#include "client.h"
12
13
14static pool_t client_pool;
15
16
17bool
18client_init(void)
19{
20
21 if (!pool_init(&client_pool, "client_pool", malloc, free, NULL, NULL,
22 sizeof(client_t), 65536 / sizeof(client_t), 1, 0))
23 return false;
24
25 return true;
26}
27
28client_t *
29client_new(void)
30{
31 client_t *c;
32
33 if ((c = (client_t *)pool_alloc(&client_pool, false)) != NULL) {
34 DLIST_INIT(&c->sendq);
35 c->first = true;
36 c->skip = 0;
37 }
38
39 return c;
40}
41
42void
43client_destroy(client_t *c)
44{
45
46 (void) pool_free((pnode_t *)c);
47}