Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
c751a6e9
Commit
c751a6e9
authored
Sep 07, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cosmetic errors
parent
2c127b5c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
7 deletions
+15
-7
lib/nghttp2_submit.c
lib/nghttp2_submit.c
+1
-1
src/HttpServer.h
src/HttpServer.h
+0
-1
src/nghttp.cc
src/nghttp.cc
+13
-4
src/nghttpd.cc
src/nghttpd.cc
+1
-1
No files found.
lib/nghttp2_submit.c
View file @
c751a6e9
...
@@ -331,7 +331,7 @@ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags,
...
@@ -331,7 +331,7 @@ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags,
if
(
nghttp2_session_get_stream
(
session
,
stream_id
)
==
NULL
)
{
if
(
nghttp2_session_get_stream
(
session
,
stream_id
)
==
NULL
)
{
return
NGHTTP2_ERR_STREAM_CLOSED
;
return
NGHTTP2_ERR_STREAM_CLOSED
;
}
}
data_frame
=
malloc
(
sizeof
(
nghttp2_
frame
));
data_frame
=
malloc
(
sizeof
(
nghttp2_
data
));
if
(
data_frame
==
NULL
)
{
if
(
data_frame
==
NULL
)
{
return
NGHTTP2_ERR_NOMEM
;
return
NGHTTP2_ERR_NOMEM
;
}
}
...
...
src/HttpServer.h
View file @
c751a6e9
...
@@ -120,7 +120,6 @@ private:
...
@@ -120,7 +120,6 @@ private:
int
fd_
;
int
fd_
;
SSL
*
ssl_
;
SSL
*
ssl_
;
int64_t
session_id_
;
int64_t
session_id_
;
uint8_t
io_flags_
;
std
::
map
<
int32_t
,
std
::
unique_ptr
<
Request
>>
id2req_
;
std
::
map
<
int32_t
,
std
::
unique_ptr
<
Request
>>
id2req_
;
size_t
left_connhd_len_
;
size_t
left_connhd_len_
;
};
};
...
...
src/nghttp.cc
View file @
c751a6e9
...
@@ -423,7 +423,8 @@ struct HttpClient {
...
@@ -423,7 +423,8 @@ struct HttpClient {
state
(
STATE_IDLE
),
state
(
STATE_IDLE
),
complete
(
0
),
complete
(
0
),
upgrade_response_complete
(
false
),
upgrade_response_complete
(
false
),
upgrade_response_status_code
(
0
)
upgrade_response_status_code
(
0
),
settings_payloadlen
(
0
)
{}
{}
~
HttpClient
()
~
HttpClient
()
...
@@ -515,13 +516,17 @@ struct HttpClient {
...
@@ -515,13 +516,17 @@ struct HttpClient {
int
on_upgrade_connect
()
int
on_upgrade_connect
()
{
{
ssize_t
rv
;
record_handshake_time
();
record_handshake_time
();
assert
(
!
reqvec
.
empty
());
assert
(
!
reqvec
.
empty
());
nghttp2_settings_entry
iv
[
16
];
nghttp2_settings_entry
iv
[
16
];
size_t
niv
=
populate_settings
(
iv
);
size_t
niv
=
populate_settings
(
iv
);
assert
(
sizeof
(
settings_payload
)
>=
8
*
niv
);
assert
(
sizeof
(
settings_payload
)
>=
8
*
niv
);
settings_payloadlen
=
rv
=
nghttp2_pack_settings_payload
(
settings_payload
,
iv
,
niv
);
nghttp2_pack_settings_payload
(
settings_payload
,
iv
,
niv
);
if
(
rv
<
0
)
{
return
-
1
;
}
settings_payloadlen
=
rv
;
auto
token68
=
base64
::
encode
(
&
settings_payload
[
0
],
auto
token68
=
base64
::
encode
(
&
settings_payload
[
0
],
&
settings_payload
[
settings_payloadlen
]);
&
settings_payload
[
settings_payloadlen
]);
util
::
to_token68
(
token68
);
util
::
to_token68
(
token68
);
...
@@ -759,7 +764,9 @@ struct HttpClient {
...
@@ -759,7 +764,9 @@ struct HttpClient {
int
level
=
0
)
int
level
=
0
)
{
{
http_parser_url
u
;
http_parser_url
u
;
http_parser_parse_url
(
uri
.
c_str
(),
uri
.
size
(),
0
,
&
u
);
if
(
http_parser_parse_url
(
uri
.
c_str
(),
uri
.
size
(),
0
,
&
u
)
!=
0
)
{
return
false
;
}
if
(
path_cache
.
count
(
uri
))
{
if
(
path_cache
.
count
(
uri
))
{
return
false
;
return
false
;
}
else
{
}
else
{
...
@@ -969,6 +976,7 @@ void check_stream_id(nghttp2_session *session, int32_t stream_id,
...
@@ -969,6 +976,7 @@ void check_stream_id(nghttp2_session *session, int32_t stream_id,
auto
client
=
get_session
(
user_data
);
auto
client
=
get_session
(
user_data
);
auto
req
=
(
Request
*
)
nghttp2_session_get_stream_user_data
(
session
,
auto
req
=
(
Request
*
)
nghttp2_session_get_stream_user_data
(
session
,
stream_id
);
stream_id
);
assert
(
req
);
client
->
streams
[
stream_id
]
=
req
;
client
->
streams
[
stream_id
]
=
req
;
req
->
record_syn_stream_time
();
req
->
record_syn_stream_time
();
}
}
...
@@ -1318,6 +1326,7 @@ ssize_t file_read_callback
...
@@ -1318,6 +1326,7 @@ ssize_t file_read_callback
{
{
auto
req
=
(
Request
*
)
nghttp2_session_get_stream_user_data
auto
req
=
(
Request
*
)
nghttp2_session_get_stream_user_data
(
session
,
stream_id
);
(
session
,
stream_id
);
assert
(
req
);
int
fd
=
source
->
fd
;
int
fd
=
source
->
fd
;
ssize_t
r
;
ssize_t
r
;
while
((
r
=
pread
(
fd
,
buf
,
length
,
req
->
data_offset
))
==
-
1
&&
while
((
r
=
pread
(
fd
,
buf
,
length
,
req
->
data_offset
))
==
-
1
&&
...
...
src/nghttpd.cc
View file @
c751a6e9
...
@@ -85,7 +85,7 @@ int main(int argc, char **argv)
...
@@ -85,7 +85,7 @@ int main(int argc, char **argv)
{
{
Config
config
;
Config
config
;
while
(
1
)
{
while
(
1
)
{
int
flag
;
int
flag
=
0
;
static
option
long_options
[]
=
{
static
option
long_options
[]
=
{
{
"daemon"
,
no_argument
,
nullptr
,
'D'
},
{
"daemon"
,
no_argument
,
nullptr
,
'D'
},
{
"htdocs"
,
required_argument
,
nullptr
,
'd'
},
{
"htdocs"
,
required_argument
,
nullptr
,
'd'
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment