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
77f1029e
Commit
77f1029e
authored
9 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
http: a stream hash for h2 multiplexing
parent
7957d2eb
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
+19
-3
19 additions, 3 deletions
lib/http2.c
with
19 additions
and
3 deletions
lib/http2.c
+
19
−
3
View file @
77f1029e
...
...
@@ -564,6 +564,11 @@ static nghttp2_settings_entry settings[] = {
#define H2_BUFSIZE 4096
static
void
freestreamentry
(
void
*
freethis
)
{
(
void
)
freethis
;
}
/*
* Initialize nghttp2 for a Curl connection
*/
...
...
@@ -625,9 +630,11 @@ CURLcode Curl_http2_init(struct connectdata *conn)
}
rc
=
Curl_hash_init
(
&
conn
->
proto
.
httpc
.
streamsh
,
7
,
Curl_hash_str
,
Curl_str_key_compare
,
NULL
);
if
(
rc
)
Curl_str_key_compare
,
freestreamentry
);
if
(
rc
)
{
failf
(
conn
->
data
,
"Couldn't init stream hash!"
);
return
CURLE_OUT_OF_MEMORY
;
/* most likely at least */
}
}
return
CURLE_OK
;
}
...
...
@@ -965,9 +972,18 @@ static ssize_t http2_send(struct connectdata *conn, int sockindex,
return
-
1
;
}
infof
(
conn
->
data
,
"Using Stream ID: %x
\n
"
,
stream_id
);
infof
(
conn
->
data
,
"Using Stream ID: %x (easy handle %p)
\n
"
,
stream_id
,
conn
->
data
);
stream
->
stream_id
=
stream_id
;
/* put the SessionHandle in the hash with the stream_id as key */
if
(
!
Curl_hash_add
(
&
httpc
->
streamsh
,
&
stream
->
stream_id
,
sizeof
(
stream_id
),
conn
->
data
))
{
failf
(
conn
->
data
,
"Couldn't add stream to hash!"
);
*
err
=
CURLE_OUT_OF_MEMORY
;
return
-
1
;
}
rv
=
nghttp2_session_send
(
httpc
->
h2
);
if
(
rv
!=
0
)
{
...
...
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