Skip to content

Commit f414ca5

Browse files
committed
Merge branch 'master' of https://github.com/Andreas-Bur/Java-WebSocket into bug-834
2 parents 26e49d7 + 564b8aa commit f414ca5

File tree

5 files changed

+458
-10
lines changed

5 files changed

+458
-10
lines changed

‎CHANGELOG.md‎

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# Change log
2+
3+
## Version Release 1.3.9 (2018-08-05)
4+
5+
#### Bugs Fixed
6+
7+
*[Issue 694](https://github.com/TooTallNate/Java-WebSocket/issues/694) - AssertionError at WebSocketImpl.isOpen
8+
*[Issue 685](https://github.com/TooTallNate/Java-WebSocket/issues/685) - Exclude default port from wss host ([PR 683](https://github.com/TooTallNate/Java-WebSocket/pull/683))
9+
*[PR 746](https://github.com/TooTallNate/Java-WebSocket/pull/746) - Fixed typo in Draft_6455
10+
*[PR 722](https://github.com/TooTallNate/Java-WebSocket/pull/722) - Catch exceptions in AbstractWebSocket
11+
*[PR 708](https://github.com/TooTallNate/Java-WebSocket/pull/708) - Enable and Disable ping/pong
12+
13+
#### New Features
14+
15+
*[Issue 711](https://github.com/TooTallNate/Java-WebSocket/issues/711) - broadcasting a ByteBuffer
16+
*[Issue 699](https://github.com/TooTallNate/Java-WebSocket/issues/699) - Enable and Disable ping/pong
17+
*[PR 738](https://github.com/TooTallNate/Java-WebSocket/pull/738) - Adjust readme
18+
*[PR 737](https://github.com/TooTallNate/Java-WebSocket/pull/737) - Prepare for automatic snapshot deploy
19+
*[PR 724](https://github.com/TooTallNate/Java-WebSocket/pull/724) - added a timeout option for connectBlocking
20+
*[PR 712](https://github.com/TooTallNate/Java-WebSocket/pull/712) - Added a broadcast method for ByteBuffers
21+
*[PR 708](https://github.com/TooTallNate/Java-WebSocket/pull/708) - Enable and Disable ping/pong
22+
23+
#### Refactoring
24+
25+
*[PR 739](https://github.com/TooTallNate/Java-WebSocket/pull/739) - Exception when using reconnect in websocket thread
26+
*[PR 736](https://github.com/TooTallNate/Java-WebSocket/pull/736) - Change example section
27+
*[PR 733](https://github.com/TooTallNate/Java-WebSocket/pull/733) - Remove static from synchronize object
28+
*[PR 702](https://github.com/TooTallNate/Java-WebSocket/pull/702) - Removed assertion from WebSocketImpl.isOpen (see #694)
29+
*[PR 682](https://github.com/TooTallNate/Java-WebSocket/pull/682) - Deprecate Connecting and additional tests
30+
31+
In this release 4 issues and 13 pull requests were closed.
32+
33+
## Version Release 1.3.8 (2018-03-05)
34+
35+
#### Bugs Fixed
36+
37+
*[Issue 668](https://github.com/TooTallNate/Java-WebSocket/issues/668) - When a server fails to start it does not cleanup its WebSocketWorker threads
38+
*[PR 662](https://github.com/TooTallNate/Java-WebSocket/pull/662) - NPE on already bound port
39+
40+
#### New Features
41+
42+
*[Issue 256](https://github.com/TooTallNate/Java-WebSocket/issues/256) - how to reconnect websocket ([PR 654](https://github.com/TooTallNate/Java-WebSocket/pull/654))
43+
*[PR 654](https://github.com/TooTallNate/Java-WebSocket/pull/654) - WebSocketClient supports reconnecting
44+
*[PR 651](https://github.com/TooTallNate/Java-WebSocket/pull/651) - Support for close code 1012-1014
45+
46+
#### Refactoring
47+
48+
*[Issue 669](https://github.com/TooTallNate/Java-WebSocket/issues/669) - Include information in the onClose call for the connection lost detection ([PR 671](https://github.com/TooTallNate/Java-WebSocket/pull/671))
49+
*[Issue 666](https://github.com/TooTallNate/Java-WebSocket/issues/666) - Give the main WebSocketClient thread and AbstractWebSocket Timer a name ([PR 667](https://github.com/TooTallNate/Java-WebSocket/pull/667))
50+
*[PR 675](https://github.com/TooTallNate/Java-WebSocket/pull/675) - Change thread name
51+
*[PR 671](https://github.com/TooTallNate/Java-WebSocket/pull/671) - Include reason for dc due to lost connection detection
52+
*[PR 667](https://github.com/TooTallNate/Java-WebSocket/pull/667) - Give all threads a custom name
53+
54+
In this release 4 issues and 6 pull requests were closed.
55+
56+
## Version Release 1.3.7 (2017-12-11)
57+
58+
#### Bugs Fixed
59+
60+
*[Issue 621](https://github.com/TooTallNate/Java-WebSocket/issues/621) - conn.close() in server's onOpen method causes null pointer exception ([PR 622](https://github.com/TooTallNate/Java-WebSocket/pull/622))
61+
*[Issue 620](https://github.com/TooTallNate/Java-WebSocket/issues/620) - Investigate cause for #580 ([PR 628](https://github.com/TooTallNate/Java-WebSocket/pull/628))
62+
*[Issue 609](https://github.com/TooTallNate/Java-WebSocket/issues/609) - A connection will be in readystate Open when onWebSocketClose is called ([PR 610](https://github.com/TooTallNate/Java-WebSocket/pull/610))
63+
*[Issue 606](https://github.com/TooTallNate/Java-WebSocket/issues/606) - WebsocketNotConnectedException in Timer-0 ping
64+
*[PR 628](https://github.com/TooTallNate/Java-WebSocket/pull/628) - Graceful shutdown on stop()
65+
*[PR 622](https://github.com/TooTallNate/Java-WebSocket/pull/622) - Fix for #621
66+
*[PR 610](https://github.com/TooTallNate/Java-WebSocket/pull/610) - Check if connection is open on sendPing & change readystate on closeConnection
67+
68+
#### New Features
69+
70+
*[Issue 608](https://github.com/TooTallNate/Java-WebSocket/issues/608) - Sec-WebSocket-Protocol header not supported ([PR 614](https://github.com/TooTallNate/Java-WebSocket/pull/614))
71+
*[PR 627](https://github.com/TooTallNate/Java-WebSocket/pull/627) - Added setAttachment and getAttachment to WebSocket interface
72+
*[PR 614](https://github.com/TooTallNate/Java-WebSocket/pull/614) - Protocol
73+
74+
#### Refactoring
75+
76+
*[PR 635](https://github.com/TooTallNate/Java-WebSocket/pull/635) - Mark AbstractClientProxyChannel as deprecated
77+
*[PR 614](https://github.com/TooTallNate/Java-WebSocket/pull/614) - Protocol
78+
*[PR 610](https://github.com/TooTallNate/Java-WebSocket/pull/610) - Check if connection is open on sendPing & change readystate on closeConnection
79+
80+
In this release 5 issues and 8 pull requests were closed.
81+
82+
## Version Release 1.3.6 (2017-11-09)
83+
84+
#### Bugs Fixed
85+
86+
*[Issue 579](https://github.com/TooTallNate/Java-WebSocket/issues/579) - Exception with sending ping without server access
87+
*[PR 603](https://github.com/TooTallNate/Java-WebSocket/pull/603) - Check for sending a close frame
88+
89+
#### Refactoring
90+
91+
*[Issue 577](https://github.com/TooTallNate/Java-WebSocket/issues/577) - Improve onClose behaviour on client side
92+
*[PR 597](https://github.com/TooTallNate/Java-WebSocket/pull/597) - Code cleanups
93+
*[PR 596](https://github.com/TooTallNate/Java-WebSocket/pull/596) - Improved OpeningHandshakeRejection test
94+
*[PR 591](https://github.com/TooTallNate/Java-WebSocket/pull/591) - Adjusted examples
95+
*[PR 589](https://github.com/TooTallNate/Java-WebSocket/pull/589) - Include whole invalid status line
96+
*[PR 578](https://github.com/TooTallNate/Java-WebSocket/pull/578) - Refactoring and improved onClose behaviour
97+
98+
In this release 2 issues and 6 pull requests were closed.
99+
100+
## Version Release 1.3.5 (2017-10-13)
101+
102+
#### Bugs Fixed
103+
104+
*[Issue 564](https://github.com/TooTallNate/Java-WebSocket/issues/564) - Continuous binary getting swallowed? ([PR 570](https://github.com/TooTallNate/Java-WebSocket/pull/570))
105+
*[Issue 530](https://github.com/TooTallNate/Java-WebSocket/issues/530) - onWebsocketHandshakeReceivedAsServer throwing InvalidDataException has no effect
106+
*[Issue 512](https://github.com/TooTallNate/Java-WebSocket/issues/512) - AssertionError in WebSocketServer.removeConnection
107+
*[Issue 508](https://github.com/TooTallNate/Java-WebSocket/issues/508) - Ant fails due to missing `dist/` directory
108+
*[Issue 504](https://github.com/TooTallNate/Java-WebSocket/issues/504) - Clean up connections after connection closed
109+
*[Issue 390](https://github.com/TooTallNate/Java-WebSocket/issues/390) - Websocket server returning 401; can't handle on client side
110+
*[PR 506](https://github.com/TooTallNate/Java-WebSocket/pull/506) - Connections dont always get cleaned up after lost connection
111+
112+
#### New Features
113+
114+
*[Issue 528](https://github.com/TooTallNate/Java-WebSocket/issues/528) - so_reuseaddr
115+
*[Issue 463](https://github.com/TooTallNate/Java-WebSocket/issues/463) - Support for Compression Extensions for WebSocket
116+
*[PR 529](https://github.com/TooTallNate/Java-WebSocket/pull/529) - Added setter for SO_REUSEADDR
117+
*[PR 510](https://github.com/TooTallNate/Java-WebSocket/pull/510) - Add true WSS support to WebSocketClient
118+
119+
#### Refactoring
120+
121+
*[Issue 545](https://github.com/TooTallNate/Java-WebSocket/issues/545) - java.io.IOException: Broken pipe
122+
*[Issue 539](https://github.com/TooTallNate/Java-WebSocket/issues/539) - Improve memory usage
123+
*[Issue 516](https://github.com/TooTallNate/Java-WebSocket/issues/516) - Improve handling of IOExceptions causing eot()
124+
*[PR 558](https://github.com/TooTallNate/Java-WebSocket/pull/558) - Code cleanups
125+
*[PR 553](https://github.com/TooTallNate/Java-WebSocket/pull/553) - Removal of deprecated drafts
126+
*[PR 510](https://github.com/TooTallNate/Java-WebSocket/pull/510) - Add true WSS support to WebSocketClient
127+
*[PR 500](https://github.com/TooTallNate/Java-WebSocket/pull/500) - Making WebSocket.send() thread-safe
128+
129+
In this release 11 issues and 7 pull requests were closed.
130+
131+
## Version Release 1.3.4 (2017-06-02)
132+
133+
#### Breaking Changes
134+
135+
*[Issue 478](https://github.com/TooTallNate/Java-WebSocket/issues/478) - Draft_10, Draft_17, Draft_75 and Draft_76 are now deprecated
136+
137+
#### Bugs Fixed
138+
139+
*[Issue 484](https://github.com/TooTallNate/Java-WebSocket/issues/484) - Problems with WSS running on linux and Edge(or ie) browser
140+
*[Issue 481](https://github.com/TooTallNate/Java-WebSocket/issues/481) - No Javadoc attached when using from Gradle
141+
*[Issue 473](https://github.com/TooTallNate/Java-WebSocket/issues/473) - Improve lost connection detection
142+
*[Issue 466](https://github.com/TooTallNate/Java-WebSocket/issues/466) - Instability on WSS Connections, only works when one client abandon connection
143+
*[Issue 465](https://github.com/TooTallNate/Java-WebSocket/issues/465) - Bad rsv 4 on android
144+
*[Issue 294](https://github.com/TooTallNate/Java-WebSocket/issues/294) - Issue in SSL implementation : protocole ws:// is always use in Draft_76.java
145+
*[Issue 222](https://github.com/TooTallNate/Java-WebSocket/issues/222) - Worker threads do not close if bind() fails
146+
*[Issue 120](https://github.com/TooTallNate/Java-WebSocket/issues/120) - Closing wss connections might not work as expected
147+
*[PR 477](https://github.com/TooTallNate/Java-WebSocket/pull/477) - Fix for #222
148+
*[PR 472](https://github.com/TooTallNate/Java-WebSocket/pull/472) - Fix for #466
149+
*[PR 470](https://github.com/TooTallNate/Java-WebSocket/pull/470) - Fix #465
150+
151+
#### New Features
152+
153+
*[PR 497](https://github.com/TooTallNate/Java-WebSocket/pull/497) - Added new AutobahnServerTest for SSL and fixed errors in closeframe
154+
*[PR 493](https://github.com/TooTallNate/Java-WebSocket/pull/493) - Clear implementations for frames and SSLWebsocketServerFactory
155+
*[PR 489](https://github.com/TooTallNate/Java-WebSocket/pull/489) - Possibility to override worker thread allocation logic in WebSocketSe…
156+
*[PR 487](https://github.com/TooTallNate/Java-WebSocket/pull/487) - Example for LetsEncrypt
157+
*[PR 483](https://github.com/TooTallNate/Java-WebSocket/pull/483) - Introduction of Draft_6455
158+
*[PR 480](https://github.com/TooTallNate/Java-WebSocket/pull/480) - Lostconnection
159+
160+
#### Refactoring
161+
162+
*[Issue 473](https://github.com/TooTallNate/Java-WebSocket/issues/473) - Improve lost connection detection
163+
*[Issue 222](https://github.com/TooTallNate/Java-WebSocket/issues/222) - Worker threads do not close if bind() fails
164+
*[PR 493](https://github.com/TooTallNate/Java-WebSocket/pull/493) - Clear implementations for frames and SSLWebsocketServerFactory
165+
*[PR 488](https://github.com/TooTallNate/Java-WebSocket/pull/488) - New SSLSocketChannel
166+
*[PR 486](https://github.com/TooTallNate/Java-WebSocket/pull/486) - ByteBuffer and JUnitTests
167+
*[PR 483](https://github.com/TooTallNate/Java-WebSocket/pull/483) - Introduction of Draft_6455
168+
*[PR 480](https://github.com/TooTallNate/Java-WebSocket/pull/480) - Lostconnection
169+
*[PR 469](https://github.com/TooTallNate/Java-WebSocket/pull/469) - Cleanups & JavaDocs
170+
171+
In this release 11 issues and 15 pull requests were closed.
172+
173+
## Version Release 1.3.3 (2017-04-26)
174+
175+
#### Bugs Fixed
176+
177+
*[Issue 458](https://github.com/TooTallNate/Java-WebSocket/issues/458) - 100% cpu when using SSL
178+
*[Issue 362](https://github.com/TooTallNate/Java-WebSocket/issues/362) - race problem when starting server with port 0
179+
*[Issue 302](https://github.com/TooTallNate/Java-WebSocket/issues/302) - Client blocking connect and close methods return too soon
180+
181+
#### New Features
182+
183+
*[Issue 452](https://github.com/TooTallNate/Java-WebSocket/issues/452) - Unable to verify hostname after handshake
184+
*[Issue 339](https://github.com/TooTallNate/Java-WebSocket/issues/339) - setTCPNoDelay inaccessible
185+
*[Issue 271](https://github.com/TooTallNate/Java-WebSocket/issues/271) - There is no notification for websocket server success start
186+
*[PR 462](https://github.com/TooTallNate/Java-WebSocket/pull/462) - Make TCP_NODELAY accessible
187+
188+
In this release 6 issues and 1 pull request were closed.

‎src/main/java/org/java_websocket/drafts/Draft_6455.java‎

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ private Framedata translateSingleFrame( ByteBuffer buffer ) throws IncompleteExc
476476
Opcodeoptcode = toOpcode( ( byte ) ( b1 & 15 ) );
477477

478478
if( !( payloadlength >= 0 && payloadlength <= 125 ) ){
479-
payloadlength = translateSingleFramePayloadLength(buffer, optcode, payloadlength ,maxpacketsize, realpacketsize);
479+
TranslatedPayloadMetaDatapayloadData = translateSingleFramePayloadLength(buffer, optcode, payloadlength ,maxpacketsize, realpacketsize);
480+
payloadlength = payloadData.getPayloadLength();
481+
realpacketsize = payloadData.getRealPackageSize();
480482
}
481483
translateSingleFrameCheckLengthLimit(payloadlength);
482484
realpacketsize += ( mask ? 4 : 0 );
@@ -516,14 +518,15 @@ private Framedata translateSingleFrame( ByteBuffer buffer ) throws IncompleteExc
516518
* @param optcode the decoded optcode
517519
* @param oldPayloadlength the old payload length
518520
* @param maxpacketsize the max packet size allowed
519-
* @param realpacketsize the real packet size
520-
* @return the new payload length
521+
* @param oldRealpacketsize the real packet size
522+
* @return the new payload data containing new payload length and new packet size
521523
* @throws InvalidFrameException thrown if a control frame has an invalid length
522524
* @throws IncompleteException if the maxpacketsize is smaller than the realpackagesize
523525
* @throws LimitExceededException if the payload length is to big
524526
*/
525-
privateinttranslateSingleFramePayloadLength(ByteBufferbuffer, Opcodeoptcode, intoldPayloadlength, intmaxpacketsize, intrealpacketsize) throwsInvalidFrameException, IncompleteException, LimitExceededException{
526-
intpayloadlength = oldPayloadlength;
527+
privateTranslatedPayloadMetaDatatranslateSingleFramePayloadLength(ByteBufferbuffer, Opcodeoptcode, intoldPayloadlength, intmaxpacketsize, intoldRealpacketsize) throwsInvalidFrameException, IncompleteException, LimitExceededException{
528+
intpayloadlength = oldPayloadlength,
529+
realpacketsize = oldRealpacketsize;
527530
if( optcode == Opcode.PING || optcode == Opcode.PONG || optcode == Opcode.CLOSING ){
528531
log.trace( "Invalid frame: more than 125 octets" );
529532
thrownewInvalidFrameException( "more than 125 octets" );
@@ -546,7 +549,7 @@ private int translateSingleFramePayloadLength(ByteBuffer buffer, Opcode optcode,
546549
translateSingleFrameCheckLengthLimit(length);
547550
payloadlength = ( int ) length;
548551
}
549-
returnpayloadlength;
552+
returnnewTranslatedPayloadMetaData(payloadlength, realpacketsize);
550553
}
551554

552555
/**
@@ -1035,4 +1038,22 @@ private long getByteBufferListSize(){
10351038
}
10361039
returntotalSize;
10371040
}
1041+
1042+
privateclassTranslatedPayloadMetaData{
1043+
privateintpayloadLength;
1044+
privateintrealPackageSize;
1045+
1046+
privateintgetPayloadLength(){
1047+
returnpayloadLength;
1048+
}
1049+
1050+
privateintgetRealPackageSize(){
1051+
returnrealPackageSize;
1052+
}
1053+
1054+
TranslatedPayloadMetaData(intnewPayloadLength, intnewRealPackageSize){
1055+
this.payloadLength = newPayloadLength;
1056+
this.realPackageSize = newRealPackageSize;
1057+
}
1058+
}
10381059
}

‎src/test/java/org/java_websocket/exceptions/InvalidEncodingExceptionTest.java‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@
2525

2626
packageorg.java_websocket.exceptions;
2727

28-
importorg.java_websocket.enums.Opcode;
29-
importorg.java_websocket.framing.BinaryFrame;
30-
importorg.java_websocket.framing.DataFrame;
3128
importorg.junit.Test;
32-
importorg.omg.CORBA.DynAnyPackage.Invalid;
3329

3430
importjava.io.UnsupportedEncodingException;
3531

0 commit comments

Comments
(0)