http 500->400 for expected errors
This commit is contained in:
parent
42486f73f1
commit
47e20c681f
1 changed files with 10 additions and 4 deletions
|
@ -230,7 +230,7 @@ public class RouteServer extends Thread implements Comparable<RouteServer>
|
|||
|
||||
if ( cr.getErrorMessage() != null )
|
||||
{
|
||||
writeHttpHeader(bw, HTTP_STATUS_INTERNAL_SERVER_ERROR);
|
||||
writeHttpHeader(bw, HTTP_STATUS_BAD_REQUEST);
|
||||
bw.write( cr.getErrorMessage() );
|
||||
bw.write( "\n" );
|
||||
}
|
||||
|
@ -334,7 +334,6 @@ public class RouteServer extends Thread implements Comparable<RouteServer>
|
|||
|
||||
cleanupThreadQueue( threadQueue );
|
||||
|
||||
|
||||
if ( debug ) System.out.println( "threadQueue.size()=" + threadQueue.size() );
|
||||
if ( threadQueue.size() >= maxthreads )
|
||||
{
|
||||
|
@ -345,6 +344,13 @@ public class RouteServer extends Thread implements Comparable<RouteServer>
|
|||
long maxage = server.starttime - threadQueue.peek().starttime;
|
||||
long maxWaitTime = 2000L-maxage;
|
||||
if ( debug ) System.out.println( "maxage=" + maxage + " maxWaitTime=" + maxWaitTime );
|
||||
if ( debug )
|
||||
{
|
||||
for ( RouteServer t : threadQueue )
|
||||
{
|
||||
System.out.println( "age=" + (server.starttime - t.starttime) );
|
||||
}
|
||||
}
|
||||
if ( maxWaitTime > 0 )
|
||||
{
|
||||
threadPoolSync.wait( maxWaitTime );
|
||||
|
|
Loading…
Reference in a new issue