You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2012/11/30 01:46:11 UTC

svn commit: r1415468 - /manifoldcf/branches/CONNECTORS-120/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java

Author: kwright
Date: Fri Nov 30 00:46:11 2012
New Revision: 1415468

URL: http://svn.apache.org/viewvc?rev=1415468&view=rev
Log:
Fix cookie-handling to more precisely mirror the flow through the commons-httpclient implementation.

Modified:
    manifoldcf/branches/CONNECTORS-120/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java

Modified: manifoldcf/branches/CONNECTORS-120/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-120/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java?rev=1415468&r1=1415467&r2=1415468&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-120/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java (original)
+++ manifoldcf/branches/CONNECTORS-120/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java Fri Nov 30 00:46:11 2012
@@ -1515,6 +1515,7 @@ public class ThrottledFetcher
         try
         {
           statusCode = methodThread.getResponseCode();
+          lastFetchCookies = methodThread.getCookies();
           switch (statusCode)
           {
           case HttpStatus.SC_REQUEST_TIMEOUT:
@@ -1638,28 +1639,7 @@ public class ThrottledFetcher
     public LoginCookies getLastFetchCookies()
       throws ManifoldCFException, ServiceInterruption
     {
-      if (fetchMethod == null)
-        throw new ManifoldCFException("Attempt to get cookies when there is no method");
-      if (methodThread == null || threadStarted == false)
-        throw new ManifoldCFException("Attempt to get cookies when no method thread");
-      try
-      {
-        return methodThread.getCookies();
-      }
-      catch (InterruptedException e)
-      {
-        methodThread.interrupt();
-        throw new ManifoldCFException("Interrupted: "+e.getMessage(),e,ManifoldCFException.INTERRUPTED);
-      }
-      catch (HttpException e)
-      {
-        handleHTTPException(e,"reading cookies");
-      }
-      catch (IOException e)
-      {
-        handleIOException(e,"reading cookies");
-      }
-      return null;
+      return lastFetchCookies;
     }
 
     /** Get response headers