M7350/oe-core/meta-msm/recipes/miniupnpd/files/0001-presentation-page.patch

90 lines
2.4 KiB
Diff
Raw Normal View History

2024-09-09 08:52:07 +00:00
From 4db2d9388d00b61f5e380b7250540c5671b5bb52 Mon Sep 17 00:00:00 2001
From: Tyler Wear <twear@codeaurora.org>
Date: Fri, 21 Jun 2013 13:09:03 -0700
Subject: [PATCH 1/1] presentation-page
---
miniupnpd.conf | 4 ++--
upnphttp.c | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+), 2 deletions(-)
mode change 100644 => 100755 miniupnpd.conf
mode change 100644 => 100755 upnphttp.c
diff --git a/miniupnpd.conf b/miniupnpd.conf
old mode 100644
new mode 100755
index 058da75..5a527cd
--- a/miniupnpd.conf
+++ b/miniupnpd.conf
@@ -17,7 +17,7 @@
#listening_ip=192.168.0.1/24
listening_ip=bridge0
# port for HTTP (descriptions and SOAP) traffic. set 0 for autoselect.
-port=0
+port=8201
# path to the unix socket used to communicate with MiniSSDPd
# If running, MiniSSDPd will manage M-SEARCH answering.
@@ -54,7 +54,7 @@ secure_mode=no
# If set to an empty string, no presentationURL element will appear
# in the XML description of the device, which prevents MS Windows
# from displaying an icon in the "Network Connections" panel.
-#presentation_url=http://www.mylan/index.php
+presentation_url=/192.168.225.1:8201
# report system uptime instead of daemon uptime
system_uptime=yes
diff --git a/upnphttp.c b/upnphttp.c
old mode 100644
new mode 100755
index 31456e3..942d0d2
--- a/upnphttp.c
+++ b/upnphttp.c
@@ -28,6 +28,7 @@
#include "upnpsoap.h"
#include "upnpevents.h"
#include "upnputils.h"
+#include "upnpglobalvars.h"
struct upnphttp *
New_upnphttp(int s)
@@ -537,6 +538,24 @@ ProcessHTTPUnSubscribe_upnphttp(struct upnphttp * h, const char * path)
}
#endif
+static void
+SendResp_presentation(struct upnphttp * h)
+{
+ char body[1024];
+ int l;
+ h->respflags = FLAG_HTML;
+
+ l = snprintf(body, sizeof(body),
+ "<HTML><HEAD><TITLE>UPnP</TITLE></HEAD>"
+ "<BODY><div style=\"text-align: center\">"
+ "<h3> UPnP is Running!</h3>"
+ "</BODY></HTML>\r\n");
+
+ BuildResp_upnphttp(h, body, l);
+ SendResp_upnphttp(h);
+ CloseSocket_upnphttp(h);
+}
+
/* Parse and process Http Query
* called once all the HTTP headers have been received,
* so it is guaranteed that h->req_buf contains the \r\n\r\n
@@ -630,6 +649,10 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h)
return;
}
#endif
+ else if(0 == memcmp(HttpUrl, presentationurl, 19)) {
+ SendResp_presentation(h);
+ return;
+ }
syslog(LOG_NOTICE, "%s not found, responding ERROR 404", HttpUrl);
Send404(h);
}
--
1.7.8.3