aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2014-10-17Clarify javadocs for getBody() and getBodyContentType().Jeff Davidson
Change-Id: I83a538bb466b6fd7801961ef47952009bb0defdb
2014-10-09Merge "HTTP headers are case insensitive per RFC 2616 §4.2 "Message Headers""Ficus Kirkpatrick
2014-10-08HTTP headers are case insensitive per RFC 2616 §4.2 "Message Headers"Ralph Bergmann
Change-Id: I6459f8ecf9f32411ca387631d1298a9ce1c6446b Signed-off-by: Ralph Bergmann <ralph@the4thfloor.eu>
2014-10-07Copy cache header for 304 responseRalph Bergmann
A HTTP 304 response does not have all header fields. We have to copy the header from the cache entry. see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5 Change-Id: I197864ad4f2b103edc4a718afea2a35127b7c203 Signed-off-by: Ralph Bergmann <ralph@the4thfloor.eu>
2014-09-03Don't hold onto requests indefinitely.Ficus Kirkpatrick
Move the request into NetworkDispatcher's loop so that the previously processed request's reference is not held until the next request comes off the queue.
2014-09-03Merge "allow use of custom ImageRequests in ImageLoader"Ficus Kirkpatrick
2014-08-19Add a public accessor for a Request's ErrorListener.Shirish Kalele
Add a public accessor for a Request's ErrorListener. Change-Id: Ifd3b8f818dd0e9db0183f08321043aae7c92c72c Signed-off-by: Shirish Kalele <kalele@google.com>
2014-08-11Improve DiskBasedCache initial scan performanceFabian Frank
Using a BufferedInputStream significantly reduces the time it takes to initialize the cache. On my Nexus 5 with ~330 files in cache init time went from ~2s to ~0.5s with this change. Change-Id: I3dd909e3235583306ff5943f69e3947a275bf968 Signed-off-by: Fabian Frank <fabian.frank.de@gmail.com>
2014-07-16allow use of custom ImageRequests in ImageLoaderKevin Schultz
This seems like the smallest change that will allow developers to supply their own ImageRequest class to the ImageLoader without changing the API. There are several use cases for supplying custom ImageRequests, including setting custom headers, adjusting the priority of ImageRequests, and working around Issue #71928. Change-Id: Ic47452b5f8cada2491a6513cb56f383261c73c3a
2014-06-24Fix crash/OOM in DiskBasedCacheAurash Mahbod
DiskBasedCache.writeHeader() can throw an IOException and swallow it. This causes the cache entry to be partially written followed by the entry's data. When reading back, it is possible to read back the data segment (garbled part) when attempting to parse the cache header. Change-Id: I3022ca1566bc60e5869bb4ec384c866b4ba5c1c5
2014-06-16Fixes bug in PATCH method. Sets the method before setting the body.Miguel A. Martin
Just look at PUT and POST methods some lines above. The method is set before calling to addBodyIfExists(). The method should be set before adding the body. Otherwise, some libraries will try to establish a connection with the wrong method (GET by default). Change-Id: I993a62cdc5cbccbf54f9bae4f6b183e2edf4304d
2014-03-29ImageLoader: setError after null checkAndrew Sutherland
if request was canceled it will have already been removed from mInFlightRequests and cause NPE Change-Id: I1ce78bb6b3b2964545a47b5e3bb59bdf1a6d940e
2014-02-27Guard against NullPointerException currentlykang
occurring in Volley when a Request is given a url whose host is null. Change-Id: Idab1dadaa43bb9176356028221cbdc0f8dd52cdc
2014-02-10Fix generic type parameter for RequestQueue.add(Request)Max Cai
Change-Id: If977c965c8ae3b4d00b958e65679e99a1d29a03a
2014-02-08Merge "Allow method chaining on setters"Ficus Kirkpatrick
2014-02-08Use the view size to restrict NIV requests.Aurash Mahbod
Change-Id: Ib09a68c815f147ade31233d03267df687d8341e0
2014-02-08Clean up some warningsFicus Kirkpatrick
2014-02-03Volley to create valid NetworkResponse object when cache is disabledMax Zhou
* Add null check to request.CacheEntry() when creating NetworkResponse. Currently when cache is not used, rather than creating a valid NetworkResponse object, BasicNetwork.performRequest() throws NPE when processing a http 304 no modified response. The NetworkResponse object, if returned with the Volley error, can be used by the volley caller to determine the http status code. Change-Id: I007468ed98fb7ed5719a94f871323466e1bd0f8a
2013-12-19Revert "Revert "Add in additional http request types""Maurice Chu
This reverts commit 9e5c44f22b47fcb0d37c7b10de3b5db542424fa5. Also, to run tests, the android:targetPackage in the <instrumentation>needs to be set to com.android.volley.tests (i.e., the volley_tests apk itself) because volley is just a jar that is statically linked into the test apk. Change-Id: I41ad41e401084b79fbf9712e24d7f7fdeb358223
2013-11-03Fix default image not displaying prior to loadAdam W. Brown
Previously, if a default image was set, it would not be displayed until a network load had begun. In some use cases where the load would not be started until some arbitrary time in the future, this would leave an empty image view visible to the user. This patch checks to see if there is a default image set, and if so, uses that to clear the view, so prior to loading, the defualt image will be shown. Change-Id: I6fcee408d95d708676d68f3f0bc7222e56570f39
2013-10-09make all 2xx be a valid success codesReed Ellsworth
Change-Id: I94313e2f89c38277d36b7a2aaa525862d2740c98
2013-09-12Support no-content (204) requests in BasicNetwork.Ray Colline
When we get an empty response for say, a 204, we create a 0 byte response and pass it on to the NetworkResponse. Implementers of Request can then return appropriate Responses. The behavior before this change results in an NPE because we attempt to getContentLength() bytes from a null entity.. Change-Id: Ia5f92ffd99b8f3e88cc92dc50ba43c4721d83e79 Signed-off-by: Ray Colline <rayc@google.com>
2013-08-20ImageRequest.doParse() now adds NetworkResponse to all ParseError createdEmmanuel Rodriguez
This will help the caller to debug which image couldn't be parsed by peeking at the NetworkResponse. doParse() already returns the NetworkResponse of bitmaps successfully parsed, adding it to failed bitmaps should not take too much overhead.
2013-07-09Remote executable bit from ImageLoaderEvan Charlton
This shouldn't have been executable. Change-Id: Ib5c23ed853a99a4db55f1f2605528f4d9717ad24
2013-07-01NetworkImage - fix nullPointerException.Vladimir Baryshnikov
1. getLayoutParams() can be null. 2. old version used LinearLayout.LayoutParams instead of ViewGroup.LayoutParams
2013-06-26Allow per-app VolleyLog tagsEvan Charlton
To clean up the logs when multiple apps are using Volley, optionally customize the VolleyLog tag so that the app has its own namespace. Change-Id: I5b2129ab41bcfb7f309d324f696f905c98833551
2013-06-24Allow method chaining on settersEvan Charlton
Return "this" from the setter functions so that the methods can be chained. Change-Id: I5b03f1a9f265af451f5b1807347007569483b580
2013-06-21Port CacheHeader away from ObjectOutputStream.Ficus Kirkpatrick
The standard Java serialization system relies heavily on reflection, even for primitive types and Strings, which generates a lot of garbage. Move to a simple built-in implementation. Change-Id: I7f35cbfd1963f2aaf726f5b747cef1b2f8a0ad69
2013-06-21Add a test for DiskBasedCache.Ficus Kirkpatrick
Change-Id: I8106e5763df7e600c82c446b6ff828907fb187c1
2013-06-10Merge "Fix WRAP_CONTENT//WRAP_CONTENT case in NIV."Ficus Kirkpatrick
2013-06-10Merge "Fixed bug caused by batching responses in the ImageLoader"Ficus Kirkpatrick
2013-06-09Fixed bug caused by batching responses in the ImageLoaderCameron Ketcham
If the first call to batchResponse passes a VolleyError, then all responses from that batch would show an error even if some of them succeeded. This fixes the bug by setting the error per BatchedImageRequest rather than for the batch. Change-Id: I2543d2d6f4154c33ba072d7f97aee9dc67f3300e Signed-off-by: Cameron Ketcham <cketcham@gmail.com>
2013-06-09Fix WRAP_CONTENT//WRAP_CONTENT case in NIV.Aurash Mahbod
If the NIV is WRAP_CONTENT for both width / height, skip the check that makes sure that it is measured before fetching the image.
2013-05-31Merge "Allow callers to set value of notifyAuthFailure"Ficus Kirkpatrick
2013-05-29adding isCached function to ImageLoaderandaagar
Change-Id: I771a608910a7b2b1dc1fe1d30395a7bb0738592e
2013-05-22Merge "Allow custom HttpStack in Volley.newRequestQueue."Ficus Kirkpatrick
2013-05-22Merge "Don't requestLayout in layout pass in NIV"Ficus Kirkpatrick
2013-05-21Allow custom HttpStack in Volley.newRequestQueue.Ficus Kirkpatrick
Add a variant method that allows the user to pass in an HttpStack to be passed to BasicNetwork. Makes using alternative stacks like OkHttp easier.
2013-05-20Allow override point for connection creation.Jake Wharton
This provides an easy insertion point for alternate implementations of the HttpUrlConnection API (e.g., OkHttp). Change-Id: I84482c7a66ce7106680d2efc9865743b8ecb0248
2013-05-20Don't requestLayout in layout pass in NIVAurash Mahbod
2013-05-14Don't trample on the user-supplied tagEvan Charlton
Store the ImageContainer in a member variable instead of in the tag field (since the tag field buys us nothing, anyway).
2013-05-14Merge "Add ImageLoader and NetworkImageView convenience classes"Ficus Kirkpatrick
2013-05-13Add ImageLoader and NetworkImageView convenience classesAurash Mahbod
Change-Id: I5a1454c7c8d1ed62953b9cdaa9871b8cb40b23a7
2013-05-10Intern CacheHeader keys and values to avoid string duplicationDavid Braun
We found that Volley generated about 20 strings per cached item (~9000 strings for ~440 cached items) and most of these were duplicates. This change interns the key and value strings to avoid duplication. This saved about 500kb for our scenario (440 images cached.)
2013-04-30Allow callers to set value of notifyAuthFailureEvan Charlton
Since a caller might want AndroidAuthenticator to show a notification instead of delivering an error, allow it to be specified. Change-Id: I9232668f4e8e83b46da2c2fb1c678246c735f200
2013-04-30Add TrafficStats integrationEvan Charlton
Allow Request subclasses to set their TrafficStats tags. By default, this is the hostname's hashCode() so that requests to different hosts have different colors in DDMS. Change-Id: Ibedf06fdcee108dcd170f5eb70aaecea5647d55d
2013-04-03Merge "Move directory creation off the main thread."Ficus Kirkpatrick
2013-03-31Fix a bug in POSTs & support SslSocketFactories.Dan Morrill
For POSTs and PUTs, HttpURLConnection requires that you set the method before you write any body data. i.e. writing body data causes the socket to be opened, at which point you can't set the method anymore. Volley was calling these two methods in the wrong order; this fixes that. Separately, this also adds a constructor and appropriate support for a caller-provided SslSocketFactory. The use case for this is self-signed certs, where a developer's app is is preloaded with the public key for a specific server cert not signed by one of the usual CAs. The caller is responsible for setting up the socket factory with an appropriate keystore, etc. Change-Id: I2738ce956202b8a8508a733fc7f8b6600cd19bf5
2013-03-27Move directory creation off the main thread.Ficus Kirkpatrick
2013-03-25Ensure that the cache folder existsEvan Charlton
Make sure that the cache folder exists when using DiskBasedCache. Change-Id: I60e2c2b0b88c9a3a178e72dda05ab5f7290e33f0