Revision: 4903
http://sourceforge.net/p/vexi/code/4903
Author: mkpg2
Date: 2016-11-23 21:20:50 +0000 (Wed, 23 Nov 2016)
Log Message:
-----------
Make pipe use own buffer. Otherwise will not be able to upload files in
parallel.
Modified Paths:
--------------
branches/vexi3/org.vexi-library.js/src/main/java/org/ibex/js/Fountain.java
Modified:
branches/vexi3/org.vexi-library.js/src/main/java/org/ibex/js/Fountain.java
===================================================================
--- branches/vexi3/org.vexi-library.js/src/main/java/org/ibex/js/Fountain.java
2016-11-23 20:34:50 UTC (rev 4902)
+++ branches/vexi3/org.vexi-library.js/src/main/java/org/ibex/js/Fountain.java
2016-11-23 21:20:50 UTC (rev 4903)
@@ -414,9 +414,22 @@
}
- // REMARK need our own buffer, since pipe can
be recurvively called with HTTP stuff (reading response
-// byte[] buffer = new byte[16*1024];
- IOUtil.pipe(f0.getInputStream(true), os);
+ // REMARK need our own buffer, since pipe can
be recurvively called with HTTP stuff (reading response)
+ // and want to be able to do file uploads in
parallel.
+ int bufferSize = 1024;
+ if(contentLength!=null){
+ if(contentLength<bufferSize){
+ bufferSize =
(int)(1*contentLength);
+ }else{
+ // just increase buffer a bit
for bigger requests
+ for(int i=0; i<4 &&
contentLength>8*bufferSize; i++){
+ bufferSize *=2;
+ }
+ }
+ }
+
+ byte[] buffer = new byte[bufferSize];
+ IOUtil.pipe(f0.getInputStream(true), os,
buffer);
return null;
} catch (IOException e) {
throw JSU.handleFountainExn(e);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn