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 project is archived. Its data is
read-only
.
Show more breadcrumbs
Fork
libwebsockets
Commits
b84f3e50
Commit
b84f3e50
authored
Mar 26, 2019
by
Diana Ren
Committed by
Andy Green
Mar 27, 2019
Browse files
Options
Downloads
Patches
Plain Diff
Backport
e02a9998
into v2.4 with dependent changes included
parent
5ebc982c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/client/client-handshake.c
+18
-4
18 additions, 4 deletions
lib/client/client-handshake.c
lib/private-libwebsockets.h
+3
-0
3 additions, 0 deletions
lib/private-libwebsockets.h
with
21 additions
and
4 deletions
lib/client/client-handshake.c
+
18
−
4
View file @
b84f3e50
...
@@ -424,6 +424,7 @@ oom4:
...
@@ -424,6 +424,7 @@ oom4:
goto
failed1
;
goto
failed1
;
lws_remove_from_timeout_list
(
wsi
);
lws_remove_from_timeout_list
(
wsi
);
lws_header_table_detach
(
wsi
,
0
);
lws_header_table_detach
(
wsi
,
0
);
lws_client_stash_destroy
(
wsi
);
lws_free
(
wsi
);
lws_free
(
wsi
);
return
NULL
;
return
NULL
;
...
@@ -683,6 +684,15 @@ html_parser_cb(const hubbub_token *token, void *pw)
...
@@ -683,6 +684,15 @@ html_parser_cb(const hubbub_token *token, void *pw)
}
}
#endif
#endif
void
lws_client_stash_destroy
(
struct
lws
*
wsi
)
{
if
(
!
wsi
||
!
wsi
->
u
.
hdr
.
stash
)
return
;
lws_free_set_NULL
(
wsi
->
u
.
hdr
.
stash
);
}
LWS_VISIBLE
struct
lws
*
LWS_VISIBLE
struct
lws
*
lws_client_connect_via_info
(
struct
lws_client_connect_info
*
i
)
lws_client_connect_via_info
(
struct
lws_client_connect_info
*
i
)
{
{
...
@@ -763,7 +773,7 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)
...
@@ -763,7 +773,7 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)
wsi
->
u
.
hdr
.
stash
=
lws_malloc
(
sizeof
(
*
wsi
->
u
.
hdr
.
stash
),
"client stash"
);
wsi
->
u
.
hdr
.
stash
=
lws_malloc
(
sizeof
(
*
wsi
->
u
.
hdr
.
stash
),
"client stash"
);
if
(
!
wsi
->
u
.
hdr
.
stash
)
{
if
(
!
wsi
->
u
.
hdr
.
stash
)
{
lwsl_err
(
"%s: OOM
\n
"
,
__func__
);
lwsl_err
(
"%s: OOM
\n
"
,
__func__
);
goto
bail
;
goto
bail
1
;
}
}
wsi
->
u
.
hdr
.
stash
->
origin
[
0
]
=
'\0'
;
wsi
->
u
.
hdr
.
stash
->
origin
[
0
]
=
'\0'
;
...
@@ -777,6 +787,7 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)
...
@@ -777,6 +787,7 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)
sizeof
(
wsi
->
u
.
hdr
.
stash
->
path
)
-
1
);
sizeof
(
wsi
->
u
.
hdr
.
stash
->
path
)
-
1
);
strncpy
(
wsi
->
u
.
hdr
.
stash
->
host
,
i
->
host
,
strncpy
(
wsi
->
u
.
hdr
.
stash
->
host
,
i
->
host
,
sizeof
(
wsi
->
u
.
hdr
.
stash
->
host
)
-
1
);
sizeof
(
wsi
->
u
.
hdr
.
stash
->
host
)
-
1
);
if
(
i
->
origin
)
if
(
i
->
origin
)
strncpy
(
wsi
->
u
.
hdr
.
stash
->
origin
,
i
->
origin
,
strncpy
(
wsi
->
u
.
hdr
.
stash
->
origin
,
i
->
origin
,
sizeof
(
wsi
->
u
.
hdr
.
stash
->
origin
)
-
1
);
sizeof
(
wsi
->
u
.
hdr
.
stash
->
origin
)
-
1
);
...
@@ -810,7 +821,7 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)
...
@@ -810,7 +821,7 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)
* if we failed here, the connection is already closed
* if we failed here, the connection is already closed
* and freed.
* and freed.
*/
*/
goto
bail
1
;
goto
bail
2
;
}
}
if
(
i
->
parent_wsi
)
{
if
(
i
->
parent_wsi
)
{
...
@@ -829,10 +840,13 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)
...
@@ -829,10 +840,13 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)
return
wsi
;
return
wsi
;
bail1:
lws_client_stash_destroy
(
wsi
);
bail:
bail:
lws_free
(
wsi
);
lws_free
(
wsi
);
bail
1
:
bail
2
:
if
(
i
->
pwsi
)
if
(
i
->
pwsi
)
*
i
->
pwsi
=
NULL
;
*
i
->
pwsi
=
NULL
;
...
@@ -886,7 +900,7 @@ lws_client_connect_via_info2(struct lws *wsi)
...
@@ -886,7 +900,7 @@ lws_client_connect_via_info2(struct lws *wsi)
#if defined(LWS_WITH_SOCKS5)
#if defined(LWS_WITH_SOCKS5)
if
(
!
wsi
->
vhost
->
socks_proxy_port
)
if
(
!
wsi
->
vhost
->
socks_proxy_port
)
lws_
free_set_NULL
(
wsi
->
u
.
hdr
.
stash
);
lws_
client_stash_destroy
(
wsi
);
#endif
#endif
/*
/*
...
...
...
...
This diff is collapsed.
Click to expand it.
lib/private-libwebsockets.h
+
3
−
0
View file @
b84f3e50
...
@@ -2113,6 +2113,9 @@ lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd);
...
@@ -2113,6 +2113,9 @@ lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd);
LWS_EXTERN
struct
lws
*
LWS_EXTERN
struct
lws
*
lws_client_connect_via_info2
(
struct
lws
*
wsi
);
lws_client_connect_via_info2
(
struct
lws
*
wsi
);
LWS_EXTERN
void
lws_client_stash_destroy
(
struct
lws
*
wsi
);
LWS_EXTERN
int
LWS_EXTERN
int
_lws_destroy_ah
(
struct
lws_context_per_thread
*
pt
,
struct
allocated_headers
*
ah
);
_lws_destroy_ah
(
struct
lws_context_per_thread
*
pt
,
struct
allocated_headers
*
ah
);
...
...
...
...
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