diff options
Diffstat (limited to 'src/org')
4 files changed, 13 insertions, 10 deletions
diff --git a/src/org/apache/http/impl/conn/DefaultClientConnectionOperator.java b/src/org/apache/http/impl/conn/DefaultClientConnectionOperator.java index 9567eb1..62169bc 100644 --- a/src/org/apache/http/impl/conn/DefaultClientConnectionOperator.java +++ b/src/org/apache/http/impl/conn/DefaultClientConnectionOperator.java @@ -183,8 +183,13 @@ public class DefaultClientConnectionOperator // catch SocketException to cover any kind of connect failure } catch (SocketException ex) { if (i == addresses.length - 1) { - ConnectException cause = ex instanceof ConnectException - ? (ConnectException) ex : new ConnectException(ex.getMessage(), ex); + final ConnectException cause; + if (ex instanceof ConnectException) { + cause = (ConnectException) ex; + } else { + cause = new ConnectException(ex.getMessage()); + cause.initCause(ex); + } throw new HttpHostConnectException(target, cause); } // END android-changed diff --git a/src/org/apache/http/impl/conn/SingleClientConnManager.java b/src/org/apache/http/impl/conn/SingleClientConnManager.java index 55e9757..d8fb956 100644 --- a/src/org/apache/http/impl/conn/SingleClientConnManager.java +++ b/src/org/apache/http/impl/conn/SingleClientConnManager.java @@ -31,11 +31,11 @@ package org.apache.http.impl.conn; -import dalvik.system.SocketTagger; import java.io.IOException; import java.net.Socket; import java.util.concurrent.TimeUnit; +import android.net.TrafficStats; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.conn.ClientConnectionManager; @@ -261,7 +261,7 @@ public class SingleClientConnManager implements ClientConnectionManager { try { final Socket socket = uniquePoolEntry.connection.getSocket(); if (socket != null) { - SocketTagger.get().tag(socket); + TrafficStats.tagSocket(socket); } } catch (IOException iox) { log.debug("Problem tagging socket.", iox); @@ -303,7 +303,7 @@ public class SingleClientConnManager implements ClientConnectionManager { // statistics from future users. final Socket socket = uniquePoolEntry.connection.getSocket(); if (socket != null) { - SocketTagger.get().untag(socket); + TrafficStats.untagSocket(socket); } // END android-changed diff --git a/src/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java b/src/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java index e9c11b0..7d6a560 100644 --- a/src/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java +++ b/src/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java @@ -30,11 +30,11 @@ package org.apache.http.impl.conn.tsccm; -import dalvik.system.SocketTagger; import java.io.IOException; import java.net.Socket; import java.util.concurrent.TimeUnit; +import android.net.TrafficStats; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.conn.routing.HttpRoute; @@ -185,7 +185,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager { try { final Socket socket = entry.getConnection().getSocket(); if (socket != null) { - SocketTagger.get().tag(socket); + TrafficStats.tagSocket(socket); } } catch (IOException iox) { log.debug("Problem tagging socket.", iox); @@ -220,7 +220,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager { final BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry(); final Socket socket = entry.getConnection().getSocket(); if (socket != null) { - SocketTagger.get().untag(socket); + TrafficStats.untagSocket(socket); } // END android-changed diff --git a/src/org/apache/http/impl/io/SocketInputBuffer.java b/src/org/apache/http/impl/io/SocketInputBuffer.java index f525833..5e1869c 100644 --- a/src/org/apache/http/impl/io/SocketInputBuffer.java +++ b/src/org/apache/http/impl/io/SocketInputBuffer.java @@ -101,8 +101,6 @@ public class SocketInputBuffer extends AbstractSessionInputBuffer { * to rely on isDataAvailable() returning normally; that approach cannot * distinguish between an exhausted stream and a stream with zero bytes * buffered. - * - * @hide */ public boolean isStale() throws IOException { if (hasBufferedData()) { |