xref: /aosp_15_r20/external/curl/lib/http.h (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker #ifndef HEADER_CURL_HTTP_H
2*6236dae4SAndroid Build Coastguard Worker #define HEADER_CURL_HTTP_H
3*6236dae4SAndroid Build Coastguard Worker /***************************************************************************
4*6236dae4SAndroid Build Coastguard Worker  *                                  _   _ ____  _
5*6236dae4SAndroid Build Coastguard Worker  *  Project                     ___| | | |  _ \| |
6*6236dae4SAndroid Build Coastguard Worker  *                             / __| | | | |_) | |
7*6236dae4SAndroid Build Coastguard Worker  *                            | (__| |_| |  _ <| |___
8*6236dae4SAndroid Build Coastguard Worker  *                             \___|\___/|_| \_\_____|
9*6236dae4SAndroid Build Coastguard Worker  *
10*6236dae4SAndroid Build Coastguard Worker  * Copyright (C) Daniel Stenberg, <[email protected]>, et al.
11*6236dae4SAndroid Build Coastguard Worker  *
12*6236dae4SAndroid Build Coastguard Worker  * This software is licensed as described in the file COPYING, which
13*6236dae4SAndroid Build Coastguard Worker  * you should have received as part of this distribution. The terms
14*6236dae4SAndroid Build Coastguard Worker  * are also available at https://curl.se/docs/copyright.html.
15*6236dae4SAndroid Build Coastguard Worker  *
16*6236dae4SAndroid Build Coastguard Worker  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17*6236dae4SAndroid Build Coastguard Worker  * copies of the Software, and permit persons to whom the Software is
18*6236dae4SAndroid Build Coastguard Worker  * furnished to do so, under the terms of the COPYING file.
19*6236dae4SAndroid Build Coastguard Worker  *
20*6236dae4SAndroid Build Coastguard Worker  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21*6236dae4SAndroid Build Coastguard Worker  * KIND, either express or implied.
22*6236dae4SAndroid Build Coastguard Worker  *
23*6236dae4SAndroid Build Coastguard Worker  * SPDX-License-Identifier: curl
24*6236dae4SAndroid Build Coastguard Worker  *
25*6236dae4SAndroid Build Coastguard Worker  ***************************************************************************/
26*6236dae4SAndroid Build Coastguard Worker #include "curl_setup.h"
27*6236dae4SAndroid Build Coastguard Worker 
28*6236dae4SAndroid Build Coastguard Worker #if defined(USE_MSH3) && !defined(_WIN32)
29*6236dae4SAndroid Build Coastguard Worker #include <pthread.h>
30*6236dae4SAndroid Build Coastguard Worker #endif
31*6236dae4SAndroid Build Coastguard Worker 
32*6236dae4SAndroid Build Coastguard Worker #include "bufq.h"
33*6236dae4SAndroid Build Coastguard Worker #include "dynhds.h"
34*6236dae4SAndroid Build Coastguard Worker #include "ws.h"
35*6236dae4SAndroid Build Coastguard Worker 
36*6236dae4SAndroid Build Coastguard Worker typedef enum {
37*6236dae4SAndroid Build Coastguard Worker   HTTPREQ_GET,
38*6236dae4SAndroid Build Coastguard Worker   HTTPREQ_POST,
39*6236dae4SAndroid Build Coastguard Worker   HTTPREQ_POST_FORM, /* we make a difference internally */
40*6236dae4SAndroid Build Coastguard Worker   HTTPREQ_POST_MIME, /* we make a difference internally */
41*6236dae4SAndroid Build Coastguard Worker   HTTPREQ_PUT,
42*6236dae4SAndroid Build Coastguard Worker   HTTPREQ_HEAD
43*6236dae4SAndroid Build Coastguard Worker } Curl_HttpReq;
44*6236dae4SAndroid Build Coastguard Worker 
45*6236dae4SAndroid Build Coastguard Worker #ifndef CURL_DISABLE_HTTP
46*6236dae4SAndroid Build Coastguard Worker 
47*6236dae4SAndroid Build Coastguard Worker #if defined(USE_HTTP3)
48*6236dae4SAndroid Build Coastguard Worker #include <stdint.h>
49*6236dae4SAndroid Build Coastguard Worker #endif
50*6236dae4SAndroid Build Coastguard Worker 
51*6236dae4SAndroid Build Coastguard Worker extern const struct Curl_handler Curl_handler_http;
52*6236dae4SAndroid Build Coastguard Worker 
53*6236dae4SAndroid Build Coastguard Worker #ifdef USE_SSL
54*6236dae4SAndroid Build Coastguard Worker extern const struct Curl_handler Curl_handler_https;
55*6236dae4SAndroid Build Coastguard Worker #endif
56*6236dae4SAndroid Build Coastguard Worker 
57*6236dae4SAndroid Build Coastguard Worker struct dynhds;
58*6236dae4SAndroid Build Coastguard Worker 
59*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_bump_headersize(struct Curl_easy *data,
60*6236dae4SAndroid Build Coastguard Worker                               size_t delta,
61*6236dae4SAndroid Build Coastguard Worker                               bool connect_only);
62*6236dae4SAndroid Build Coastguard Worker 
63*6236dae4SAndroid Build Coastguard Worker /* Header specific functions */
64*6236dae4SAndroid Build Coastguard Worker bool Curl_compareheader(const char *headerline,  /* line to check */
65*6236dae4SAndroid Build Coastguard Worker                         const char *header,   /* header keyword _with_ colon */
66*6236dae4SAndroid Build Coastguard Worker                         const size_t hlen,   /* len of the keyword in bytes */
67*6236dae4SAndroid Build Coastguard Worker                         const char *content, /* content string to find */
68*6236dae4SAndroid Build Coastguard Worker                         const size_t clen);   /* len of the content in bytes */
69*6236dae4SAndroid Build Coastguard Worker 
70*6236dae4SAndroid Build Coastguard Worker char *Curl_copy_header_value(const char *header);
71*6236dae4SAndroid Build Coastguard Worker 
72*6236dae4SAndroid Build Coastguard Worker char *Curl_checkProxyheaders(struct Curl_easy *data,
73*6236dae4SAndroid Build Coastguard Worker                              const struct connectdata *conn,
74*6236dae4SAndroid Build Coastguard Worker                              const char *thisheader,
75*6236dae4SAndroid Build Coastguard Worker                              const size_t thislen);
76*6236dae4SAndroid Build Coastguard Worker 
77*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_add_timecondition(struct Curl_easy *data,
78*6236dae4SAndroid Build Coastguard Worker #ifndef USE_HYPER
79*6236dae4SAndroid Build Coastguard Worker                                 struct dynbuf *req
80*6236dae4SAndroid Build Coastguard Worker #else
81*6236dae4SAndroid Build Coastguard Worker                                 void *headers
82*6236dae4SAndroid Build Coastguard Worker #endif
83*6236dae4SAndroid Build Coastguard Worker   );
84*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_add_custom_headers(struct Curl_easy *data,
85*6236dae4SAndroid Build Coastguard Worker                                  bool is_connect,
86*6236dae4SAndroid Build Coastguard Worker #ifndef USE_HYPER
87*6236dae4SAndroid Build Coastguard Worker                                  struct dynbuf *req
88*6236dae4SAndroid Build Coastguard Worker #else
89*6236dae4SAndroid Build Coastguard Worker                                  void *headers
90*6236dae4SAndroid Build Coastguard Worker #endif
91*6236dae4SAndroid Build Coastguard Worker   );
92*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_dynhds_add_custom(struct Curl_easy *data,
93*6236dae4SAndroid Build Coastguard Worker                                 bool is_connect,
94*6236dae4SAndroid Build Coastguard Worker                                 struct dynhds *hds);
95*6236dae4SAndroid Build Coastguard Worker 
96*6236dae4SAndroid Build Coastguard Worker void Curl_http_method(struct Curl_easy *data, struct connectdata *conn,
97*6236dae4SAndroid Build Coastguard Worker                       const char **method, Curl_HttpReq *);
98*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_useragent(struct Curl_easy *data);
99*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_host(struct Curl_easy *data, struct connectdata *conn);
100*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_target(struct Curl_easy *data, struct connectdata *conn,
101*6236dae4SAndroid Build Coastguard Worker                           struct dynbuf *req);
102*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_statusline(struct Curl_easy *data,
103*6236dae4SAndroid Build Coastguard Worker                               struct connectdata *conn);
104*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_header(struct Curl_easy *data,
105*6236dae4SAndroid Build Coastguard Worker                           const char *hd, size_t hdlen);
106*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_transferencode(struct Curl_easy *data);
107*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_req_set_reader(struct Curl_easy *data,
108*6236dae4SAndroid Build Coastguard Worker                                   Curl_HttpReq httpreq,
109*6236dae4SAndroid Build Coastguard Worker                                   const char **tep);
110*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_req_complete(struct Curl_easy *data,
111*6236dae4SAndroid Build Coastguard Worker                                 struct dynbuf *r, Curl_HttpReq httpreq);
112*6236dae4SAndroid Build Coastguard Worker bool Curl_use_http_1_1plus(const struct Curl_easy *data,
113*6236dae4SAndroid Build Coastguard Worker                            const struct connectdata *conn);
114*6236dae4SAndroid Build Coastguard Worker #ifndef CURL_DISABLE_COOKIES
115*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_cookies(struct Curl_easy *data,
116*6236dae4SAndroid Build Coastguard Worker                            struct connectdata *conn,
117*6236dae4SAndroid Build Coastguard Worker                            struct dynbuf *r);
118*6236dae4SAndroid Build Coastguard Worker #else
119*6236dae4SAndroid Build Coastguard Worker #define Curl_http_cookies(a,b,c) CURLE_OK
120*6236dae4SAndroid Build Coastguard Worker #endif
121*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_range(struct Curl_easy *data,
122*6236dae4SAndroid Build Coastguard Worker                          Curl_HttpReq httpreq);
123*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_firstwrite(struct Curl_easy *data);
124*6236dae4SAndroid Build Coastguard Worker 
125*6236dae4SAndroid Build Coastguard Worker /* protocol-specific functions set up to be called by the main engine */
126*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_setup_conn(struct Curl_easy *data,
127*6236dae4SAndroid Build Coastguard Worker                               struct connectdata *conn);
128*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http(struct Curl_easy *data, bool *done);
129*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_done(struct Curl_easy *data, CURLcode, bool premature);
130*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_connect(struct Curl_easy *data, bool *done);
131*6236dae4SAndroid Build Coastguard Worker int Curl_http_getsock_do(struct Curl_easy *data, struct connectdata *conn,
132*6236dae4SAndroid Build Coastguard Worker                          curl_socket_t *socks);
133*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_write_resp(struct Curl_easy *data,
134*6236dae4SAndroid Build Coastguard Worker                               const char *buf, size_t blen,
135*6236dae4SAndroid Build Coastguard Worker                               bool is_eos);
136*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_write_resp_hd(struct Curl_easy *data,
137*6236dae4SAndroid Build Coastguard Worker                                  const char *hd, size_t hdlen,
138*6236dae4SAndroid Build Coastguard Worker                                  bool is_eos);
139*6236dae4SAndroid Build Coastguard Worker 
140*6236dae4SAndroid Build Coastguard Worker /* These functions are in http.c */
141*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy,
142*6236dae4SAndroid Build Coastguard Worker                               const char *auth);
143*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_auth_act(struct Curl_easy *data);
144*6236dae4SAndroid Build Coastguard Worker 
145*6236dae4SAndroid Build Coastguard Worker /* If only the PICKNONE bit is set, there has been a round-trip and we
146*6236dae4SAndroid Build Coastguard Worker    selected to use no auth at all. Ie, we actively select no auth, as opposed
147*6236dae4SAndroid Build Coastguard Worker    to not having one selected. The other CURLAUTH_* defines are present in the
148*6236dae4SAndroid Build Coastguard Worker    public curl/curl.h header. */
149*6236dae4SAndroid Build Coastguard Worker #define CURLAUTH_PICKNONE (1<<30) /* do not use auth */
150*6236dae4SAndroid Build Coastguard Worker 
151*6236dae4SAndroid Build Coastguard Worker /* MAX_INITIAL_POST_SIZE indicates the number of bytes that will make the POST
152*6236dae4SAndroid Build Coastguard Worker    data get included in the initial data chunk sent to the server. If the
153*6236dae4SAndroid Build Coastguard Worker    data is larger than this, it will automatically get split up in multiple
154*6236dae4SAndroid Build Coastguard Worker    system calls.
155*6236dae4SAndroid Build Coastguard Worker 
156*6236dae4SAndroid Build Coastguard Worker    This value used to be fairly big (100K), but we must take into account that
157*6236dae4SAndroid Build Coastguard Worker    if the server rejects the POST due for authentication reasons, this data
158*6236dae4SAndroid Build Coastguard Worker    will always be unconditionally sent and thus it may not be larger than can
159*6236dae4SAndroid Build Coastguard Worker    always be afforded to send twice.
160*6236dae4SAndroid Build Coastguard Worker 
161*6236dae4SAndroid Build Coastguard Worker    It must not be greater than 64K to work on VMS.
162*6236dae4SAndroid Build Coastguard Worker */
163*6236dae4SAndroid Build Coastguard Worker #ifndef MAX_INITIAL_POST_SIZE
164*6236dae4SAndroid Build Coastguard Worker #define MAX_INITIAL_POST_SIZE (64*1024)
165*6236dae4SAndroid Build Coastguard Worker #endif
166*6236dae4SAndroid Build Coastguard Worker 
167*6236dae4SAndroid Build Coastguard Worker /* EXPECT_100_THRESHOLD is the request body size limit for when libcurl will
168*6236dae4SAndroid Build Coastguard Worker  * automatically add an "Expect: 100-continue" header in HTTP requests. When
169*6236dae4SAndroid Build Coastguard Worker  * the size is unknown, it will always add it.
170*6236dae4SAndroid Build Coastguard Worker  *
171*6236dae4SAndroid Build Coastguard Worker  */
172*6236dae4SAndroid Build Coastguard Worker #ifndef EXPECT_100_THRESHOLD
173*6236dae4SAndroid Build Coastguard Worker #define EXPECT_100_THRESHOLD (1024*1024)
174*6236dae4SAndroid Build Coastguard Worker #endif
175*6236dae4SAndroid Build Coastguard Worker 
176*6236dae4SAndroid Build Coastguard Worker /* MAX_HTTP_RESP_HEADER_SIZE is the maximum size of all response headers
177*6236dae4SAndroid Build Coastguard Worker    combined that libcurl allows for a single HTTP response, any HTTP
178*6236dae4SAndroid Build Coastguard Worker    version. This count includes CONNECT response headers. */
179*6236dae4SAndroid Build Coastguard Worker #define MAX_HTTP_RESP_HEADER_SIZE (300*1024)
180*6236dae4SAndroid Build Coastguard Worker 
181*6236dae4SAndroid Build Coastguard Worker bool Curl_http_exp100_is_selected(struct Curl_easy *data);
182*6236dae4SAndroid Build Coastguard Worker void Curl_http_exp100_got100(struct Curl_easy *data);
183*6236dae4SAndroid Build Coastguard Worker 
184*6236dae4SAndroid Build Coastguard Worker #endif /* CURL_DISABLE_HTTP */
185*6236dae4SAndroid Build Coastguard Worker 
186*6236dae4SAndroid Build Coastguard Worker /****************************************************************************
187*6236dae4SAndroid Build Coastguard Worker  * HTTP unique setup
188*6236dae4SAndroid Build Coastguard Worker  ***************************************************************************/
189*6236dae4SAndroid Build Coastguard Worker 
190*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_size(struct Curl_easy *data);
191*6236dae4SAndroid Build Coastguard Worker 
192*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_write_resp_hds(struct Curl_easy *data,
193*6236dae4SAndroid Build Coastguard Worker                                   const char *buf, size_t blen,
194*6236dae4SAndroid Build Coastguard Worker                                   size_t *pconsumed);
195*6236dae4SAndroid Build Coastguard Worker 
196*6236dae4SAndroid Build Coastguard Worker /**
197*6236dae4SAndroid Build Coastguard Worker  * Curl_http_output_auth() setups the authentication headers for the
198*6236dae4SAndroid Build Coastguard Worker  * host/proxy and the correct authentication
199*6236dae4SAndroid Build Coastguard Worker  * method. data->state.authdone is set to TRUE when authentication is
200*6236dae4SAndroid Build Coastguard Worker  * done.
201*6236dae4SAndroid Build Coastguard Worker  *
202*6236dae4SAndroid Build Coastguard Worker  * @param data all information about the current transfer
203*6236dae4SAndroid Build Coastguard Worker  * @param conn all information about the current connection
204*6236dae4SAndroid Build Coastguard Worker  * @param request pointer to the request keyword
205*6236dae4SAndroid Build Coastguard Worker  * @param httpreq is the request type
206*6236dae4SAndroid Build Coastguard Worker  * @param path pointer to the requested path
207*6236dae4SAndroid Build Coastguard Worker  * @param proxytunnel boolean if this is the request setting up a "proxy
208*6236dae4SAndroid Build Coastguard Worker  * tunnel"
209*6236dae4SAndroid Build Coastguard Worker  *
210*6236dae4SAndroid Build Coastguard Worker  * @returns CURLcode
211*6236dae4SAndroid Build Coastguard Worker  */
212*6236dae4SAndroid Build Coastguard Worker CURLcode
213*6236dae4SAndroid Build Coastguard Worker Curl_http_output_auth(struct Curl_easy *data,
214*6236dae4SAndroid Build Coastguard Worker                       struct connectdata *conn,
215*6236dae4SAndroid Build Coastguard Worker                       const char *request,
216*6236dae4SAndroid Build Coastguard Worker                       Curl_HttpReq httpreq,
217*6236dae4SAndroid Build Coastguard Worker                       const char *path,
218*6236dae4SAndroid Build Coastguard Worker                       bool proxytunnel); /* TRUE if this is the request setting
219*6236dae4SAndroid Build Coastguard Worker                                             up the proxy tunnel */
220*6236dae4SAndroid Build Coastguard Worker 
221*6236dae4SAndroid Build Coastguard Worker /* Decode HTTP status code string. */
222*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_decode_status(int *pstatus, const char *s, size_t len);
223*6236dae4SAndroid Build Coastguard Worker 
224*6236dae4SAndroid Build Coastguard Worker 
225*6236dae4SAndroid Build Coastguard Worker /**
226*6236dae4SAndroid Build Coastguard Worker  * All about a core HTTP request, excluding body and trailers
227*6236dae4SAndroid Build Coastguard Worker  */
228*6236dae4SAndroid Build Coastguard Worker struct httpreq {
229*6236dae4SAndroid Build Coastguard Worker   char method[24];
230*6236dae4SAndroid Build Coastguard Worker   char *scheme;
231*6236dae4SAndroid Build Coastguard Worker   char *authority;
232*6236dae4SAndroid Build Coastguard Worker   char *path;
233*6236dae4SAndroid Build Coastguard Worker   struct dynhds headers;
234*6236dae4SAndroid Build Coastguard Worker   struct dynhds trailers;
235*6236dae4SAndroid Build Coastguard Worker };
236*6236dae4SAndroid Build Coastguard Worker 
237*6236dae4SAndroid Build Coastguard Worker /**
238*6236dae4SAndroid Build Coastguard Worker  * Create an HTTP request struct.
239*6236dae4SAndroid Build Coastguard Worker  */
240*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_req_make(struct httpreq **preq,
241*6236dae4SAndroid Build Coastguard Worker                             const char *method, size_t m_len,
242*6236dae4SAndroid Build Coastguard Worker                             const char *scheme, size_t s_len,
243*6236dae4SAndroid Build Coastguard Worker                             const char *authority, size_t a_len,
244*6236dae4SAndroid Build Coastguard Worker                             const char *path, size_t p_len);
245*6236dae4SAndroid Build Coastguard Worker 
246*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_req_make2(struct httpreq **preq,
247*6236dae4SAndroid Build Coastguard Worker                              const char *method, size_t m_len,
248*6236dae4SAndroid Build Coastguard Worker                              CURLU *url, const char *scheme_default);
249*6236dae4SAndroid Build Coastguard Worker 
250*6236dae4SAndroid Build Coastguard Worker void Curl_http_req_free(struct httpreq *req);
251*6236dae4SAndroid Build Coastguard Worker 
252*6236dae4SAndroid Build Coastguard Worker #define HTTP_PSEUDO_METHOD ":method"
253*6236dae4SAndroid Build Coastguard Worker #define HTTP_PSEUDO_SCHEME ":scheme"
254*6236dae4SAndroid Build Coastguard Worker #define HTTP_PSEUDO_AUTHORITY ":authority"
255*6236dae4SAndroid Build Coastguard Worker #define HTTP_PSEUDO_PATH ":path"
256*6236dae4SAndroid Build Coastguard Worker #define HTTP_PSEUDO_STATUS ":status"
257*6236dae4SAndroid Build Coastguard Worker 
258*6236dae4SAndroid Build Coastguard Worker /**
259*6236dae4SAndroid Build Coastguard Worker  * Create the list of HTTP/2 headers which represent the request,
260*6236dae4SAndroid Build Coastguard Worker  * using HTTP/2 pseudo headers preceding the `req->headers`.
261*6236dae4SAndroid Build Coastguard Worker  *
262*6236dae4SAndroid Build Coastguard Worker  * Applies the following transformations:
263*6236dae4SAndroid Build Coastguard Worker  * - if `authority` is set, any "Host" header is removed.
264*6236dae4SAndroid Build Coastguard Worker  * - if `authority` is unset and a "Host" header is present, use
265*6236dae4SAndroid Build Coastguard Worker  *   that as `authority` and remove "Host"
266*6236dae4SAndroid Build Coastguard Worker  * - removes and Connection header fields as defined in rfc9113 ch. 8.2.2
267*6236dae4SAndroid Build Coastguard Worker  * - lower-cases the header field names
268*6236dae4SAndroid Build Coastguard Worker  *
269*6236dae4SAndroid Build Coastguard Worker  * @param h2_headers will contain the HTTP/2 headers on success
270*6236dae4SAndroid Build Coastguard Worker  * @param req        the request to transform
271*6236dae4SAndroid Build Coastguard Worker  * @param data       the handle to lookup defaults like ' :scheme' from
272*6236dae4SAndroid Build Coastguard Worker  */
273*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_req_to_h2(struct dynhds *h2_headers,
274*6236dae4SAndroid Build Coastguard Worker                              struct httpreq *req, struct Curl_easy *data);
275*6236dae4SAndroid Build Coastguard Worker 
276*6236dae4SAndroid Build Coastguard Worker /**
277*6236dae4SAndroid Build Coastguard Worker  * All about a core HTTP response, excluding body and trailers
278*6236dae4SAndroid Build Coastguard Worker  */
279*6236dae4SAndroid Build Coastguard Worker struct http_resp {
280*6236dae4SAndroid Build Coastguard Worker   int status;
281*6236dae4SAndroid Build Coastguard Worker   char *description;
282*6236dae4SAndroid Build Coastguard Worker   struct dynhds headers;
283*6236dae4SAndroid Build Coastguard Worker   struct dynhds trailers;
284*6236dae4SAndroid Build Coastguard Worker   struct http_resp *prev;
285*6236dae4SAndroid Build Coastguard Worker };
286*6236dae4SAndroid Build Coastguard Worker 
287*6236dae4SAndroid Build Coastguard Worker /**
288*6236dae4SAndroid Build Coastguard Worker  * Create an HTTP response struct.
289*6236dae4SAndroid Build Coastguard Worker  */
290*6236dae4SAndroid Build Coastguard Worker CURLcode Curl_http_resp_make(struct http_resp **presp,
291*6236dae4SAndroid Build Coastguard Worker                              int status,
292*6236dae4SAndroid Build Coastguard Worker                              const char *description);
293*6236dae4SAndroid Build Coastguard Worker 
294*6236dae4SAndroid Build Coastguard Worker void Curl_http_resp_free(struct http_resp *resp);
295*6236dae4SAndroid Build Coastguard Worker 
296*6236dae4SAndroid Build Coastguard Worker #endif /* HEADER_CURL_HTTP_H */
297