proxy_http_int.h revision df7881f07f53b041dc0568be8528e9dbb74994cc
1/* Copyright (C) 2007-2008 The Android Open Source Project
2**
3** This software is licensed under the terms of the GNU General Public
4** License version 2, as published by the Free Software Foundation, and
5** may be copied, distributed, and modified under those terms.
6**
7** This program is distributed in the hope that it will be useful,
8** but WITHOUT ANY WARRANTY; without even the implied warranty of
9** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10** GNU General Public License for more details.
11*/
12#ifndef _PROXY_HTTP_INT_H
13#define _PROXY_HTTP_INT_H
14
15#include "proxy_http.h"
16#include "proxy_int.h"
17
18/* the HttpService object */
19typedef struct HttpService {
20    ProxyService        root[1];
21    struct sockaddr_in  server_addr;  /* server address and port */
22    char*               footer;      /* the footer contains the static parts of the */
23    int                 footer_len;  /* connection header, we generate it only once */
24    char                footer0[512];
25} HttpService;
26
27/* create a CONNECT connection (for port != 80) */
28extern ProxyConnection*  http_connector_connect(
29                                HttpService*         service,
30                                struct sockaddr_in*  address );
31
32/* create a HTTP rewriting connection (for port == 80) */
33extern ProxyConnection*  http_rewriter_connect(
34                                HttpService*         service,
35                                struct sockaddr_in*  address );
36
37
38#endif /* _PROXY_HTTP_INT_H */
39