Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
9787b8e9
Commit
9787b8e9
authored
11 years ago
by
Tatsuhiro Tsujikawa
Committed by
Daniel Stenberg
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
http2: free resources on disconnect
... and use Curl_safefree() instead of free()
parent
dcdbac25
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/http2.c
+24
-4
24 additions, 4 deletions
lib/http2.c
with
24 additions
and
4 deletions
lib/http2.c
+
24
−
4
View file @
9787b8e9
...
...
@@ -75,6 +75,26 @@ static int http2_getsock(struct connectdata *conn,
return
http2_perform_getsock
(
conn
,
sock
,
numsocks
);
}
static
CURLcode
http2_disconnect
(
struct
connectdata
*
conn
,
bool
dead_connection
)
{
struct
http_conn
*
httpc
=
&
conn
->
proto
.
httpc
;
(
void
)
dead_connection
;
infof
(
conn
->
data
,
"HTTP/2 DISCONNECT starts now
\n
"
);
nghttp2_session_del
(
httpc
->
h2
);
Curl_safefree
(
httpc
->
header_recvbuf
->
buffer
);
Curl_safefree
(
httpc
->
header_recvbuf
);
Curl_safefree
(
httpc
->
inbuf
);
infof
(
conn
->
data
,
"HTTP/2 DISCONNECT done
\n
"
);
return
CURLE_OK
;
}
/*
* HTTP2 handler interface. This isn't added to the general list of protocols
* but will be used at run-time when the protocol is dynamically switched from
...
...
@@ -93,7 +113,7 @@ const struct Curl_handler Curl_handler_http2 = {
http2_getsock
,
/* doing_getsock */
ZERO_NULL
,
/* domore_getsock */
http2_perform_getsock
,
/* perform_getsock */
ZERO_NULL
,
/* disconnect */
http2_disconnect
,
/* disconnect */
ZERO_NULL
,
/* readwrite */
PORT_HTTP
,
/* defport */
CURLPROTO_HTTP
,
/* protocol */
...
...
@@ -113,7 +133,7 @@ const struct Curl_handler Curl_handler_http2_ssl = {
http2_getsock
,
/* doing_getsock */
ZERO_NULL
,
/* domore_getsock */
http2_perform_getsock
,
/* perform_getsock */
ZERO_NULL
,
/* disconnect */
http2_disconnect
,
/* disconnect */
ZERO_NULL
,
/* readwrite */
PORT_HTTP
,
/* defport */
CURLPROTO_HTTP
|
CURLPROTO_HTTPS
,
/* protocol */
...
...
@@ -493,7 +513,7 @@ CURLcode Curl_http2_request_upgrade(Curl_send_buffer *req,
"Upgrade: %s
\r\n
"
"HTTP2-Settings: %s
\r\n
"
,
NGHTTP2_PROTO_VERSION_ID
,
base64
);
free
(
base64
);
Curl_safe
free
(
base64
);
k
->
upgr101
=
UPGR101_REQUESTED
;
...
...
@@ -730,7 +750,7 @@ static ssize_t http2_send(struct connectdata *conn, int sockindex,
rv
=
nghttp2_submit_request
(
httpc
->
h2
,
0
,
nva
,
nheader
,
NULL
,
NULL
);
}
free
(
nva
);
Curl_safe
free
(
nva
);
if
(
rv
!=
0
)
{
*
err
=
CURLE_SEND_ERROR
;
...
...
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
register
or
sign in
to comment