~ubuntu-branches/debian/wheezy/haproxy/wheezy

« back to all changes in this revision

Viewing changes to include/proto/proto_http.h

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Cornet
  • Date: 2010-04-15 20:00:34 UTC
  • mfrom: (1.1.8 upstream) (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100415200034-is2r38tyvmtvi3ml
Tags: 1.4.4-1
* New upstream release
* Add splice and tproxy support
* Add regparm optimization on i386
* Switch to dpkg-source 3.0 (quilt) format

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
  include/proto/proto_http.h
3
 
  This file contains HTTP protocol definitions.
4
 
 
5
 
  Copyright (C) 2000-2008 Willy Tarreau - w@1wt.eu
6
 
 
7
 
  This library is free software; you can redistribute it and/or
8
 
  modify it under the terms of the GNU Lesser General Public
9
 
  License as published by the Free Software Foundation, version 2.1
10
 
  exclusively.
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
 
  Lesser General Public License for more details.
16
 
 
17
 
  You should have received a copy of the GNU Lesser General Public
18
 
  License along with this library; if not, write to the Free Software
19
 
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20
 
*/
 
2
 * include/proto/proto_http.h
 
3
 * This file contains HTTP protocol definitions.
 
4
 *
 
5
 * Copyright (C) 2000-2010 Willy Tarreau - w@1wt.eu
 
6
 *
 
7
 * This library is free software; you can redistribute it and/or
 
8
 * modify it under the terms of the GNU Lesser General Public
 
9
 * License as published by the Free Software Foundation, version 2.1
 
10
 * exclusively.
 
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
 * Lesser General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU Lesser General Public
 
18
 * License along with this library; if not, write to the Free Software
 
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
20
 */
21
21
 
22
22
#ifndef _PROTO_PROTO_HTTP_H
23
23
#define _PROTO_PROTO_HTTP_H
61
61
int process_cli(struct session *t);
62
62
int process_srv_data(struct session *t);
63
63
int process_srv_conn(struct session *t);
64
 
int http_process_request(struct session *t, struct buffer *req);
65
 
int http_process_tarpit(struct session *s, struct buffer *req);
66
 
int http_process_request_body(struct session *s, struct buffer *req);
67
 
int process_response(struct session *t);
 
64
int http_wait_for_request(struct session *s, struct buffer *req, int an_bit);
 
65
int http_process_req_common(struct session *s, struct buffer *req, int an_bit, struct proxy *px);
 
66
int http_process_request(struct session *t, struct buffer *req, int an_bit);
 
67
int http_process_tarpit(struct session *s, struct buffer *req, int an_bit);
 
68
int http_process_request_body(struct session *s, struct buffer *req, int an_bit);
 
69
int http_wait_for_response(struct session *s, struct buffer *rep, int an_bit);
 
70
int http_process_res_common(struct session *t, struct buffer *rep, int an_bit, struct proxy *px);
 
71
int http_request_forward_body(struct session *s, struct buffer *req, int an_bit);
 
72
int http_response_forward_body(struct session *s, struct buffer *res, int an_bit);
68
73
 
69
 
void produce_content(struct session *s, struct buffer *rep);
70
 
int produce_content_stats(struct session *s);
71
 
int produce_content_stats_proxy(struct session *s, struct proxy *px);
72
74
void debug_hdr(const char *dir, struct session *t, const char *start, const char *end);
73
75
void get_srv_from_appsession(struct session *t, const char *begin, int len);
74
76
int apply_filter_to_req_headers(struct session *t, struct buffer *req, struct hdr_exp *exp);
75
77
int apply_filter_to_req_line(struct session *t, struct buffer *req, struct hdr_exp *exp);
76
 
int apply_filters_to_request(struct session *t, struct buffer *req, struct hdr_exp *exp);
77
 
int apply_filters_to_response(struct session *t, struct buffer *rtr, struct hdr_exp *exp);
 
78
int apply_filters_to_request(struct session *s, struct buffer *req, struct proxy *px);
 
79
int apply_filters_to_response(struct session *t, struct buffer *rtr, struct proxy *px);
 
80
void manage_client_side_appsession(struct session *t, const char *buf, int len);
78
81
void manage_client_side_cookies(struct session *t, struct buffer *req);
79
82
void manage_server_side_cookies(struct session *t, struct buffer *rtr);
80
83
void check_response_for_cacheability(struct session *t, struct buffer *rtr);
81
 
int stats_check_uri_auth(struct session *t, struct proxy *backend);
 
84
int stats_check_uri(struct session *s, struct proxy *backend);
82
85
void init_proto_http();
83
86
int http_find_header2(const char *name, int len,
84
 
                      const char *sol, struct hdr_idx *idx,
 
87
                      char *sol, struct hdr_idx *idx,
85
88
                      struct hdr_ctx *ctx);
86
89
void http_sess_log(struct session *s);
87
90
void perform_http_redirect(struct session *s, struct stream_interface *si);
89
92
void http_capture_bad_message(struct error_snapshot *es, struct session *s,
90
93
                              struct buffer *buf, struct http_msg *msg,
91
94
                              struct proxy *other_end);
 
95
unsigned int get_ip_from_hdr2(struct http_msg *msg, const char *hname, int hlen,
 
96
                              struct hdr_idx *idx, int occ);
 
97
 
 
98
void http_init_txn(struct session *s);
 
99
void http_end_txn(struct session *s);
 
100
void http_reset_txn(struct session *s);
 
101
 
 
102
/* to be used when contents change in an HTTP message */
 
103
#define http_msg_move_end(msg, bytes) do { \
 
104
                unsigned int _bytes = (bytes);  \
 
105
                (msg)->col += (_bytes);         \
 
106
                (msg)->sov += (_bytes);         \
 
107
                (msg)->eoh += (_bytes);         \
 
108
        } while (0)
92
109
 
93
110
#endif /* _PROTO_PROTO_HTTP_H */
94
111