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.


git-svn-id: https://svn.apache.org/repos/asf/pivot/trunk@1743220 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/web/src/org/apache/pivot/web/Query.java b/web/src/org/apache/pivot/web/Query.java
index fca5dac..b52c2e7 100644
--- a/web/src/org/apache/pivot/web/Query.java
+++ b/web/src/org/apache/pivot/web/Query.java
@@ -434,7 +434,7 @@
             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 @@
             // 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);
             }