Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
aeaa8171
Commit
aeaa8171
authored
Sep 26, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
websocket: remove use of container/vector
R=golang-dev, r CC=golang-dev, ukai
https://golang.org/cl/5140046
parent
c68ae9d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
src/pkg/websocket/hixie.go
src/pkg/websocket/hixie.go
+9
-9
No files found.
src/pkg/websocket/hixie.go
View file @
aeaa8171
...
...
@@ -10,7 +10,6 @@ package websocket
import
(
"bufio"
"bytes"
"container/vector"
"crypto/md5"
"encoding/binary"
"fmt"
...
...
@@ -348,16 +347,17 @@ func hixie76ClientHandshake(config *Config, br *bufio.Reader, bw *bufio.Writer)
bw
.
WriteString
(
"GET "
+
config
.
Location
.
RawPath
+
" HTTP/1.1
\r\n
"
)
// Step 6-14. push request headers in fields.
var
fields
vector
.
StringVector
fields
.
Push
(
"Upgrade: WebSocket
\r\n
"
)
fields
.
Push
(
"Connection: Upgrade
\r\n
"
)
fields
.
Push
(
"Host: "
+
config
.
Location
.
Host
+
"
\r\n
"
)
fields
.
Push
(
"Origin: "
+
config
.
Origin
.
String
()
+
"
\r\n
"
)
fields
:=
[]
string
{
"Upgrade: WebSocket
\r\n
"
,
"Connection: Upgrade
\r\n
"
,
"Host: "
+
config
.
Location
.
Host
+
"
\r\n
"
,
"Origin: "
+
config
.
Origin
.
String
()
+
"
\r\n
"
,
}
if
len
(
config
.
Protocol
)
>
0
{
if
len
(
config
.
Protocol
)
!=
1
{
return
ErrBadWebSocketProtocol
}
fields
.
Push
(
"Sec-WebSocket-Protocol: "
+
config
.
Protocol
[
0
]
+
"
\r\n
"
)
fields
=
append
(
fields
,
"Sec-WebSocket-Protocol: "
+
config
.
Protocol
[
0
]
+
"
\r\n
"
)
}
// TODO(ukai): Step 15. send cookie if any.
...
...
@@ -378,8 +378,8 @@ func hixie76ClientHandshake(config *Config, br *bufio.Reader, bw *bufio.Writer)
}
number2
=
uint32
(
n
)
}
fields
.
Push
(
"Sec-WebSocket-Key1: "
+
key1
+
"
\r\n
"
)
fields
.
Push
(
"Sec-WebSocket-Key2: "
+
key2
+
"
\r\n
"
)
fields
=
append
(
fields
,
"Sec-WebSocket-Key1: "
+
key1
+
"
\r\n
"
)
fields
=
append
(
fields
,
"Sec-WebSocket-Key2: "
+
key2
+
"
\r\n
"
)
// Step 24. shuffle fields and send them out.
for
i
:=
1
;
i
<
len
(
fields
);
i
++
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment