| Age | Commit message (Collapse) | Author |
|
|
|
|
|
Replace assignment from using ":=" to use variable declaration with
type.
Rationale: clarity and minimize duplicate temporary variables with the
same type.
|
|
|
|
|
|
Previously, we use two function to unpack frame: frameUnpack and
continueUnpack, both of this functions actually use the same logic.
This commit merge both functions into Frame's unpack() and which also
make handleChopped() to be unused on both server and client.
|
|
The method is called fin() with single parameter: the last frame that
contains finished state.
Also, use the Frames.fin method on ClientManager.finFrames, to minimize
duplicate code.
|
|
The opcode type is required to create new frame and to get the opcode in
continous frames.
|
|
Some of the methods in ClientManager and Frames should be only accessed
by internal server, not by implementor.
|
|
Another possibility is fragmented frames with one of the frame is
chopped and in the middle of it is a control FRAME. For example,
C> Frame{fin:false opcode:TEXT len:1024 payload:512}
C> payload:512 FRAME{fin:TRUE opcode:PING len:0}
C> Frame{fin:true opcode:0 len:1024 payload:1024}
|
|
Most of the cases involving out-of-range index, most of notable cases are,
* masked frame without masked data
* empty payload or payload data that contains data less than defined in
payload length
* control close frame without close code
|
|
When receiving packet from client, the underlying protocol or operating
system may buffered the packet. Client may send a single frame one at
time, but server may receive one or more frame in one packet; and vice
versa. That's the reason why the Unpack return multiple frame instead of
single frame.
|
|
Control frame actually directly handled by server when processing received
frames from client. This condition is just to make sure that we are not
messing the payload in case the Frames is used by client.
|
|
Continuing refactor, the Frames type provide methods than can used to
handle packet from other endpoint.
|
|
Continuing refactor, this commit unexport all fields in Frame to allow
user focus working with method and packet, let the technical detail
managed by library.
|
|
Most of the constants should not be used directly, as we prefer user to
use the functions or methods based access.
|
|
A type Frames is actually a wrapper to slice of frame. We prefer if
user is not directly access to underlying frames but focus on payload
instead.
|