mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
fix for http problem with grabbing too much memory
This commit is contained in:
@@ -57,7 +57,6 @@ import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.entity.BufferedHttpEntity;
|
||||
import java.net.URI;
|
||||
|
||||
|
||||
@@ -4049,8 +4048,11 @@ public class PApplet extends Activity implements PConstants, Runnable {
|
||||
HttpClient httpclient = new DefaultHttpClient();
|
||||
HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);
|
||||
HttpEntity entity = response.getEntity();
|
||||
BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);
|
||||
return bufHttpEntity.getContent();
|
||||
return entity.getContent();
|
||||
// can't use BufferedHttpEntity because it may try to allocate a byte
|
||||
// buffer of the size of the download, bad when DL is 25 MB... [0200]
|
||||
// BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);
|
||||
// return bufHttpEntity.getContent();
|
||||
|
||||
} catch (MalformedURLException mfue) {
|
||||
// not a url, that's fine
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
0200 android
|
||||
X fix BufferedHttpEntity problem
|
||||
X was trying to allocate a byte buffer for entire size of HTTP file
|
||||
|
||||
_ Android mode does not recognize library imports
|
||||
_ http://code.google.com/p/processing/issues/detail?id=766
|
||||
|
||||
Reference in New Issue
Block a user