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
13dbb41c
Commit
13dbb41c
authored
11 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
http2: first embryo toward Upgrade:
parent
e5c2354f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/http.c
+10
-0
10 additions, 0 deletions
lib/http.c
lib/http2.c
+19
-0
19 additions, 0 deletions
lib/http2.c
lib/http2.h
+10
-0
10 additions, 0 deletions
lib/http2.h
with
39 additions
and
0 deletions
lib/http.c
+
10
−
0
View file @
13dbb41c
...
...
@@ -75,6 +75,7 @@
#include
"non-ascii.h"
#include
"bundles.h"
#include
"pipeline.h"
#include
"http2.h"
#define _MPRINTF_REPLACE
/* use our functions only */
#include
<curl/mprintf.h>
...
...
@@ -2179,6 +2180,15 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
if
(
result
)
return
result
;
if
(
!
(
conn
->
handler
->
flags
&
PROTOPT_SSL
)
&&
(
data
->
set
.
httpversion
==
CURL_HTTP_VERSION_2_0
))
{
/* append HTTP2 updrade magic stuff to the HTTP request if it isn't done
over SSL */
result
=
Curl_http2_request
(
req_buffer
,
conn
);
if
(
result
)
return
result
;
}
#if !defined(CURL_DISABLE_COOKIES)
if
(
data
->
cookies
||
addcookies
)
{
struct
Cookie
*
co
=
NULL
;
/* no cookies from start */
...
...
This diff is collapsed.
Click to expand it.
lib/http2.c
+
19
−
0
View file @
13dbb41c
...
...
@@ -27,7 +27,9 @@
#include
<curl/mprintf.h>
#include
<nghttp2/nghttp2.h>
#include
"urldata.h"
#include
"http2.h"
#include
"http.h"
/*
* Store nghttp2 version info in this buffer, Prefix with a space. Return
...
...
@@ -39,4 +41,21 @@ int Curl_http2_ver(char *p, size_t len)
return
snprintf
(
p
,
len
,
" nghttp2/%s"
,
h2
->
version_str
);
}
/*
* Append headers to ask for a HTTP1.1 to HTTP2 upgrade.
*/
CURLcode
Curl_http2_request
(
Curl_send_buffer
*
req
,
struct
connectdata
*
conn
)
{
const
char
*
base64
=
"AABBCC"
;
/* a fake string to start with */
CURLcode
result
=
Curl_add_bufferf
(
req
,
"Connection: Upgrade, HTTP2-Settings
\r\n
"
"Upgrade: HTTP/2.0
\r\n
"
"HTTP2-Settings: %s
\r\n
"
,
base64
);
(
void
)
conn
;
return
result
;
}
#endif
This diff is collapsed.
Click to expand it.
lib/http2.h
+
10
−
0
View file @
13dbb41c
...
...
@@ -22,11 +22,21 @@
*
***************************************************************************/
#include
"curl_setup.h"
#ifdef USE_NGHTTP2
#include
"http.h"
/*
* Store nghttp2 version info in this buffer, Prefix with a space. Return
* total length written.
*/
int
Curl_http2_ver
(
char
*
p
,
size_t
len
);
CURLcode
Curl_http2_request
(
Curl_send_buffer
*
req
,
struct
connectdata
*
conn
);
#else
/* USE_NGHTTP2 */
#define Curl_http2_request(x,y) CURLE_OK
#endif
#endif
/* HEADER_CURL_HTTP2_H */
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