Skip to content

Commit dc124b3

Browse files
committed
Handle timeouts 10ms or less better.
1 parent 4040126 commit dc124b3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

providers/grizzly/src/main/java/com/ning/http/client/providers/grizzly/GrizzlyAsyncHttpProvider.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ protected void initializeTransport(final AsyncHttpClientConfig clientConfig) {
320320
int delay = 500;
321321
if (timeout < delay) {
322322
delay = timeout - 10;
323+
if (delay <= 0) {
324+
delay = timeout;
325+
}
323326
}
324327
timeoutExecutor = IdleTimeoutFilter.createDefaultIdleDelayedExecutor(delay, TimeUnit.MILLISECONDS);
325328
timeoutExecutor.start();

0 commit comments

Comments
 (0)