File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/main/java/org/java_websocket/server Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -359,10 +359,14 @@ public void run() {
359359 conn = iqueue .remove ( 0 );
360360 WrappedByteChannel c = ( (WrappedByteChannel ) conn .channel );
361361 ByteBuffer buf = takeBuffer ();
362- if ( SocketChannelIOHelper .readMore ( buf , conn , c ) )
363- iqueue .add ( conn );
364- conn .inQueue .put ( buf );
365- queue ( conn );
362+ try {
363+ if ( SocketChannelIOHelper .readMore ( buf , conn , c ) )
364+ iqueue .add ( conn );
365+ conn .inQueue .put ( buf );
366+ queue ( conn );
367+ } finally {
368+ pushBuffer ( buf );
369+ }
366370
367371 }
368372 } catch ( CancelledKeyException e ) {
@@ -381,7 +385,6 @@ public void run() {
381385 handleFatal ( null , e );
382386 }
383387 }
384-
385388 protected void allocateBuffers ( WebSocket c ) throws InterruptedException {
386389 if ( queuesize .get () >= 2 * decoders .size () + 1 ) {
387390 return ;
You can’t perform that action at this time.
0 commit comments