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
eb05777d
Commit
eb05777d
authored
Apr 24, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clang-format
parent
6b0b8ea7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
42 deletions
+21
-42
examples/libevent-client.c
examples/libevent-client.c
+1
-2
src/asio_io_service_pool.cc
src/asio_io_service_pool.cc
+3
-3
src/asio_server.cc
src/asio_server.cc
+2
-8
src/asio_server_http2.cc
src/asio_server_http2.cc
+5
-13
src/asio_server_http2_impl.cc
src/asio_server_http2_impl.cc
+4
-8
src/asio_server_http2_impl.h
src/asio_server_http2_impl.h
+3
-5
src/comp_helper.c
src/comp_helper.c
+1
-1
src/util.cc
src/util.cc
+2
-2
No files found.
examples/libevent-client.c
View file @
eb05777d
...
...
@@ -258,8 +258,7 @@ static int on_data_chunk_recv_callback(nghttp2_session *session _U_,
stream), if it is closed, we send GOAWAY and tear down the
session */
static
int
on_stream_close_callback
(
nghttp2_session
*
session
,
int32_t
stream_id
,
uint32_t
error_code
,
void
*
user_data
)
{
uint32_t
error_code
,
void
*
user_data
)
{
http2_session_data
*
session_data
=
(
http2_session_data
*
)
user_data
;
int
rv
;
...
...
src/asio_io_service_pool.cc
View file @
eb05777d
...
...
@@ -58,9 +58,9 @@ void io_service_pool::run(bool asynchronous) {
// Create a pool of threads to run all of the io_services.
for
(
std
::
size_t
i
=
0
;
i
<
io_services_
.
size
();
++
i
)
{
futures_
.
push_back
(
std
::
async
(
std
::
launch
::
async
,
(
size_t
(
boost
::
asio
::
io_service
::*
)(
void
))
&
boost
::
asio
::
io_service
::
run
,
io_services_
[
i
]));
(
size_t
(
boost
::
asio
::
io_service
::*
)(
void
))
&
boost
::
asio
::
io_service
::
run
,
io_services_
[
i
]));
}
if
(
!
asynchronous
)
{
...
...
src/asio_server.cc
View file @
eb05777d
...
...
@@ -156,15 +156,9 @@ void server::start_accept(tcp::acceptor &acceptor, serve_mux &mux) {
});
}
void
server
::
stop
()
{
io_service_pool_
.
stop
();
}
void
server
::
stop
()
{
io_service_pool_
.
stop
();
}
void
server
::
join
()
{
io_service_pool_
.
join
();
}
void
server
::
join
()
{
io_service_pool_
.
join
();
}
}
// namespace server
}
// namespace asio_http2
...
...
src/asio_server_http2.cc
View file @
eb05777d
...
...
@@ -59,11 +59,9 @@ boost::system::error_code http2::listen_and_serve(boost::system::error_code &ec,
return
impl_
->
listen_and_serve
(
ec
,
nullptr
,
address
,
port
,
asynchronous
);
}
boost
::
system
::
error_code
http2
::
listen_and_serve
(
boost
::
system
::
error_code
&
ec
,
boost
::
asio
::
ssl
::
context
&
tls_context
,
const
std
::
string
&
address
,
const
std
::
string
&
port
,
bool
asynchronous
)
{
boost
::
system
::
error_code
http2
::
listen_and_serve
(
boost
::
system
::
error_code
&
ec
,
boost
::
asio
::
ssl
::
context
&
tls_context
,
const
std
::
string
&
address
,
const
std
::
string
&
port
,
bool
asynchronous
)
{
return
impl_
->
listen_and_serve
(
ec
,
&
tls_context
,
address
,
port
,
asynchronous
);
}
...
...
@@ -75,15 +73,9 @@ bool http2::handle(std::string pattern, request_cb cb) {
return
impl_
->
handle
(
std
::
move
(
pattern
),
std
::
move
(
cb
));
}
void
http2
::
stop
()
{
impl_
->
stop
();
}
void
http2
::
stop
()
{
impl_
->
stop
();
}
void
http2
::
join
()
{
return
impl_
->
join
();
}
void
http2
::
join
()
{
return
impl_
->
join
();
}
}
// namespace server
...
...
src/asio_server_http2_impl.cc
View file @
eb05777d
...
...
@@ -43,7 +43,8 @@ boost::system::error_code http2_impl::listen_and_serve(
boost
::
system
::
error_code
&
ec
,
boost
::
asio
::
ssl
::
context
*
tls_context
,
const
std
::
string
&
address
,
const
std
::
string
&
port
,
bool
asynchronous
)
{
server_
.
reset
(
new
server
(
num_threads_
));
return
server_
->
listen_and_serve
(
ec
,
tls_context
,
address
,
port
,
backlog_
,
mux_
,
asynchronous
);
return
server_
->
listen_and_serve
(
ec
,
tls_context
,
address
,
port
,
backlog_
,
mux_
,
asynchronous
);
}
void
http2_impl
::
num_threads
(
size_t
num_threads
)
{
num_threads_
=
num_threads
;
}
...
...
@@ -54,14 +55,9 @@ bool http2_impl::handle(std::string pattern, request_cb cb) {
return
mux_
.
handle
(
std
::
move
(
pattern
),
std
::
move
(
cb
));
}
void
http2_impl
::
stop
()
{
return
server_
->
stop
();
}
void
http2_impl
::
stop
()
{
return
server_
->
stop
();
}
void
http2_impl
::
join
()
{
return
server_
->
join
();
}
void
http2_impl
::
join
()
{
return
server_
->
join
();
}
}
// namespace server
...
...
src/asio_server_http2_impl.h
View file @
eb05777d
...
...
@@ -42,11 +42,9 @@ class server;
class
http2_impl
{
public:
http2_impl
();
boost
::
system
::
error_code
listen_and_serve
(
boost
::
system
::
error_code
&
ec
,
boost
::
asio
::
ssl
::
context
*
tls_context
,
const
std
::
string
&
address
,
const
std
::
string
&
port
,
bool
asynchronous
);
boost
::
system
::
error_code
listen_and_serve
(
boost
::
system
::
error_code
&
ec
,
boost
::
asio
::
ssl
::
context
*
tls_context
,
const
std
::
string
&
address
,
const
std
::
string
&
port
,
bool
asynchronous
);
void
num_threads
(
size_t
num_threads
);
void
backlog
(
int
backlog
);
bool
handle
(
std
::
string
pattern
,
request_cb
cb
);
...
...
src/comp_helper.c
View file @
eb05777d
...
...
@@ -58,7 +58,7 @@ json_t *dump_header(const uint8_t *name, size_t namelen, const uint8_t *value,
json_t
*
nv_pair
=
json_object
();
char
*
cname
=
malloc
(
namelen
+
1
);
if
(
cname
==
NULL
)
{
return
NULL
;
return
NULL
;
}
memcpy
(
cname
,
name
,
namelen
);
cname
[
namelen
]
=
'\0'
;
...
...
src/util.cc
View file @
eb05777d
...
...
@@ -738,14 +738,14 @@ char *get_exec_path(int argc, char **const argv, const char *cwd) {
if
(
argv0
[
0
]
==
'/'
)
{
path
=
static_cast
<
char
*>
(
malloc
(
len
+
1
));
if
(
path
==
nullptr
)
{
return
nullptr
;
return
nullptr
;
}
memcpy
(
path
,
argv0
,
len
+
1
);
}
else
{
auto
cwdlen
=
strlen
(
cwd
);
path
=
static_cast
<
char
*>
(
malloc
(
len
+
1
+
cwdlen
+
1
));
if
(
path
==
nullptr
)
{
return
nullptr
;
return
nullptr
;
}
memcpy
(
path
,
cwd
,
cwdlen
);
path
[
cwdlen
]
=
'/'
;
...
...
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