| 59 | } |
| 60 | |
| 61 | apr_status_t md_http_create(md_http_t **phttp, apr_pool_t *p, const char *user_agent, |
| 62 | const char *proxy_url) |
| 63 | { |
| 64 | md_http_t *http; |
| 65 | apr_status_t rv = APR_SUCCESS; |
| 66 | |
| 67 | if (!cur_impl) { |
| 68 | *phttp = NULL; |
| 69 | return APR_ENOTIMPL; |
| 70 | } |
| 71 | |
| 72 | if (!cur_init_done) { |
| 73 | if (APR_SUCCESS == (rv = cur_impl->init())) { |
| 74 | cur_init_done = 1; |
| 75 | } |
| 76 | else { |
| 77 | return rv; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | http = apr_pcalloc(p, sizeof(*http)); |
| 82 | http->pool = p; |
| 83 | http->impl = cur_impl; |
| 84 | http->user_agent = apr_pstrdup(p, user_agent); |
| 85 | http->proxy_url = proxy_url? apr_pstrdup(p, proxy_url) : NULL; |
| 86 | http->bucket_alloc = apr_bucket_alloc_create(p); |
| 87 | if (!http->bucket_alloc) { |
| 88 | return APR_EGENERAL; |
| 89 | } |
| 90 | apr_pool_cleanup_register(p, http, http_cleanup, apr_pool_cleanup_null); |
| 91 | *phttp = http; |
| 92 | return APR_SUCCESS; |
| 93 | } |
| 94 | |
| 95 | apr_status_t md_http_clone(md_http_t **phttp, |
| 96 | apr_pool_t *p, md_http_t *source_http) |
no outgoing calls
no test coverage detected