Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matt Johnston
dropbear
Commits
628a3f5c
Commit
628a3f5c
authored
Aug 06, 2014
by
Matt Johnston
Browse files
Test for EAGAIN too
parent
0e7409c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
packet.c
View file @
628a3f5c
...
...
@@ -93,9 +93,12 @@ void write_packet() {
iov
[
i
].
iov_base
=
buf_getptr
(
writebuf
,
len
);
iov
[
i
].
iov_len
=
len
;
}
/* This may return EAGAIN. The main loop sometimes
calls write_packet() without bothering to test with select() since
it's likely to be necessary */
written
=
writev
(
ses
.
sock_out
,
iov
,
iov_max_count
);
if
(
written
<
0
)
{
if
(
errno
==
EINTR
)
{
if
(
errno
==
EINTR
||
errno
==
EAGAIN
)
{
m_free
(
iov
);
TRACE2
((
"leave write_packet: EINTR"
))
return
;
...
...
@@ -136,7 +139,7 @@ void write_packet() {
written
=
write
(
ses
.
sock_out
,
buf_getptr
(
writebuf
,
len
),
len
);
if
(
written
<
0
)
{
if
(
errno
==
EINTR
)
{
if
(
errno
==
EINTR
||
errno
==
EAGAIN
)
{
TRACE2
((
"leave writepacket: EINTR"
))
return
;
}
else
{
...
...
@@ -255,7 +258,7 @@ static int read_packet_init() {
ses
.
remoteclosed
();
}
if
(
slen
<
0
)
{
if
(
errno
==
EINTR
)
{
if
(
errno
==
EINTR
||
errno
==
EAGAIN
)
{
TRACE2
((
"leave read_packet_init: EINTR"
))
return
DROPBEAR_FAILURE
;
}
...
...
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