Skip to content

Commit

Permalink
Print handled URL before the actual handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
juhovh committed Jul 18, 2018
1 parent 40667a3 commit 4c1e906
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/raop.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response)
raop_t *raop = conn->raop;

const char *method;
const char *url;
const char *cseq;
const char *challenge;
int require_auth = 0;
Expand All @@ -138,6 +139,7 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response)
int response_datalen = 0;

method = http_request_get_method(request);
url = http_request_get_url(request);
cseq = http_request_get_header(request, "CSeq");
if (!method || !cseq) {
return;
Expand All @@ -154,7 +156,7 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response)
logger_log(conn->raop->logger, LOGGER_DEBUG, "Our nonce: %s", conn->nonce);
logger_log(conn->raop->logger, LOGGER_DEBUG, "Authorization: %s", authorization);
}
if (!digest_is_valid(realm, raop->password, conn->nonce, method, http_request_get_url(request), authorization)) {
if (!digest_is_valid(realm, raop->password, conn->nonce, method, url, authorization)) {
char *authstr;
int authstrlen;

Expand Down Expand Up @@ -198,6 +200,7 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response)
logger_log(conn->raop->logger, LOGGER_DEBUG, "Got response: %s", signature);
}

logger_log(conn->raop->logger, LOGGER_DEBUG, "Handling request %s with URL %s", method, url);
raop_handler_t handler = NULL;
if (require_auth) {
/* Do nothing in case of authentication request */
Expand Down Expand Up @@ -246,8 +249,6 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response)
response_data = NULL;
response_datalen = 0;
}

logger_log(conn->raop->logger, LOGGER_DEBUG, "Handled request %s with URL %s", method, http_request_get_url(request));
}

static void
Expand Down

0 comments on commit 4c1e906

Please sign in to comment.