r259 - in /apt-transport-debtorrent/trunk: debian/changelog debtorrent.cc

camrdale-guest at users.alioth.debian.org camrdale-guest at users.alioth.debian.org
Fri Aug 17 02:19:58 UTC 2007


Author: camrdale-guest
Date: Fri Aug 17 02:19:58 2007
New Revision: 259

URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=259
Log:
  * Read in debtorrent specific config options
  * Increase the timeout for reading, decrease for connecting
  * Always pipeline, even after a failure
  * Increase failed attempts to 3 before quitting

Modified:
    apt-transport-debtorrent/trunk/debian/changelog
    apt-transport-debtorrent/trunk/debtorrent.cc

Modified: apt-transport-debtorrent/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/debtorrent/apt-transport-debtorrent/trunk/debian/changelog?rev=259&op=diff
==============================================================================
--- apt-transport-debtorrent/trunk/debian/changelog (original)
+++ apt-transport-debtorrent/trunk/debian/changelog Fri Aug 17 02:19:58 2007
@@ -7,5 +7,9 @@
   * Remove the limit on pipelining
   * Allow requests to be returned in any order
   * Remove the i18n
+  * Read in debtorrent specific config options
+  * Increase the timeout for reading, decrease for connecting
+  * Always pipeline, even after a failure
+  * Increase failed attempts to 3 before quitting
 
  -- Cameron Dale <camrdale at gmail.com>  Wed, 14 Aug 2007 20:59:00 -0700

Modified: apt-transport-debtorrent/trunk/debtorrent.cc
URL: http://svn.debian.org/wsvn/debtorrent/apt-transport-debtorrent/trunk/debtorrent.cc?rev=259&op=diff
==============================================================================
--- apt-transport-debtorrent/trunk/debtorrent.cc (original)
+++ apt-transport-debtorrent/trunk/debtorrent.cc Fri Aug 17 02:19:58 2007
@@ -69,7 +69,8 @@
 string HttpMethod::FailFile;
 int HttpMethod::FailFd = -1;
 time_t HttpMethod::FailTime = 0;
-unsigned long TimeOut = 120;
+unsigned long ConnectTimeOut = 60;
+unsigned long PollTimeOut = 300;
 bool Debug = false;
 
 unsigned long CircleBuf::BwReadLimit=0;
@@ -328,7 +329,7 @@
    Host = ServerName.Host;
    
    // Connect to the remote server
-   if (Connect(Host,Port,"debtorrent",9988,ServerFd,TimeOut,Owner) == false)
+   if (Connect(Host,Port,"debtorrent",9988,ServerFd,ConnectTimeOut,Owner) == false)
       return false;
    
    return true;
@@ -689,7 +690,7 @@
 
    // Select
    struct timeval tv;
-   tv.tv_sec = TimeOut;
+   tv.tv_sec = PollTimeOut;
    tv.tv_usec = 0;
    int Res = 0;
    if ((Res = select(MaxFd+1,&rfds,&wfds,0,&tv)) < 0)
@@ -972,10 +973,6 @@
    int Depth = -1;
    for (FetchItem *I = Queue; I != 0; I = I->Next, Depth++)
    {
-      // If pipelining is disabled, we only queue 1 request
-      if (Server->Pipeline == false && Depth >= 0)
-	 break;
-      
       // Make sure we stick with the same server
       if (Server->Comp(I->Uri) == false)
 	 break;
@@ -998,8 +995,8 @@
    if (pkgAcqMethod::Configuration(Message) == false)
       return false;
    
-   TimeOut = _config->FindI("Acquire::http::Timeout",TimeOut);
-   Debug = _config->FindB("Debug::Acquire::http",false);
+   PollTimeOut = _config->FindI("Acquire::debtorrent::Timeout",PollTimeOut);
+   Debug = _config->FindB("Debug::Acquire::debtorrent",false);
    
    return true;
 }
@@ -1085,9 +1082,8 @@
 	    FailCounter++;
 	    _error->Discard();
 	    Server->Close();
-	    Server->Pipeline = false;
 	    
-	    if (FailCounter >= 2)
+	    if (FailCounter >= 3)
 	    {
 	       Fail("Connection failed",true);
 	       FailCounter = 0;
@@ -1144,7 +1140,7 @@
 		     _error->Discard();
 		     Server->Close();
 		  
-		     if (FailCounter >= 2)
+		     if (FailCounter >= 3)
 		     {
 		        Fail("Connection failed",true);
 		        FailCounter = 0;




More information about the Debtorrent-commits mailing list