Author: kwright
Date: Mon Apr 22 22:48:58 2013
New Revision: 1470744
URL: http://svn.apache.org/r1470744
Log:
Fix for CONNECTORS-677.
Modified:
manifoldcf/trunk/CHANGES.txt
manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/CommonsHTTPSender.java
manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/ThrottledFetcher.java
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/CommonsHTTPSender.java
manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
Modified: manifoldcf/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1470744&r1=1470743&r2=1470744&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Mon Apr 22 22:48:58 2013
@@ -3,6 +3,9 @@ $Id$
======================= 1.2-dev =====================
+CONNECTORS-677: Close body streams where required.
+(Karl Wright)
+
CONNECTORS-599: Upgrade to a new version of Derby which doesn't
stall.
(Karl Wright)
Modified:
manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
URL:
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java?rev=1470744&r1=1470743&r2=1470744&view=diff
==============================================================================
---
manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
(original)
+++
manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
Mon Apr 22 22:48:58 2013
@@ -7105,6 +7105,7 @@ public class LivelinkConnector extends o
protected HttpResponse response = null;
protected Throwable responseException = null;
protected XThreadInputStream threadStream = null;
+ protected InputStream bodyStream = null;
protected boolean streamCreated = false;
protected Throwable streamException = null;
protected boolean abortThread = false;
@@ -7165,7 +7166,7 @@ public class LivelinkConnector extends o
{
try
{
- InputStream bodyStream = response.getEntity().getContent();
+ bodyStream = response.getEntity().getContent();
if (bodyStream != null)
{
threadStream = new XThreadInputStream(bodyStream);
@@ -7205,6 +7206,17 @@ public class LivelinkConnector extends o
}
finally
{
+ if (bodyStream != null)
+ {
+ try
+ {
+ bodyStream.close();
+ }
+ catch (IOException e)
+ {
+ }
+ bodyStream = null;
+ }
synchronized (this)
{
try
Modified:
manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/CommonsHTTPSender.java
URL:
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/CommonsHTTPSender.java?rev=1470744&r1=1470743&r2=1470744&view=diff
==============================================================================
---
manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/CommonsHTTPSender.java
(original)
+++
manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/CommonsHTTPSender.java
Mon Apr 22 22:48:58 2013
@@ -614,6 +614,7 @@ public class CommonsHTTPSender extends B
protected HttpResponse response = null;
protected Throwable responseException = null;
protected XThreadInputStream threadStream = null;
+ protected InputStream bodyStream = null;
protected String charSet = null;
protected boolean streamCreated = false;
protected Throwable streamException = null;
@@ -676,7 +677,7 @@ public class CommonsHTTPSender extends B
try
{
HttpEntity entity = response.getEntity();
- InputStream bodyStream = entity.getContent();
+ bodyStream = entity.getContent();
if (bodyStream != null)
{
threadStream = new XThreadInputStream(bodyStream);
@@ -717,6 +718,17 @@ public class CommonsHTTPSender extends B
}
finally
{
+ if (bodyStream != null)
+ {
+ try
+ {
+ bodyStream.close();
+ }
+ catch (IOException e)
+ {
+ }
+ bodyStream = null;
+ }
synchronized (this)
{
try
Modified:
manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/ThrottledFetcher.java
URL:
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/ThrottledFetcher.java?rev=1470744&r1=1470743&r2=1470744&view=diff
==============================================================================
---
manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/ThrottledFetcher.java
(original)
+++
manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/ThrottledFetcher.java
Mon Apr 22 22:48:58 2013
@@ -1229,6 +1229,7 @@ public class ThrottledFetcher
protected HttpResponse response = null;
protected Throwable responseException = null;
protected XThreadInputStream threadStream = null;
+ protected InputStream bodyStream = null;
protected boolean streamCreated = false;
protected Throwable streamException = null;
@@ -1295,7 +1296,7 @@ public class ThrottledFetcher
{
try
{
- InputStream bodyStream = response.getEntity().getContent();
+ bodyStream = response.getEntity().getContent();
if (bodyStream != null)
{
bodyStream = new
ThrottledInputstream(theConnection,server,bodyStream,minimumMillisecondsPerBytePerServer);
@@ -1336,6 +1337,17 @@ public class ThrottledFetcher
}
finally
{
+ if (bodyStream != null)
+ {
+ try
+ {
+ bodyStream.close();
+ }
+ catch (IOException e)
+ {
+ }
+ bodyStream = null;
+ }
synchronized (this)
{
try
Modified:
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/CommonsHTTPSender.java
URL:
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/CommonsHTTPSender.java?rev=1470744&r1=1470743&r2=1470744&view=diff
==============================================================================
---
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/CommonsHTTPSender.java
(original)
+++
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/CommonsHTTPSender.java
Mon Apr 22 22:48:58 2013
@@ -614,6 +614,7 @@ public class CommonsHTTPSender extends B
protected HttpResponse response = null;
protected Throwable responseException = null;
protected XThreadInputStream threadStream = null;
+ protected InputStream bodyStream = null;
protected String charSet = null;
protected boolean streamCreated = false;
protected Throwable streamException = null;
@@ -676,7 +677,7 @@ public class CommonsHTTPSender extends B
try
{
HttpEntity entity = response.getEntity();
- InputStream bodyStream = entity.getContent();
+ bodyStream = entity.getContent();
if (bodyStream != null)
{
threadStream = new XThreadInputStream(bodyStream);
@@ -717,6 +718,17 @@ public class CommonsHTTPSender extends B
}
finally
{
+ if (bodyStream != null)
+ {
+ try
+ {
+ bodyStream.close();
+ }
+ catch (IOException e)
+ {
+ }
+ bodyStream = null;
+ }
synchronized (this)
{
try
Modified:
manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
URL:
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java?rev=1470744&r1=1470743&r2=1470744&view=diff
==============================================================================
---
manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
(original)
+++
manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
Mon Apr 22 22:48:58 2013
@@ -2415,6 +2415,7 @@ public class ThrottledFetcher
protected LoginCookies cookies = null;
protected Throwable cookieException = null;
protected XThreadInputStream threadStream = null;
+ protected InputStream bodyStream = null;
protected boolean streamCreated = false;
protected Throwable streamException = null;
protected boolean abortThread = false;
@@ -2500,7 +2501,7 @@ public class ThrottledFetcher
{
try
{
- InputStream bodyStream = response.getEntity().getContent();
+ bodyStream = response.getEntity().getContent();
if (bodyStream != null)
{
bodyStream = new
ThrottledInputstream(theConnection,bodyStream);
@@ -2541,6 +2542,17 @@ public class ThrottledFetcher
}
finally
{
+ if (bodyStream != null)
+ {
+ try
+ {
+ bodyStream.close();
+ }
+ catch (IOException e)
+ {
+ }
+ bodyStream = null;
+ }
synchronized (this)
{
try