[PATCH] Only reply if a valid MX header is present
- From: Jens Georg <mail jensge org>
- To: gupnp-list gnome org
- Subject: [PATCH] Only reply if a valid MX header is present
- Date: Wed, 1 Jun 2011 17:45:19 +0200
Fixes UPnP CTT test UDA-1.2.9
---
libgssdp/gssdp-resource-group.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/libgssdp/gssdp-resource-group.c b/libgssdp/gssdp-resource-group.c
index 231cbc5..78f1fa6 100644
--- a/libgssdp/gssdp-resource-group.c
+++ b/libgssdp/gssdp-resource-group.c
@@ -768,10 +768,13 @@ message_received_cb (GSSDPClient *client,
/* Extract MX */
mx_str = soup_message_headers_get_one (headers, "MX");
- if (mx_str)
- mx = atoi (mx_str);
- else
- mx = SSDP_DEFAULT_MX;
+ if (!mx_str || atoi (mx_str) == 0) {
+ g_warning ("Discovery request did not have a valid MX header");
+
+ return;
+ }
+
+ mx = atoi (mx_str);
/* Extract version */
version_str = get_version_for_target ((char *)target);
--
1.7.5.2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]