summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-06-09 00:08:36 +0700
committerShulhan <ms@kilabit.info>2022-06-09 00:08:55 +0700
commit6acd82667aa41d5334c4f2e313cde7db66d5a2d0 (patch)
tree4c23f7d70575f15259629b2656cd91da2ad487be
parentb3220083906406634edcd83875e8816d6c04c089 (diff)
downloadpakakeh.go-6acd82667aa41d5334c4f2e313cde7db66d5a2d0.tar.xz
lib/websocket: realign struct Handshake
This realign save 40 bytes allocation, from 160 to 120 bytes.
-rw-r--r--lib/websocket/handshake.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/websocket/handshake.go b/lib/websocket/handshake.go
index c26b8226..434c4cab 100644
--- a/lib/websocket/handshake.go
+++ b/lib/websocket/handshake.go
@@ -70,17 +70,16 @@ var (
// Handshake contains the websocket HTTP handshake request.
type Handshake struct {
+ URL *url.URL
+ Header http.Header
+ Host []byte
+ Key []byte
+ Extensions []byte
+ Protocol []byte
+ raw []byte
start int
end int
headerFlags int
- raw []byte
-
- URL *url.URL
- Host []byte
- Key []byte
- Extensions []byte
- Protocol []byte
- Header http.Header
}
func newHandshake(req []byte) (h *Handshake, err error) {