Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Commit 8326df5

Browse files
committed
Fix #88
1 parent 77e9449 commit 8326df5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/com/kttdevelopment/simplehttpserver/handler/ThrottledHandler.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ public ThrottledHandler(final HttpHandler handler, final ConnectionThrottler thr
4343
@Override
4444
public final void handle(final HttpExchange exchange) throws IOException{
4545
if(throttler.addConnection(exchange)){
46-
handler.handle(exchange);
47-
throttler.deleteConnection(exchange);
46+
try{
47+
handler.handle(exchange);
48+
}finally{
49+
throttler.deleteConnection(exchange);
50+
}
4851
}else{
4952
exchange.close();
5053
}

0 commit comments

Comments
 (0)