Set default uploadLimit.
Avoid hanging in in.read() when uploadLimit is exceeded.
This commit is contained in:
parent
101e3ee58a
commit
c202e31ea3
1 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,7 @@ public abstract class AbstractServletClient extends HttpServlet {
|
||||||
// port of Helma RMI server
|
// port of Helma RMI server
|
||||||
int port = 0;
|
int port = 0;
|
||||||
// limit to HTTP uploads in kB
|
// limit to HTTP uploads in kB
|
||||||
int uploadLimit;
|
int uploadLimit = 1024;
|
||||||
// RMI url of Helma app
|
// RMI url of Helma app
|
||||||
String hopUrl;
|
String hopUrl;
|
||||||
// cookie domain to use
|
// cookie domain to use
|
||||||
|
@ -274,7 +274,7 @@ public abstract class AbstractServletClient extends HttpServlet {
|
||||||
// consume all input to make Apache happy
|
// consume all input to make Apache happy
|
||||||
byte b[] = new byte[1024];
|
byte b[] = new byte[1024];
|
||||||
int read = 0;
|
int read = 0;
|
||||||
while (read > -1)
|
while (in.available () > 0)
|
||||||
read = in.read (b, 0, 1024);
|
read = in.read (b, 0, 1024);
|
||||||
throw new RuntimeException ("Upload exceeds limit of "+uploadLimit+" kb.");
|
throw new RuntimeException ("Upload exceeds limit of "+uploadLimit+" kb.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue