mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-27 16:33:38 +00:00
[android] Increase dl http thread buffer size to 128KB
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
1becd3e0ba
commit
304addba58
@@ -209,7 +209,7 @@ class ChunkTask extends AsyncTask<Void, byte[], Integer>
|
||||
// @TODO Else display received web page to user - router is redirecting us to some page
|
||||
}
|
||||
|
||||
return downloadFromStream(new BufferedInputStream(urlConnection.getInputStream(), 65536));
|
||||
return downloadFromStream(new BufferedInputStream(urlConnection.getInputStream(), 128 * Constants.KB));
|
||||
} catch (final MalformedURLException ex)
|
||||
{
|
||||
Logger.e(TAG, "Invalid url: " + mUrl, ex);
|
||||
@@ -229,7 +229,7 @@ class ChunkTask extends AsyncTask<Void, byte[], Integer>
|
||||
{
|
||||
// Because of timeouts in InputStream.read (for bad connection),
|
||||
// try to introduce dynamic buffer size to read in one query.
|
||||
final int[] arrSize = {64, 32, 1};
|
||||
final int[] arrSize = {128, 32, 1};
|
||||
int ret = IO_EXCEPTION;
|
||||
|
||||
for (int size : arrSize)
|
||||
@@ -240,7 +240,7 @@ class ChunkTask extends AsyncTask<Void, byte[], Integer>
|
||||
break;
|
||||
} catch (final IOException ex)
|
||||
{
|
||||
Logger.e(TAG, "IOException in downloadFromStream for chunk size: " + size, ex);
|
||||
Logger.e(TAG, "IOException in downloadFromStream for buffer size: " + size, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user