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
f69b52b1
Commit
f69b52b1
authored
Mar 18, 2017
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Attempt to avoid TCP RST on socket closure on Linux
parent
1e1d908c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
src/shrpx_connection.cc
src/shrpx_connection.cc
+14
-1
No files found.
src/shrpx_connection.cc
View file @
f69b52b1
...
@@ -126,7 +126,20 @@ void Connection::disconnect() {
...
@@ -126,7 +126,20 @@ void Connection::disconnect() {
}
}
if
(
fd
!=
-
1
)
{
if
(
fd
!=
-
1
)
{
shutdown
(
fd
,
SHUT_WR
);
// At least for Linux, shutdown both sides, and continue to read
// until it gets EOF or error in order to avoid TCP RST.
shutdown
(
fd
,
SHUT_RDWR
);
#ifdef __linux__
std
::
array
<
uint8_t
,
16
_k
>
b
;
for
(;;)
{
ssize_t
n
;
while
((
n
=
read
(
fd
,
b
.
data
(),
b
.
size
()))
==
-
1
&&
errno
==
EINTR
)
;
if
(
n
<=
0
)
{
break
;
}
}
#endif // __linux__
close
(
fd
);
close
(
fd
);
fd
=
-
1
;
fd
=
-
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