Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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;
73  void *internals;
74 };
75 
78  int status;
81 };
82 
83 apr_status_t md_http_create(md_http_t **phttp, apr_pool_t *p, const char *user_agent,
84  const char *proxy_url);
85 
86 void md_http_set_response_limit(md_http_t *http, apr_off_t resp_limit);
87 
96 
103 
109 void md_http_set_stalling_default(md_http_t *http, long bytes_per_sec, apr_time_t timeout);
110 void md_http_set_stalling(md_http_request_t *req, long bytes_per_sec, apr_time_t timeout);
111 
117 
125 
135 
144  struct apr_table_t *headers);
145 
154  struct apr_table_t *headers);
155 
167  struct apr_table_t *headers, const char *content_type,
168  struct apr_bucket_brigade *body, int detect_len);
169 
180  struct apr_table_t *headers, const char *content_type,
181  const struct md_data_t *body);
182 
183 /*
184  * Convenience functions for create+perform.
185  */
186 apr_status_t md_http_GET_perform(md_http_t *http, const char *url,
187  struct apr_table_t *headers,
188  md_http_response_cb *cb, void *baton);
189 apr_status_t md_http_HEAD_perform(md_http_t *http, const char *url,
190  struct apr_table_t *headers,
191  md_http_response_cb *cb, void *baton);
192 apr_status_t md_http_POST_perform(md_http_t *http, const char *url,
193  struct apr_table_t *headers, const char *content_type,
194  struct apr_bucket_brigade *body, int detect_len,
195  md_http_response_cb *cb, void *baton);
196 apr_status_t md_http_POSTd_perform(md_http_t *http, const char *url,
197  struct apr_table_t *headers, const char *content_type,
198  const struct md_data_t *body,
199  md_http_response_cb *cb, void *baton);
200 
202 
206 typedef apr_status_t md_http_next_req(md_http_request_t **preq, void *baton,
207  md_http_t *http, int in_flight);
208 
219 apr_status_t md_http_multi_perform(md_http_t *http, md_http_next_req *nextreq, void *baton);
220 
221 /**************************************************************************************************/
222 /* interface to implementation */
223 
228  md_http_next_req *nextreq, void *baton);
229 
236 };
237 
239 
240 
241 
242 #endif /* md_http_h */
struct apr_bucket_brigade * body
Definition: md_http.h:80
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:227
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:232
const char * proxy_url
Definition: md_http.h:66
const char const char apr_text_header * body
Definition: mod_dav.h:1621
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:224
const dav_resource dav_lockdb dav_lock * request
Definition: mod_dav.h:1332
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:71
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:206
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:67
apr_off_t body_len
Definition: md_http.h:69
void * internals
Definition: md_http.h:73
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
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:226
md_http_perform_cb * perform
Definition: md_http.h:234
int id
Definition: md_http.h:61
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:233
md_http_callbacks_t cb
Definition: md_http.h:72
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:626
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:78
void md_http_req_cleanup_cb(md_http_request_t *req)
Definition: md_http.h:225
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:235
struct apr_bucket_alloc_t * bucket_alloc
Definition: md_http.h:62
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:68
Definition: md_http.h:231
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:399
md_http_request_t * req
Definition: md_http.h:77
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:79
Definition: md_http.h:76
void md_http_set_timeout_default(md_http_t *http, apr_time_t timeout)
apr_off_t resp_limit
Definition: md_http.h:70