manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1420491 - /manifoldcf/branches/CONNECTORS-578/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
Date Wed, 12 Dec 2012 00:12:32 GMT
Author: kwright
Date: Wed Dec 12 00:12:31 2012
New Revision: 1420491

URL: http://svn.apache.org/viewvc?rev=1420491&view=rev
Log:
Httpcomponents execute explicitly specifying the host doesn't seem to work; do it the other
way.

Modified:
    manifoldcf/branches/CONNECTORS-578/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java

Modified: manifoldcf/branches/CONNECTORS-578/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-578/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java?rev=1420491&r1=1420490&r2=1420491&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-578/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
(original)
+++ manifoldcf/branches/CONNECTORS-578/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
Wed Dec 12 00:12:31 2012
@@ -478,10 +478,10 @@ public class LivelinkConnector extends o
   // on this instance!
 
 
-  protected static int executeMethodViaThread(HttpHost host, HttpClient client, HttpRequestBase
executeMethod)
+  protected static int executeMethodViaThread(HttpClient client, HttpRequestBase executeMethod)
     throws InterruptedException, HttpException, IOException
   {
-    ExecuteMethodThread t = new ExecuteMethodThread(host, client,executeMethod);
+    ExecuteMethodThread t = new ExecuteMethodThread(client,executeMethod);
     t.start();
     try
     {
@@ -516,10 +516,10 @@ public class LivelinkConnector extends o
       String ingestHttpAddress = ingestCgiPath;
 
       HttpClient client = getInitializedClient(contextMsg);
-      HttpGet method = new HttpGet(ingestHttpAddress);
+      HttpGet method = new HttpGet(getHost().toURI() + ingestHttpAddress);
       try
       {
-        int statusCode = executeMethodViaThread(getHost(),client,method);
+        int statusCode = executeMethodViaThread(client,method);
         switch (statusCode)
         {
         case 502:
@@ -3853,8 +3853,8 @@ public class LivelinkConnector extends o
     String resultDescription = null;
     Long readSize = null;
 
-    HttpGet method = new HttpGet(ingestHttpAddress);
-    ExecuteMethodThread methodThread = new ExecuteMethodThread(getHost(), client,method);
+    HttpGet method = new HttpGet(getHost().toURI() + ingestHttpAddress);
+    ExecuteMethodThread methodThread = new ExecuteMethodThread(client,method);
     methodThread.start();
     try
     {
@@ -4073,12 +4073,12 @@ public class LivelinkConnector extends o
     long currentTime;
     if (Logging.connectors.isDebugEnabled())
       Logging.connectors.debug("Livelink: Session authenticating via http "+contextMsg+"...");
-    HttpGet authget = new HttpGet(createLivelinkLoginURI());
+    HttpGet authget = new HttpGet(getHost().toURI() + createLivelinkLoginURI());
     try
     {
       if (Logging.connectors.isDebugEnabled())
         Logging.connectors.debug("Livelink: Created new HttpGet "+contextMsg+"; executing
authentication method");
-      int statusCode = executeMethodViaThread(getHost(),httpClient,authget);
+      int statusCode = executeMethodViaThread(httpClient,authget);
 
       if (statusCode == 502 || statusCode == 500)
       {
@@ -6712,7 +6712,6 @@ public class LivelinkConnector extends o
   protected static class ExecuteMethodThread extends Thread
   {
     /** Client and method, all preconfigured */
-    protected final HttpHost host;
     protected final HttpClient httpClient;
     protected final HttpRequestBase executeMethod;
     
@@ -6727,11 +6726,10 @@ public class LivelinkConnector extends o
 
     protected Throwable generalException = null;
     
-    public ExecuteMethodThread(HttpHost host, HttpClient httpClient, HttpRequestBase executeMethod)
+    public ExecuteMethodThread(HttpClient httpClient, HttpRequestBase executeMethod)
     {
       super();
       setDaemon(true);
-      this.host = host;
       this.httpClient = httpClient;
       this.executeMethod = executeMethod;
     }
@@ -6749,8 +6747,7 @@ public class LivelinkConnector extends o
             {
               try
               {
-                System.out.println("The target is: "+host.toString());
-                response = httpClient.execute(host,executeMethod);
+                response = httpClient.execute(executeMethod);
               }
               catch (java.net.SocketTimeoutException e)
               {



Mime
View raw message