[android] HttpFileSource - rate limit

This commit is contained in:
Ivo van Dongen
2016-09-02 17:36:23 +02:00
parent dc4659b4a8
commit ed4e37ba9f
3 changed files with 28 additions and 4 deletions

View File

@@ -43,7 +43,7 @@ class HTTPRequest implements Callback {
private native void nativeOnFailure(int type, String message);
private native void nativeOnResponse(int code, String etag, String modified, String cacheControl, String expires, byte[] body);
private native void nativeOnResponse(int code, String etag, String modified, String cacheControl, String expires, String retryAfter, String xRateLimitReset, byte[] body);
private HTTPRequest(long nativePtr, String resourceUrl, String userAgent, String etag, String modified) {
mNativePtr = nativePtr;
@@ -120,7 +120,14 @@ class HTTPRequest implements Callback {
mLock.lock();
if (mNativePtr != 0) {
nativeOnResponse(response.code(), response.header("ETag"), response.header("Last-Modified"), response.header("Cache-Control"), response.header("Expires"), body);
nativeOnResponse(response.code(),
response.header("ETag"),
response.header("Last-Modified"),
response.header("Cache-Control"),
response.header("Expires"),
response.header("Retry-After"),
response.header("x-rate-limit-reset"),
body);
}
mLock.unlock();
}