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
aa7c580b
Commit
aa7c580b
authored
Nov 20, 2019
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize QUIC write
parent
1d05c6c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
20 deletions
+24
-20
src/h2load.cc
src/h2load.cc
+1
-2
src/h2load_quic.cc
src/h2load_quic.cc
+23
-18
No files found.
src/h2load.cc
View file @
aa7c580b
...
...
@@ -214,8 +214,7 @@ void readcb(struct ev_loop *loop, ev_io *w, int revents) {
delete
client
;
return
;
}
writecb
(
loop
,
&
client
->
wev
,
revents
);
// client->disconnect() and client->fail() may be called
client
->
signal_write
();
}
}
// namespace
...
...
src/h2load_quic.cc
View file @
aa7c580b
...
...
@@ -601,35 +601,40 @@ int Client::read_quic() {
sockaddr_union
su
;
socklen_t
addrlen
=
sizeof
(
su
);
int
rv
;
size_t
pktcnt
=
0
;
auto
nread
=
recvfrom
(
fd
,
buf
.
data
(),
buf
.
size
(),
MSG_DONTWAIT
,
&
su
.
sa
,
&
addrlen
);
if
(
nread
==
-
1
)
{
return
0
;
}
for
(;;)
{
auto
nread
=
recvfrom
(
fd
,
buf
.
data
(),
buf
.
size
(),
MSG_DONTWAIT
,
&
su
.
sa
,
&
addrlen
);
if
(
nread
==
-
1
)
{
return
0
;
}
assert
(
quic
.
conn
);
assert
(
quic
.
conn
);
auto
path
=
ngtcp2_path
{
{
local_addr
.
len
,
reinterpret_cast
<
uint8_t
*>
(
&
local_addr
.
su
.
sa
)},
{
addrlen
,
reinterpret_cast
<
uint8_t
*>
(
&
su
.
sa
)},
};
auto
path
=
ngtcp2_path
{
{
local_addr
.
len
,
reinterpret_cast
<
uint8_t
*>
(
&
local_addr
.
su
.
sa
)},
{
addrlen
,
reinterpret_cast
<
uint8_t
*>
(
&
su
.
sa
)},
};
rv
=
ngtcp2_conn_read_pkt
(
quic
.
conn
,
&
path
,
buf
.
data
(),
nread
,
timestamp
(
worker
->
loop
));
if
(
rv
!=
0
)
{
std
::
cerr
<<
"ngtcp2_conn_read_pkt: "
<<
ngtcp2_strerror
(
rv
)
<<
std
::
endl
;
return
-
1
;
}
rv
=
ngtcp2_conn_read_pkt
(
quic
.
conn
,
&
path
,
buf
.
data
(),
nread
,
timestamp
(
worker
->
loop
));
if
(
rv
!=
0
)
{
std
::
cerr
<<
"ngtcp2_conn_read_pkt: "
<<
ngtcp2_strerror
(
rv
)
<<
std
::
endl
;
return
-
1
;
}
if
(
worker
->
current_phase
==
Phase
::
MAIN_DURATION
)
{
worker
->
stats
.
bytes_total
+=
nread
;
if
(
pktcnt
==
10
)
{
break
;
}
}
return
0
;
}
int
Client
::
write_quic
()
{
ev_io_stop
(
worker
->
loop
,
&
wev
);
if
(
quic
.
close_requested
)
{
return
-
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