diff options
Diffstat (limited to 'src/backend/anastasis-httpd.c')
-rw-r--r-- | src/backend/anastasis-httpd.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/backend/anastasis-httpd.c b/src/backend/anastasis-httpd.c index fd5ffc3..35a4d9c 100644 --- a/src/backend/anastasis-httpd.c +++ b/src/backend/anastasis-httpd.c | |||
@@ -332,6 +332,7 @@ url_handler (void *cls, | |||
332 | hc = GNUNET_new (struct TM_HandlerContext); | 332 | hc = GNUNET_new (struct TM_HandlerContext); |
333 | *con_cls = hc; | 333 | *con_cls = hc; |
334 | hc->async_scope_id = aid; | 334 | hc->async_scope_id = aid; |
335 | hc->url = url; | ||
335 | } | 336 | } |
336 | if (0 == strcasecmp (method, | 337 | if (0 == strcasecmp (method, |
337 | MHD_HTTP_METHOD_HEAD)) | 338 | MHD_HTTP_METHOD_HEAD)) |
@@ -519,14 +520,36 @@ handle_mhd_completion_callback (void *cls, | |||
519 | enum MHD_RequestTerminationCode toe) | 520 | enum MHD_RequestTerminationCode toe) |
520 | { | 521 | { |
521 | struct TM_HandlerContext *hc = *con_cls; | 522 | struct TM_HandlerContext *hc = *con_cls; |
523 | struct GNUNET_AsyncScopeSave old_scope; | ||
522 | 524 | ||
523 | (void) cls; | 525 | (void) cls; |
524 | (void) connection; | 526 | (void) connection; |
525 | if (NULL == hc) | 527 | if (NULL == hc) |
526 | return; | 528 | return; |
527 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 529 | GNUNET_async_scope_enter (&hc->async_scope_id, |
528 | "Finished handling request with status %d\n", | 530 | &old_scope); |
529 | (int) toe); | 531 | { |
532 | #if MHD_VERSION >= 0x00097304 | ||
533 | const union MHD_ConnectionInfo *ci; | ||
534 | unsigned int http_status = 0; | ||
535 | |||
536 | ci = MHD_get_connection_info (connection, | ||
537 | MHD_CONNECTION_INFO_HTTP_STATUS); | ||
538 | if (NULL != ci) | ||
539 | http_status = ci->http_status; | ||
540 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
541 | "Request for `%s' completed with HTTP status %u (%d)\n", | ||
542 | hc->url, | ||
543 | http_status, | ||
544 | toe); | ||
545 | #else | ||
546 | (void) connection; | ||
547 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
548 | "Request for `%s' completed (%d)\n", | ||
549 | hc->url, | ||
550 | toe); | ||
551 | #endif | ||
552 | } | ||
530 | if (NULL != hc->cc) | 553 | if (NULL != hc->cc) |
531 | hc->cc (hc); | 554 | hc->cc (hc); |
532 | GNUNET_free (hc); | 555 | GNUNET_free (hc); |