Browse Source

WPS UPnP: Add more priority for queuing EAP events

Jouni Malinen 14 years ago
parent
commit
f30e698c08
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/wps/wps_upnp_event.c

+ 8 - 1
src/wps/wps_upnp_event.c

@@ -381,7 +381,14 @@ int event_add(struct subscription *s, const struct wpabuf *data, int probereq)
 	if (len >= MAX_EVENTS_QUEUED) {
 		wpa_printf(MSG_DEBUG, "WPS UPnP: Too many events queued for "
 			   "subscriber %p", s);
-		return 1;
+		if (probereq)
+			return 1;
+
+		/* Drop oldest entry to allow EAP event to be stored. */
+		e = event_dequeue(s);
+		if (!e)
+			return 1;
+		event_delete(e);
 	}
 
 	if (s->last_event_failed && probereq && len > 0) {