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>
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 {