Skip to content

Commit 7f0a800

Browse files
committed
f
1 parent 50d3cd0 commit 7f0a800

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lightning-net-tokio/src/lib.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -485,13 +485,6 @@ impl peer_handler::SocketDescriptor for SocketDescriptor {
485485
let mut ctx = task::Context::from_waker(&waker);
486486
let mut written_len = 0;
487487
loop {
488-
macro_rules! handle_write_err {
489-
($err: expr) => { {
490-
// Probably we've already been closed, just return what we have and let the
491-
// read thread handle closing logic.
492-
return written_len;
493-
} }
494-
}
495488
match us.writer.as_ref().unwrap().poll_write_ready(&mut ctx) {
496489
task::Poll::Ready(Ok(())) => {
497490
match us.writer.as_ref().unwrap().try_write(&data[written_len..]) {
@@ -500,10 +493,10 @@ impl peer_handler::SocketDescriptor for SocketDescriptor {
500493
written_len += res;
501494
if written_len == data.len() { return written_len; }
502495
},
503-
Err(e) => handle_write_err!(e),
496+
Err(e) => return written_len,
504497
}
505498
},
506-
task::Poll::Ready(Err(e)) => handle_write_err!(e),
499+
task::Poll::Ready(Err(e)) => return written_len,
507500
task::Poll::Pending => {
508501
// We're queued up for a write event now, but we need to make sure we also
509502
// pause read given we're now waiting on the remote end to ACK (and in

0 commit comments

Comments
 (0)