File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -485,13 +485,6 @@ impl peer_handler::SocketDescriptor for SocketDescriptor {
485
485
let mut ctx = task:: Context :: from_waker ( & waker) ;
486
486
let mut written_len = 0 ;
487
487
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
- }
495
488
match us. writer . as_ref ( ) . unwrap ( ) . poll_write_ready ( & mut ctx) {
496
489
task:: Poll :: Ready ( Ok ( ( ) ) ) => {
497
490
match us. writer . as_ref ( ) . unwrap ( ) . try_write ( & data[ written_len..] ) {
@@ -500,10 +493,10 @@ impl peer_handler::SocketDescriptor for SocketDescriptor {
500
493
written_len += res;
501
494
if written_len == data. len ( ) { return written_len; }
502
495
} ,
503
- Err ( e) => handle_write_err ! ( e ) ,
496
+ Err ( e) => return written_len ,
504
497
}
505
498
} ,
506
- task:: Poll :: Ready ( Err ( e) ) => handle_write_err ! ( e ) ,
499
+ task:: Poll :: Ready ( Err ( e) ) => return written_len ,
507
500
task:: Poll :: Pending => {
508
501
// We're queued up for a write event now, but we need to make sure we also
509
502
// pause read given we're now waiting on the remote end to ACK (and in
You can’t perform that action at this time.
0 commit comments