[o2on-svn] [97] FIX: #12553 UPnPがうまく動かないルータがある

Zurück zum Archiv-Index

o2on svn commit o2on-****@lists*****
2008年 5月 29日 (木) 13:52:17 JST


Revision: 97
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=97
Author:   electrolysis
Date:     2008-05-29 13:52:17 +0900 (Thu, 29 May 2008)

Log Message:
-----------
FIX: #12553 UPnPがうまく動かないルータがある

詳細: 1. URLBaseがあれば使用する
2. Hostヘッダにポート番号を付ける(デフォルトポート除く)

Ticket Links:
:-----------
    http://sourceforge.jp/projects/o2on/tracker/detail/12553

Modified Paths:
--------------
    branches/BRANCH_0043/o2on/src.o2on/O2Protocol.h
    branches/BRANCH_0043/o2on/src.o2on/simplehttpsocket.h
    branches/BRANCH_0043/o2on/src.o2on/upnp_description.h

Modified: branches/BRANCH_0043/o2on/src.o2on/O2Protocol.h
===================================================================
--- branches/BRANCH_0043/o2on/src.o2on/O2Protocol.h	2008-05-29 03:38:14 UTC (rev 96)
+++ branches/BRANCH_0043/o2on/src.o2on/O2Protocol.h	2008-05-29 04:52:17 UTC (rev 97)
@@ -92,7 +92,7 @@
 		profile->GetFlags(flags);
 
 		header.AddFieldString("Connection", "close");
-		header.AddFieldString("Host", header.hostname.c_str());
+		header.AddFieldString("Host", header.host.c_str());
 		header.AddFieldString("User-Agent", profile->GetUserAgentA());
 		header.AddFieldString(X_O2_NODE_ID, hashstr.c_str());
 		header.AddFieldString(X_O2_RSAPUBLICKEY, pubkey.c_str());

Modified: branches/BRANCH_0043/o2on/src.o2on/simplehttpsocket.h
===================================================================
--- branches/BRANCH_0043/o2on/src.o2on/simplehttpsocket.h	2008-05-29 03:38:14 UTC (rev 96)
+++ branches/BRANCH_0043/o2on/src.o2on/simplehttpsocket.h	2008-05-29 04:52:17 UTC (rev 97)
@@ -71,7 +71,7 @@
 		hdr.method = "GET";
 		hdr.url = url;
 		hdr.AddFieldString("Connection", "close");
-		hdr.AddFieldString("Host", hdr.hostname.c_str());
+		hdr.AddFieldString("Host", hdr.host.c_str());
 		if (!useragent.empty())
 			hdr.AddFieldString("User-Agent", useragent.c_str());
 		if (body && bodylen)
@@ -101,7 +101,7 @@
 		hdr.url = url;
 
 		hdr.AddFieldString("Connection", "close", false);
-		hdr.AddFieldString("Host", hdr.hostname.c_str(), false);
+		hdr.AddFieldString("Host", hdr.host.c_str(), false);
 		if (!useragent.empty())
 			hdr.AddFieldString("User-Agent", useragent.c_str(), false);
 		if (body && bodylen)

Modified: branches/BRANCH_0043/o2on/src.o2on/upnp_description.h
===================================================================
--- branches/BRANCH_0043/o2on/src.o2on/upnp_description.h	2008-05-29 03:38:14 UTC (rev 96)
+++ branches/BRANCH_0043/o2on/src.o2on/upnp_description.h	2008-05-29 04:52:17 UTC (rev 97)
@@ -334,7 +334,12 @@
 		string str;
 		unicode2ascii(chars, length, str);
 
-		if (wcsstr(cur_element.c_str(), L"URL")) {
+		if (wcsstr(cur_element.c_str(), L"URLBase")) {
+			if (str[str.size()-1] == '/')
+				str.erase(str.size()-1);
+			base_url = str;
+		}
+		else if (wcsstr(cur_element.c_str(), L"URL")) {
 			if (strncmp(str.c_str(), "http://", 7) != 0)
 				str = base_url + (str[0] == '/' ? "" : "/") + str;
 		}




o2on-svn メーリングリストの案内
Zurück zum Archiv-Index