summaryrefslogtreecommitdiff
path: root/libsoup/soup-private.h
blob: be3b7f4ee02a75484bd23b00ae66e702ee1ec8c5 (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * soup-queue.h: Asyncronous Callback-based SOAP Request Queue.
 *
 * Authors:
 *      Alex Graveley (alex@helixcode.com)
 *
 * Copyright (C) 2000, Helix Code, Inc.
 */

/* 
 * All the things SOUP users shouldn't need to know about except under
 * extraneous circumstances.
 */

#ifndef  SOAP_PRIVATE_H
#define  SOAP_PRIVATE_H 1

#include "soup-queue.h"

#define DEFAULT_CHUNK_SIZE  1024
#define RESPONSE_BLOCK_SIZE 1024

typedef struct {
	guint       port;
	gboolean    in_use;
	GTcpSocket *socket;
} SoupConnection;

typedef struct {
	gchar      *host;
	GSList     *connections;  /* CONTAINS: SoupConnection */
	GHashTable *contexts;     /* KEY: uri->path, VALUE: SoupContext */
} SoupServer;

extern GHashTable *servers;
extern guint connection_count;
extern GList *active_requests;

struct _SoupContextPrivate {
	SoupServer *server;

	gboolean    keep_alive;
	gint        chunk_size;
};

struct _SoupRequestPrivate {
	GTcpSocket *socket;

	gulong write_len;
	gulong read_len;

	guint connect_tag;
	guint read_tag;
	guint write_tag;
	guint timeout_tag;

	SoupCallbackFn callback;
	gpointer user_data;
};

SoupCallbackResult soup_request_issue_callback (SoupRequest   *req, 
						SoupErrorCode  error);

#endif /*SOUP_PRIVATE_H*/