You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by rw...@apache.org on 2016/05/10 16:18:04 UTC

svn commit: r1743220 - /pivot/trunk/web/src/org/apache/pivot/web/Query.java

Author: rwhitcomb
Date: Tue May 10 16:18:04 2016
New Revision: 1743220

URL: http://svn.apache.org/viewvc?rev=1743220&view=rev
Log:
Two small fixes in the Query class:
* Use the "getContentLengthLong()" method to get the complete content length
  (instead of the possibly truncated 32-bit length).
* Call the "QueryListener.failed()" method before we throw the QueryException
  if the server itself returned a "not OK" status.  This seemed to be an
  oversight in the original code since every other place we throw we also
  call this listener method.

Modified:
    pivot/trunk/web/src/org/apache/pivot/web/Query.java

Modified: pivot/trunk/web/src/org/apache/pivot/web/Query.java
URL: http://svn.apache.org/viewvc/pivot/trunk/web/src/org/apache/pivot/web/Query.java?rev=1743220&r1=1743219&r2=1743220&view=diff
==============================================================================
--- pivot/trunk/web/src/org/apache/pivot/web/Query.java (original)
+++ pivot/trunk/web/src/org/apache/pivot/web/Query.java Tue May 10 16:18:04 2016
@@ -434,7 +434,7 @@ public abstract class Query<V> extends I
             message = connection.getResponseMessage();
 
             // Record the content length
-            bytesExpected = connection.getContentLength();
+            bytesExpected = connection.getContentLengthLong();
 
             // NOTE Header indexes start at 1, not 0
             int i = 1;
@@ -445,6 +445,7 @@ public abstract class Query<V> extends I
             // If the response was anything other than 2xx, throw an exception
             int statusPrefix = status / 100;
             if (statusPrefix != 2) {
+                queryListeners.failed(this);
                 throw new QueryException(status, message);
             }