source: trunk/third/libghttp/http_trans.h @ 15592

Revision 15592, 2.9 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15591, which included commits to RCS files with non-trunk default branches.
RevLine 
[15591]1/*
2 * http_trans.h -- This file contains definitions for http transport functions
3 * Created: Christopher Blizzard <blizzard@appliedtheory.com>, 5-Aug-1998
4 *
5 * Copyright (C) 1998 Free Software Foundation
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the Free
19 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#ifndef HTTP_TRANS_H
23#define HTTP_TRANS_H
24
25#include <sys/types.h>
26#include <sys/socket.h>
27#include <netinet/in.h>
28#include <netdb.h>
29
30typedef enum http_trans_err_type_tag {
31  http_trans_err_type_host = 0,
32  http_trans_err_type_errno
33} http_trans_err_type;
34
35typedef struct http_trans_conn_tag {
36  struct hostent      *hostinfo;
37  struct sockaddr_in   saddr;
38  char                *host;
39  char                *proxy_host;
40  int                  sock;
41  short                port;
42  short                proxy_port;
43  http_trans_err_type  error_type;
44  int                  error;
45  int                  sync;              /* sync or async? */
46  char                *io_buf;            /* buffer */
47  int                  io_buf_len;        /* how big is it? */
48  int                  io_buf_alloc;      /* how much is used */
49  int                  io_buf_io_done;    /* how much have we already moved? */
50  int                  io_buf_io_left;    /* how much data do we have left? */
51  int                  io_buf_chunksize;  /* how big should the chunks be that get
52                                            read in and out be? */
53  int                  last_read;         /* the size of the last read */
54  int                  chunk_len;         /* length of a chunk. */
55  char                *errstr;            /* a hint as to an error */
56} http_trans_conn;
57
58http_trans_conn *
59http_trans_conn_new(void);
60
61void
62http_trans_conn_destroy(http_trans_conn *a_conn);
63
64void
65http_trans_buf_reset(http_trans_conn *a_conn);
66
67void
68http_trans_buf_clip(http_trans_conn *a_conn, char *a_clip_to);
69
70int
71http_trans_connect(http_trans_conn *a_conn);
72
73const char *
74http_trans_get_host_error(int a_herror);
75
76int
77http_trans_append_data_to_buf(http_trans_conn *a_conn,
78                              char *a_data,
79                              int a_data_len);
80
81int
82http_trans_read_into_buf(http_trans_conn *a_conn);
83
84int
85http_trans_write_buf(http_trans_conn *a_conn);
86
87char *
88http_trans_buf_has_patt(char *a_buf, int a_len,
89                        char *a_pat, int a_patlen);
90
91#endif /* HTTP_TRANS_H */
Note: See TracBrowser for help on using the repository browser.