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
6f967c6e
Commit
6f967c6e
authored
Sep 21, 2019
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix errors reported by coverity scan
parent
b8a43db8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
55 deletions
+51
-55
src/HttpServer.cc
src/HttpServer.cc
+43
-50
src/shrpx_config.h
src/shrpx_config.h
+2
-1
src/shrpx_connection.cc
src/shrpx_connection.cc
+3
-3
src/shrpx_http2_session.cc
src/shrpx_http2_session.cc
+1
-0
src/shrpx_worker.h
src/shrpx_worker.h
+2
-1
No files found.
src/HttpServer.cc
View file @
6f967c6e
...
...
@@ -624,13 +624,12 @@ int Http2Handler::read_clear() {
int
rv
;
std
::
array
<
uint8_t
,
8
_k
>
buf
;
for
(;;)
{
ssize_t
nread
;
while
((
nread
=
read
(
fd_
,
buf
.
data
(),
buf
.
size
()))
==
-
1
&&
errno
==
EINTR
)
;
if
(
nread
==
-
1
)
{
if
(
errno
==
EAGAIN
||
errno
==
EWOULDBLOCK
)
{
break
;
return
write_
(
*
this
)
;
}
return
-
1
;
}
...
...
@@ -650,8 +649,6 @@ int Http2Handler::read_clear() {
}
return
-
1
;
}
break
;
}
return
write_
(
*
this
);
}
...
...
@@ -746,14 +743,13 @@ int Http2Handler::read_tls() {
ERR_clear_error
();
for
(;;)
{
auto
rv
=
SSL_read
(
ssl_
,
buf
.
data
(),
buf
.
size
());
if
(
rv
<=
0
)
{
auto
err
=
SSL_get_error
(
ssl_
,
rv
);
switch
(
err
)
{
case
SSL_ERROR_WANT_READ
:
goto
fin
;
return
write_
(
*
this
)
;
case
SSL_ERROR_WANT_WRITE
:
// renegotiation started
return
-
1
;
...
...
@@ -776,10 +772,7 @@ int Http2Handler::read_tls() {
}
return
-
1
;
}
break
;
}
fin:
return
write_
(
*
this
);
}
...
...
src/shrpx_config.h
View file @
6f967c6e
...
...
@@ -505,7 +505,8 @@ struct DownstreamAddrGroupConfig {
DownstreamAddrGroupConfig
(
const
StringRef
&
pattern
)
:
pattern
(
pattern
),
affinity
{
SessionAffinity
::
NONE
},
redirect_if_not_tls
(
false
)
{}
redirect_if_not_tls
(
false
),
timeout
{}
{}
StringRef
pattern
;
StringRef
mruby_file
;
...
...
src/shrpx_connection.cc
View file @
6f967c6e
...
...
@@ -469,9 +469,9 @@ int Connection::tls_handshake() {
<<
ERR_error_string
(
ERR_get_error
(),
nullptr
);
}
struct
iovec
iov
;
auto
iovcnt
=
tls
.
wbuf
.
riovec
(
&
iov
,
1
);
auto
nwrite
=
writev_clear
(
&
iov
,
iovcnt
);
struct
iovec
iov
[
1
]
;
auto
iovcnt
=
tls
.
wbuf
.
riovec
(
iov
,
1
);
auto
nwrite
=
writev_clear
(
iov
,
iovcnt
);
if
(
nwrite
>
0
)
{
tls
.
wbuf
.
drain
(
nwrite
);
}
...
...
src/shrpx_http2_session.cc
View file @
6f967c6e
...
...
@@ -1097,6 +1097,7 @@ int on_response_headers(Http2Session *http2session, Downstream *downstream,
auto
status
=
resp
.
fs
.
header
(
http2
::
HD__STATUS
);
// libnghttp2 guarantees this exists and can be parsed
assert
(
status
);
auto
status_code
=
http2
::
parse_http_status_code
(
status
->
value
);
resp
.
http_status
=
status_code
;
...
...
src/shrpx_worker.h
View file @
6f967c6e
...
...
@@ -190,7 +190,8 @@ struct SharedDownstreamAddr {
SharedDownstreamAddr
()
:
balloc
(
1024
,
1024
),
affinity
{
SessionAffinity
::
NONE
},
redirect_if_not_tls
{
false
}
{}
redirect_if_not_tls
{
false
},
timeout
{}
{}
SharedDownstreamAddr
(
const
SharedDownstreamAddr
&
)
=
delete
;
SharedDownstreamAddr
(
SharedDownstreamAddr
&&
)
=
delete
;
...
...
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