[gssdp] Fill user-agent cache from SSDP packets
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gssdp] Fill user-agent cache from SSDP packets
- Date: Sat, 2 Apr 2016 21:14:45 +0000 (UTC)
commit 5e54fad7d4434411098c0f05380876373f8b3f86
Author: Jens Georg <mail jensge org>
Date: Fri Dec 30 22:03:47 2011 +0100
Fill user-agent cache from SSDP packets
https://bugzilla.gnome.org/show_bug.cgi?id=653894
libgssdp/gssdp-client.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/libgssdp/gssdp-client.c b/libgssdp/gssdp-client.c
index 4b8c043..5a35329 100644
--- a/libgssdp/gssdp-client.c
+++ b/libgssdp/gssdp-client.c
@@ -1336,7 +1336,20 @@ socket_source_cb (GSSDPSocketSource *socket_source, GSSDPClient *client)
ip_string = g_inet_address_to_string (inetaddr);
port = g_inet_socket_address_get_port (
G_INET_SOCKET_ADDRESS (address));
+
if (type >= 0) {
+ const char *agent;
+
+ /* update client cache */
+ agent = soup_message_headers_get_one (headers, "Server");
+ if (!agent)
+ agent = soup_message_headers_get_one (headers, "User-Agent");
+
+ if (agent)
+ gssdp_client_add_cache_entry (client,
+ ip_string,
+ agent);
+
g_signal_emit (client,
signals[MESSAGE_RECEIVED],
0,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]