WPS: Print subscription UUID in debug log in more places

This makes it easier to debug subscription issues.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-08-31 16:16:59 +03:00
parent 96038a5f85
commit 3bde828098
2 changed files with 15 additions and 5 deletions

View File

@ -695,6 +695,7 @@ struct subscription * subscription_start(struct upnp_wps_device_sm *sm,
struct subscription *s; struct subscription *s;
time_t now = time(NULL); time_t now = time(NULL);
time_t expire = now + UPNP_SUBSCRIBE_SEC; time_t expire = now + UPNP_SUBSCRIBE_SEC;
char str[80];
/* Get rid of expired subscriptions so we have room */ /* Get rid of expired subscriptions so we have room */
subscription_list_age(sm, now); subscription_list_age(sm, now);
@ -743,8 +744,10 @@ struct subscription * subscription_start(struct upnp_wps_device_sm *sm,
subscription_destroy(s); subscription_destroy(s);
return NULL; return NULL;
} }
wpa_printf(MSG_DEBUG, "WPS UPnP: Subscription %p started with %s", uuid_bin2str(s->uuid, str, sizeof(str));
s, callback_urls); wpa_printf(MSG_DEBUG,
"WPS UPnP: Subscription %p (SID %s) started with %s",
s, str, callback_urls);
/* Schedule sending this */ /* Schedule sending this */
event_send_all_later(sm); event_send_all_later(sm);
return s; return s;

View File

@ -1214,18 +1214,25 @@ static void web_connection_parse_unsubscribe(struct upnp_wps_device_sm *sm,
} }
if (got_uuid) { if (got_uuid) {
char str[80];
uuid_bin2str(uuid, str, sizeof(str));
s = subscription_find(sm, uuid); s = subscription_find(sm, uuid);
if (s) { if (s) {
struct subscr_addr *sa; struct subscr_addr *sa;
sa = dl_list_first(&s->addr_list, struct subscr_addr, sa = dl_list_first(&s->addr_list, struct subscr_addr,
list); list);
wpa_printf(MSG_DEBUG, "WPS UPnP: Unsubscribing %p %s", wpa_printf(MSG_DEBUG,
s, (sa && sa->domain_and_port) ? "WPS UPnP: Unsubscribing %p (SID %s) %s",
s, str, (sa && sa->domain_and_port) ?
sa->domain_and_port : "-null-"); sa->domain_and_port : "-null-");
dl_list_del(&s->list); dl_list_del(&s->list);
subscription_destroy(s); subscription_destroy(s);
} else { } else {
wpa_printf(MSG_INFO, "WPS UPnP: Could not find matching subscription to unsubscribe"); wpa_printf(MSG_INFO,
"WPS UPnP: Could not find matching subscription to unsubscribe (SID %s)",
str);
ret = HTTP_PRECONDITION_FAILED; ret = HTTP_PRECONDITION_FAILED;
goto send_msg; goto send_msg;
} }