diff --git a/lib/roles/h2/ops-h2.c b/lib/roles/h2/ops-h2.c index 989cb5b95..0f76d171c 100644 --- a/lib/roles/h2/ops-h2.c +++ b/lib/roles/h2/ops-h2.c @@ -797,9 +797,9 @@ static int lws_h2_bind_for_post_before_action(struct lws *wsi) { const struct lws_http_mount *hit; + int uri_len = 0, methidx; char *uri_ptr = NULL; uint8_t *buffered; - int uri_len = 0; const char *p; size_t blen; @@ -850,7 +850,10 @@ lws_h2_bind_for_post_before_action(struct lws *wsi) if (lws_bind_protocol(wsi, pp, __func__)) return 1; } - if (lws_http_get_uri_and_method(wsi, &uri_ptr, &uri_len) >= 0) + + methidx = lws_http_get_uri_and_method(wsi, &uri_ptr, &uri_len); + + if (methidx >= 0) if (wsi->a.protocol->callback(wsi, LWS_CALLBACK_HTTP, wsi->user_space, hit ? uri_ptr + @@ -860,6 +863,10 @@ lws_h2_bind_for_post_before_action(struct lws *wsi) uri_len))) return 1; +#if defined(LWS_WITH_ACCESS_LOG) + lws_prepare_access_log_info(wsi, uri_ptr, uri_len, methidx); +#endif + lwsl_info("%s: setting LRS_BODY from 0x%x (%s)\n", __func__, (int)wsi->wsistate, wsi->a.protocol->name);