1 #ifndef __HTTP_H
2 #define __HTTP_H
3 
4 /***************************************************************************
5  *                                  _   _ ____  _
6  *  Project                     ___| | | |  _ \| |
7  *                             / __| | | | |_) | |
8  *                            | (__| |_| |  _ <| |___
9  *                             \___|\___/|_| \_\_____|
10  *
11  * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
12  *
13  * This software is licensed as described in the file COPYING, which
14  * you should have received as part of this distribution. The terms
15  * are also available at http://curl.haxx.se/docs/copyright.html.
16  *
17  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
18  * copies of the Software, and permit persons to whom the Software is
19  * furnished to do so, under the terms of the COPYING file.
20  *
21  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
22  * KIND, either express or implied.
23  *
24  * $Id: http.h,v 1.38 2008-08-04 22:00:22 bagder Exp $
25  ***************************************************************************/
26 #ifndef CURL_DISABLE_HTTP
27 
28 extern const struct Curl_handler Curl_handler_http;
29 
30 #ifdef USE_SSL
31 extern const struct Curl_handler Curl_handler_https;
32 #endif
33 
34 bool Curl_compareheader(const char *headerline,  /* line to check */
35                         const char *header,   /* header keyword _with_ colon */
36                         const char *content); /* content string to find */
37 
38 char *Curl_copy_header_value(const char *h);
39 
40 /* ftp can use this as well */
41 CURLcode Curl_proxyCONNECT(struct connectdata *conn,
42                            int tunnelsocket,
43                            const char *hostname, unsigned short remote_port);
44 
45 /* protocol-specific functions set up to be called by the main engine */
46 CURLcode Curl_http(struct connectdata *conn, bool *done);
47 CURLcode Curl_http_done(struct connectdata *, CURLcode, bool premature);
48 CURLcode Curl_http_connect(struct connectdata *conn, bool *done);
49 
50 /* The following functions are defined in http_chunks.c */
51 void Curl_httpchunk_init(struct connectdata *conn);
52 CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap,
53                               ssize_t length, ssize_t *wrote);
54 
55 /* These functions are in http.c */
56 void Curl_http_auth_stage(struct SessionHandle *data, int stage);
57 CURLcode Curl_http_input_auth(struct connectdata *conn,
58                               int httpcode, const char *header);
59 CURLcode Curl_http_auth_act(struct connectdata *conn);
60 CURLcode Curl_http_perhapsrewind(struct connectdata *conn);
61 
62 int Curl_http_should_fail(struct connectdata *conn);
63 
64 /* If only the PICKNONE bit is set, there has been a round-trip and we
65    selected to use no auth at all. Ie, we actively select no auth, as opposed
66    to not having one selected. The other CURLAUTH_* defines are present in the
67    public curl/curl.h header. */
68 #define CURLAUTH_PICKNONE (1<<30) /* don't use auth */
69 
70 /* MAX_INITIAL_POST_SIZE indicates the number of bytes that will make the POST
71    data get included in the initial data chunk sent to the server. If the
72    data is larger than this, it will automatically get split up in multiple
73    system calls.
74 
75    This value used to be fairly big (100K), but we must take into account that
76    if the server rejects the POST due for authentication reasons, this data
77    will always be uncondtionally sent and thus it may not be larger than can
78    always be afforded to send twice.
79 
80    It must not be greater than 64K to work on VMS.
81 */
82 #ifndef MAX_INITIAL_POST_SIZE
83 #define MAX_INITIAL_POST_SIZE (64*1024)
84 #endif
85 
86 #ifndef TINY_INITIAL_POST_SIZE
87 #define TINY_INITIAL_POST_SIZE 1024
88 #endif
89 
90 #endif
91 #endif
92