Explorar el Código

2009-11-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Use host and protocol in original URI, because URI selector
	selects URI based on original URI, not redirected one.
	* src/Request.cc
Tatsuhiro Tsujikawa hace 16 años
padre
commit
cb6604c88e
Se han modificado 2 ficheros con 11 adiciones y 1 borrados
  1. 6 0
      ChangeLog
  2. 5 1
      src/Request.cc

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2009-11-26  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Use host and protocol in original URI, because URI selector
+	selects URI based on original URI, not redirected one.
+	* src/Request.cc
+
 2009-11-26  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Fixed the bug which causes segmentation fault with tellWaiting

+ 5 - 1
src/Request.cc

@@ -311,7 +311,11 @@ void Request::setMaxPipelinedRequest(unsigned int num)
 
 const SharedHandle<PeerStat>& Request::initPeerStat()
 {
-  _peerStat.reset(new PeerStat(0, _host, _protocol));
+  // Use host and protocol in original URI, because URI selector
+  // selects URI based on original URI, not redirected one.
+  Request origReq;
+  origReq.setUrl(_url);
+  _peerStat.reset(new PeerStat(0, origReq.getHost(), origReq.getProtocol()));
   return _peerStat;
 }