]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS ER: Clear HTTP socket on NOTIFY processing errors
authorJouni Malinen <jouni.malinen@oss.qualcomm.com>
Thu, 9 Oct 2025 14:12:09 +0000 (17:12 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 9 Oct 2025 14:12:09 +0000 (17:12 +0300)
Since we process only a single request from the socket, there is no need
to maintain the HTTP socket when we detect an error. That will just
delay closing of the socket until WPS ER is stopped. Instead, close the
socket immediately on detecting the error to match the behavior for
unsupported HTTP request types and any cases where we send a response.

Signed-off-by: Jouni Malinen <jouni.malinen@oss.qualcomm.com>
src/wps/wps_er.c

index dede64b0136ac37d0f8cf3f62bc40d66c306bafc..92cf20742d6830bbd82cb76a9e38c04da0557b73 100644 (file)
@@ -1195,11 +1195,14 @@ static void wps_er_http_notify(struct wps_er *er, struct http_request *req)
                if (event_id != er->event_id) {
                        wpa_printf(MSG_DEBUG, "WPS ER: HTTP event for an "
                                   "unknown event id %u", event_id);
+                       http_request_deinit(req);
                        return;
                }
                pos = os_strchr(uri + 7, '/');
-               if (pos == NULL)
+               if (!pos) {
+                       http_request_deinit(req);
                        return;
+               }
                pos++;
                wps_er_http_event(er, req, atoi(pos));
        } else {