MCPcopy Create free account
hub / github.com/apache/httpd / curl_debug_log

Function curl_debug_log

modules/md/md_curl.c:195–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195static int curl_debug_log(CURL *curl, curl_infotype type, char *data, size_t size, void *baton)
196{
197 md_http_request_t *req = baton;
198
199 (void)curl;
200 switch (type) {
201 case CURLINFO_TEXT:
202 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE4, 0, req->pool,
203 "req[%d]: info %s", req->id, apr_pstrndup(req->pool, data, size));
204 break;
205 case CURLINFO_HEADER_OUT:
206 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE4, 0, req->pool,
207 "req[%d]: header --> %s", req->id, apr_pstrndup(req->pool, data, size));
208 break;
209 case CURLINFO_HEADER_IN:
210 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE4, 0, req->pool,
211 "req[%d]: header <-- %s", req->id, apr_pstrndup(req->pool, data, size));
212 break;
213 case CURLINFO_DATA_OUT:
214 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE4, 0, req->pool,
215 "req[%d]: data --> %ld bytes", req->id, (long)size);
216 if (md_log_is_level(req->pool, MD_LOG_TRACE5)) {
217 md_data_t d;
218 const char *s;
219 md_data_init(&d, data, size);
220 md_data_to_hex(&s, 0, req->pool, &d);
221 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE5, 0, req->pool,
222 "req[%d]: data(hex) --> %s", req->id, s);
223 }
224 break;
225 case CURLINFO_DATA_IN:
226 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE4, 0, req->pool,
227 "req[%d]: data <-- %ld bytes", req->id, (long)size);
228 if (md_log_is_level(req->pool, MD_LOG_TRACE5)) {
229 md_data_t d;
230 const char *s;
231 md_data_init(&d, data, size);
232 md_data_to_hex(&s, 0, req->pool, &d);
233 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE5, 0, req->pool,
234 "req[%d]: data(hex) <-- %s", req->id, s);
235 }
236 break;
237 default:
238 break;
239 }
240 return 0;
241}
242
243static apr_status_t internals_setup(md_http_request_t *req)
244{

Callers

nothing calls this directly

Calls 4

md_log_perrorFunction · 0.85
md_log_is_levelFunction · 0.85
md_data_initFunction · 0.85
md_data_to_hexFunction · 0.85

Tested by

no test coverage detected