Add a 5 second maximum timeout for uploads.
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
9d5cd0bbf4
commit
161a56201e
@ -127,12 +127,14 @@ public class sigServer {
|
|||||||
char[] buffer = new char[1024];
|
char[] buffer = new char[1024];
|
||||||
int count;
|
int count;
|
||||||
boolean wroteData=false;
|
boolean wroteData=false;
|
||||||
while ((count = in.read(buffer))>0) {
|
long lastDataTime = System.currentTimeMillis();
|
||||||
|
while ((count = in.read(buffer))>0&&System.currentTimeMillis()-lastDataTime<5000) {
|
||||||
//stream.write(in.read(buffer));
|
//stream.write(in.read(buffer));
|
||||||
//stream.write(buffer.,0,count);
|
//stream.write(buffer.,0,count);
|
||||||
String buf = new String(buffer);
|
String buf = new String(buffer);
|
||||||
byte[] data = buf.getBytes("ISO-8859-1");
|
byte[] data = buf.getBytes("ISO-8859-1");
|
||||||
stream.write(data,0,count);
|
stream.write(data,0,count);
|
||||||
|
lastDataTime=System.currentTimeMillis();
|
||||||
wroteData=true;
|
wroteData=true;
|
||||||
if (buf.contains(boundary)) {
|
if (buf.contains(boundary)) {
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user