Apache2
md_http.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef mod_md_md_http_h
18 #define mod_md_md_http_h
19 
20 struct apr_table_t;
21 struct apr_bucket_brigade;
22 struct apr_bucket_alloc_t;
23 struct md_data_t;
24 
25 typedef struct md_http_t md_http_t;
26 
29 
36 
40 typedef apr_status_t md_http_response_cb(const md_http_response_t *res, void *data);
41 
48 };
49 
56 };
57 
61  int id;
63  const char *method;
64  const char *url;
65  const char *user_agent;
66  const char *proxy_url;
67  const char *ca_file;
74  void *internals;
75 };
76 
79  int status;
82 };
83 
84 apr_status_t md_http_create(md_http_t **phttp, apr_pool_t *p, const char *user_agent,
85  const char *proxy_url);
86 
87 void md_http_set_response_limit(md_http_t *http, apr_off_t resp_limit);
88 
97 
104 
110 void md_http_set_stalling_default(md_http_t *http, long bytes_per_sec, apr_time_t timeout);
111 void md_http_set_stalling(md_http_request_t *req, long bytes_per_sec, apr_time_t timeout);
112 
118 void md_http_set_ca_file(md_http_t *http, const char *ca_file);
119 
125 
133 
143 
152  struct apr_table_t *headers);
153 
162  struct apr_table_t *headers);
163 
175  struct apr_table_t *headers, const char *content_type,
176  struct apr_bucket_brigade *body, int detect_len);
177 
188  struct apr_table_t *headers, const char *content_type,
189  const struct md_data_t *body);
190 
191 /*
192  * Convenience functions for create+perform.
193  */
194 apr_status_t md_http_GET_perform(md_http_t *http, const char *url,
195  struct apr_table_t *headers,
196  md_http_response_cb *cb, void *baton);
197 apr_status_t md_http_HEAD_perform(md_http_t *http, const char *url,
198  struct apr_table_t *headers,
199  md_http_response_cb *cb, void *baton);
200 apr_status_t md_http_POST_perform(md_http_t *http, const char *url,
201  struct apr_table_t *headers, const char *content_type,
202  struct apr_bucket_brigade *body, int detect_len,
203  md_http_response_cb *cb, void *baton);
204 apr_status_t md_http_POSTd_perform(md_http_t *http, const char *url,
205  struct apr_table_t *headers, const char *content_type,
206  const struct md_data_t *body,
207  md_http_response_cb *cb, void *baton);
208 
210 
214 typedef apr_status_t md_http_next_req(md_http_request_t **preq, void *baton,
215  md_http_t *http, int in_flight);
216 
227 apr_status_t md_http_multi_perform(md_http_t *http, md_http_next_req *nextreq, void *baton);
228 
229 /**************************************************************************************************/
230 /* interface to implementation */
231 
237  md_http_next_req *nextreq, void *baton);
238 
246 };
247 
249 
254 void md_http_set_impl_data(md_http_t *http, void *data);
255 void *md_http_get_impl_data(md_http_t *http);
256 
257 
258 #endif /* md_http_h */
struct apr_bucket_brigade * body
Definition: md_http.h:81
void md_http_set_ca_file(md_http_t *http, const char *ca_file)
apr_status_t md_http_POSTd_perform(md_http_t *http, const char *url, struct apr_table_t *headers, const char *content_type, const struct md_data_t *body, md_http_response_cb *cb, void *baton)
const char * url
Definition: md_http.h:64
apr_status_t md_http_response_cb(const md_http_response_t *res, void *data)
Definition: md_http.h:40
apr_status_t md_http_multi_perform_cb(md_http_t *http, apr_pool_t *p, md_http_next_req *nextreq, void *baton)
Definition: md_http.h:236
void md_http_set_stalling_default(md_http_t *http, long bytes_per_sec, apr_time_t timeout)
void md_http_use_implementation(md_http_impl_t *impl)
void md_http_req_destroy(md_http_request_t *req)
apr_status_t md_http_POST_perform(md_http_t *http, const char *url, struct apr_table_t *headers, const char *content_type, struct apr_bucket_brigade *body, int detect_len, md_http_response_cb *cb, void *baton)
md_http_init_cb * init
Definition: md_http.h:241
const char * proxy_url
Definition: md_http.h:66
const char const char apr_text_header * body
Definition: mod_dav.h:1727
void md_http_set_impl_data(md_http_t *http, void *data)
Definition: md_util.h:39
Definition: md_http.h:58
apr_status_t md_http_HEAD_create(md_http_request_t **preq, md_http_t *http, const char *url, struct apr_table_t *headers)
struct apr_bucket_alloc_t apr_bucket_alloc_t
Definition: apr_buckets.h:123
apr_status_t md_http_init_cb(void)
Definition: md_http.h:232
const dav_resource dav_lockdb dav_lock * request
Definition: mod_dav.h:1438
md_http_response_cb * on_response
Definition: md_http.h:46
apr_status_t md_http_HEAD_perform(md_http_t *http, const char *url, struct apr_table_t *headers, md_http_response_cb *cb, void *baton)
apr_status_t md_http_multi_perform(md_http_t *http, md_http_next_req *nextreq, void *baton)
md_http_timeouts_t timeout
Definition: md_http.h:72
apr_status_t md_http_next_req(md_http_request_t **preq, void *baton, md_http_t *http, int in_flight)
Definition: md_http.h:214
void * on_status_data
Definition: md_http.h:45
void md_http_set_on_status_cb(md_http_request_t *req, md_http_status_cb *cb, void *baton)
apr_status_t md_http_GET_perform(md_http_t *http, const char *url, struct apr_table_t *headers, md_http_response_cb *cb, void *baton)
void md_http_set_connect_timeout_default(md_http_t *http, apr_time_t timeout)
Definition: apr_buckets.h:258
apr_table_t * headers
Definition: md_http.h:68
apr_off_t body_len
Definition: md_http.h:70
void * internals
Definition: md_http.h:74
Definition: md_http.h:51
apr_status_t md_http_create(md_http_t **phttp, apr_pool_t *p, const char *user_agent, const char *proxy_url)
md_http_t * http
Definition: md_http.h:59
void * md_http_get_impl_data(md_http_t *http)
apr_int64_t apr_time_t
Definition: apr_time.h:45
apr_status_t md_http_perform_cb(md_http_request_t *req)
Definition: md_http.h:235
md_http_perform_cb * perform
Definition: md_http.h:243
int id
Definition: md_http.h:61
md_http_cleanup_cb * cleanup
Definition: md_http.h:245
apr_time_t stalled
Definition: md_http.h:55
md_http_status_cb * on_status
Definition: md_http.h:44
md_http_req_cleanup_cb * req_cleanup
Definition: md_http.h:242
md_http_callbacks_t cb
Definition: md_http.h:73
void md_http_set_stalling(md_http_request_t *req, long bytes_per_sec, apr_time_t timeout)
long stall_bytes_per_sec
Definition: md_http.h:54
struct md_http_t md_http_t
Definition: md_http.h:25
void md_http_set_connect_timeout(md_http_request_t *req, apr_time_t timeout)
const char * user_agent
Definition: md_http.h:65
void md_http_set_timeout(md_http_request_t *req, apr_time_t timeout)
proxy_worker proxy_server_conf char * url
Definition: mod_proxy.h:637
apr_status_t md_http_POST_create(md_http_request_t **preq, md_http_t *http, const char *url, struct apr_table_t *headers, const char *content_type, struct apr_bucket_brigade *body, int detect_len)
apr_status_t md_http_GET_create(md_http_request_t **preq, md_http_t *http, const char *url, struct apr_table_t *headers)
int status
Definition: md_http.h:79
void md_http_req_cleanup_cb(md_http_request_t *req)
Definition: md_http.h:234
void md_http_set_on_response_cb(md_http_request_t *req, md_http_response_cb *cb, void *baton)
apr_pool_t * p
apr_status_t md_http_perform(md_http_request_t *request)
int status
Definition: mod_dav.h:141
struct apr_table_t apr_table_t
Definition: apr_tables.h:56
md_http_multi_perform_cb * multi_perform
Definition: md_http.h:244
struct apr_bucket_alloc_t * bucket_alloc
Definition: md_http.h:62
const char * ca_file
Definition: md_http.h:67
void * on_response_data
Definition: md_http.h:47
apr_pool_t * pool
Definition: md_http.h:60
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int apr_status_t
Definition: apr_errno.h:44
apr_time_t overall
Definition: md_http.h:52
struct apr_bucket_brigade * body
Definition: md_http.h:69
Definition: md_http.h:240
Definition: md_http.h:43
const char * method
Definition: md_http.h:63
apr_time_t connect
Definition: md_http.h:53
void md_http_set_response_limit(md_http_t *http, apr_off_t resp_limit)
apr_status_t md_http_status_cb(const md_http_request_t *req, apr_status_t status, void *data)
Definition: md_http.h:35
off_t apr_off_t
Definition: apr.h:395
md_http_request_t * req
Definition: md_http.h:78
void md_http_cleanup_cb(md_http_t *req, apr_pool_t *p)
Definition: md_http.h:233
apr_status_t md_http_POSTd_create(md_http_request_t **preq, md_http_t *http, const char *url, struct apr_table_t *headers, const char *content_type, const struct md_data_t *body)
apr_table_t * headers
Definition: md_http.h:80
Definition: md_http.h:77
void md_http_set_timeout_default(md_http_t *http, apr_time_t timeout)
apr_off_t resp_limit
Definition: md_http.h:71