]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS UPnP: Add more debug for event subscription
authorJouni Malinen <j@w1.fi>
Tue, 19 Oct 2010 09:43:48 +0000 (12:43 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 19 Oct 2010 09:43:48 +0000 (12:43 +0300)
src/wps/wps_upnp_web.c

index 250ad8efc7e4f55063b913ca535ed2ed07fa2be1..5c18ce2c17bd37fdb8fc465a15fdc4eed7a7ef4e 100644 (file)
@@ -901,6 +901,9 @@ static void web_connection_parse_subscribe(struct upnp_wps_device_sm *sm,
                return;
        }
 
+       wpa_hexdump_ascii(MSG_DEBUG, "WPS UPnP: HTTP SUBSCRIBE",
+                         (u8 *) hdr, os_strlen(hdr));
+
        /* Parse/validate headers */
        h = hdr;
        /* First line: SUBSCRIBE /wps_event HTTP/1.1
@@ -1000,16 +1003,22 @@ static void web_connection_parse_subscribe(struct upnp_wps_device_sm *sm,
 
        if (got_uuid) {
                /* renewal */
+               wpa_printf(MSG_DEBUG, "WPS UPnP: Subscription renewal");
                if (callback_urls) {
                        ret = HTTP_BAD_REQUEST;
                        goto error;
                }
                s = subscription_renew(sm, uuid);
                if (s == NULL) {
+                       char str[80];
+                       uuid_bin2str(uuid, str, sizeof(str));
+                       wpa_printf(MSG_DEBUG, "WPS UPnP: Could not find "
+                                  "SID %s", str);
                        ret = HTTP_PRECONDITION_FAILED;
                        goto error;
                }
        } else if (callback_urls) {
+               wpa_printf(MSG_DEBUG, "WPS UPnP: New subscription");
                if (!got_nt) {
                        ret = HTTP_PRECONDITION_FAILED;
                        goto error;
@@ -1033,6 +1042,7 @@ static void web_connection_parse_subscribe(struct upnp_wps_device_sm *sm,
        /* subscription id */
        b = wpabuf_put(buf, 0);
        uuid_bin2str(s->uuid, b, 80);
+       wpa_printf(MSG_DEBUG, "WPS UPnP: Assigned SID %s", b);
        wpabuf_put(buf, os_strlen(b));
        wpabuf_put_str(buf, "\r\n");
        wpabuf_printf(buf, "Timeout: Second-%d\r\n", UPNP_SUBSCRIBE_SEC);
@@ -1066,6 +1076,7 @@ error:
        *     HTTP 500-series error code.
        *   599 Too many subscriptions (not a standard HTTP error)
        */
+       wpa_printf(MSG_DEBUG, "WPS UPnP: SUBSCRIBE failed - return %d", ret);
        http_put_empty(buf, ret);
        http_request_send_and_deinit(req, buf);
        os_free(callback_urls);