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
8bfd900b
Commit
8bfd900b
authored
Jan 07, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src, examples: Check return value
parent
40e8eaf5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
examples/client.c
examples/client.c
+7
-3
src/HttpServer.cc
src/HttpServer.cc
+5
-2
No files found.
examples/client.c
View file @
8bfd900b
...
...
@@ -152,7 +152,7 @@ static ssize_t send_callback(nghttp2_session *session _U_, const uint8_t *data,
connection
->
want_io
=
IO_NONE
;
ERR_clear_error
();
rv
=
SSL_write
(
connection
->
ssl
,
data
,
(
int
)
length
);
if
(
rv
<
0
)
{
if
(
rv
<
=
0
)
{
int
err
=
SSL_get_error
(
connection
->
ssl
,
rv
);
if
(
err
==
SSL_ERROR_WANT_WRITE
||
err
==
SSL_ERROR_WANT_READ
)
{
connection
->
want_io
=
...
...
@@ -529,8 +529,12 @@ static void fetch_uri(const struct URI *uri) {
connection
.
want_io
=
IO_NONE
;
/* Send connection header in blocking I/O mode */
SSL_write
(
ssl
,
NGHTTP2_CLIENT_CONNECTION_PREFACE
,
NGHTTP2_CLIENT_CONNECTION_PREFACE_LEN
);
rv
=
SSL_write
(
ssl
,
NGHTTP2_CLIENT_CONNECTION_PREFACE
,
NGHTTP2_CLIENT_CONNECTION_PREFACE_LEN
);
if
(
rv
<=
0
)
{
dief
(
"SSL_write failed: could not send connection preface"
,
ERR_error_string
(
ERR_get_error
(),
NULL
));
}
/* Here make file descriptor non-block */
make_non_block
(
fd
);
...
...
src/HttpServer.cc
View file @
8bfd900b
...
...
@@ -1470,7 +1470,7 @@ int start_listen(struct ev_loop *loop, Sessions *sessions,
close
(
fd
);
continue
;
}
util
::
make_socket_nonblocking
(
fd
);
(
void
)
util
::
make_socket_nonblocking
(
fd
);
#ifdef IPV6_V6ONLY
if
(
rp
->
ai_family
==
AF_INET6
)
{
if
(
setsockopt
(
fd
,
IPPROTO_IPV6
,
IPV6_V6ONLY
,
&
val
,
...
...
@@ -1547,7 +1547,10 @@ int HttpServer::run() {
SSL_CTX_set_mode
(
ssl_ctx
,
SSL_MODE_AUTO_RETRY
);
SSL_CTX_set_mode
(
ssl_ctx
,
SSL_MODE_RELEASE_BUFFERS
);
SSL_CTX_set_cipher_list
(
ssl_ctx
,
ssl
::
DEFAULT_CIPHER_LIST
);
if
(
SSL_CTX_set_cipher_list
(
ssl_ctx
,
ssl
::
DEFAULT_CIPHER_LIST
)
==
0
)
{
std
::
cerr
<<
ERR_error_string
(
ERR_get_error
(),
nullptr
)
<<
std
::
endl
;
return
-
1
;
}
const
unsigned
char
sid_ctx
[]
=
"nghttpd"
;
SSL_CTX_set_session_id_context
(
ssl_ctx
,
sid_ctx
,
sizeof
(
sid_ctx
)
-
1
);
...
...
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