Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libwebsockets
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Fork
libwebsockets
Commits
a7521deb
Commit
a7521deb
authored
Feb 18, 2013
by
Andy Green
Browse files
Options
Downloads
Patches
Plain Diff
migrate client hs and c_port into ah
Signed-off-by:
Andy Green
<
andy.green@linaro.org
>
parent
6636eec8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/client-handshake.c
+4
-4
4 additions, 4 deletions
lib/client-handshake.c
lib/client.c
+4
-4
4 additions, 4 deletions
lib/client.c
lib/private-libwebsockets.h
+4
-4
4 additions, 4 deletions
lib/private-libwebsockets.h
with
12 additions
and
12 deletions
lib/client-handshake.c
+
4
−
4
View file @
a7521deb
...
...
@@ -24,7 +24,7 @@ struct libwebsocket *__libwebsocket_client_connect_2(
/*Proxy-authorization: basic aGVsbG86d29ybGQ= */
"
\x0d\x0a
"
,
lws_hdr_simple_ptr
(
wsi
,
_WSI_TOKEN_CLIENT_PEER_ADDRESS
),
wsi
->
u
.
hdr
.
c_port
);
wsi
->
u
.
hdr
.
ah
->
c_port
);
/* OK from now on we talk via the proxy, so connect to that */
...
...
@@ -35,7 +35,7 @@ struct libwebsocket *__libwebsocket_client_connect_2(
if
(
lws_hdr_simple_create
(
wsi
,
_WSI_TOKEN_CLIENT_PEER_ADDRESS
,
context
->
http_proxy_address
))
goto
oom4
;
wsi
->
u
.
hdr
.
c_port
=
context
->
http_proxy_port
;
wsi
->
u
.
hdr
.
ah
->
c_port
=
context
->
http_proxy_port
;
}
/*
...
...
@@ -60,7 +60,7 @@ struct libwebsocket *__libwebsocket_client_connect_2(
}
server_addr
.
sin_family
=
AF_INET
;
server_addr
.
sin_port
=
htons
(
wsi
->
u
.
hdr
.
c_port
);
server_addr
.
sin_port
=
htons
(
wsi
->
u
.
hdr
.
ah
->
c_port
);
server_addr
.
sin_addr
=
*
((
struct
in_addr
*
)
server_hostent
->
h_addr
);
bzero
(
&
server_addr
.
sin_zero
,
8
);
...
...
@@ -210,7 +210,7 @@ libwebsocket_client_connect(struct libwebsocket_context *context,
* we're not necessarily in a position to action these right away,
* stash them... we only need during connect phase so u.hdr is fine
*/
wsi
->
u
.
hdr
.
c_port
=
port
;
wsi
->
u
.
hdr
.
ah
->
c_port
=
port
;
if
(
lws_hdr_simple_create
(
wsi
,
_WSI_TOKEN_CLIENT_PEER_ADDRESS
,
address
))
goto
bail1
;
...
...
This diff is collapsed.
Click to expand it.
lib/client.c
+
4
−
4
View file @
a7521deb
...
...
@@ -589,9 +589,9 @@ check_accept:
*/
p
=
lws_hdr_simple_ptr
(
wsi
,
WSI_TOKEN_ACCEPT
);
if
(
strcmp
(
p
,
wsi
->
u
.
hdr
.
initial_handshake_hash_base64
))
{
if
(
strcmp
(
p
,
wsi
->
u
.
hdr
.
ah
->
initial_handshake_hash_base64
))
{
lwsl_warn
(
"lws_client_int_s_hs: accept %s wrong vs %s
\n
"
,
p
,
wsi
->
u
.
hdr
.
initial_handshake_hash_base64
);
wsi
->
u
.
hdr
.
ah
->
initial_handshake_hash_base64
);
goto
bail2
;
}
...
...
@@ -845,8 +845,8 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context,
SHA1
((
unsigned
char
*
)
buf
,
n
,
(
unsigned
char
*
)
hash
);
lws_b64_encode_string
(
hash
,
20
,
wsi
->
u
.
hdr
.
initial_handshake_hash_base64
,
sizeof
(
wsi
->
u
.
hdr
.
initial_handshake_hash_base64
));
wsi
->
u
.
hdr
.
ah
->
initial_handshake_hash_base64
,
sizeof
(
wsi
->
u
.
hdr
.
ah
->
initial_handshake_hash_base64
));
return
p
;
}
...
...
This diff is collapsed.
Click to expand it.
lib/private-libwebsockets.h
+
4
−
4
View file @
a7521deb
...
...
@@ -319,16 +319,16 @@ struct allocated_headers {
unsigned
char
frag_index
[
WSI_TOKEN_COUNT
];
struct
lws_fragments
frags
[
WSI_TOKEN_COUNT
*
2
];
char
data
[
LWS_MAX_HEADER_LEN
];
#ifndef LWS_NO_CLIENT
char
initial_handshake_hash_base64
[
30
];
unsigned
short
c_port
;
#endif
};
struct
_lws_header_related
{
struct
allocated_headers
*
ah
;
short
lextable_pos
;
unsigned
char
parser_state
;
/* enum lws_token_indexes */
#ifndef LWS_NO_CLIENT
char
initial_handshake_hash_base64
[
30
];
unsigned
short
c_port
;
#endif
};
struct
_lws_websocket_related
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment