| ... | @@ -675,6 +675,9 @@ pub const WriteError = error{ | ... | @@ -675,6 +675,9 @@ pub const WriteError = error{ |
| 675 | /// This error occurs when no global event loop is configured, | 675 | /// This error occurs when no global event loop is configured, |
| 676 | /// and reading from the file descriptor would block. | 676 | /// and reading from the file descriptor would block. |
| 677 | WouldBlock, | 677 | WouldBlock, |
| | 678 | |
| | 679 | /// Connection reset by peer. |
| | 680 | ConnectionResetByPeer, |
| 678 | } || UnexpectedError; | 681 | } || UnexpectedError; |
| 679 | | 682 | |
| 680 | /// Write to a file descriptor. | 683 | /// Write to a file descriptor. |
| ... | @@ -752,6 +755,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize { | ... | @@ -752,6 +755,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize { |
| 752 | ENOSPC => return error.NoSpaceLeft, | 755 | ENOSPC => return error.NoSpaceLeft, |
| 753 | EPERM => return error.AccessDenied, | 756 | EPERM => return error.AccessDenied, |
| 754 | EPIPE => return error.BrokenPipe, | 757 | EPIPE => return error.BrokenPipe, |
| | 758 | ECONNRESET => return error.ConnectionResetByPeer, |
| 755 | else => |err| return unexpectedErrno(err), | 759 | else => |err| return unexpectedErrno(err), |
| 756 | } | 760 | } |
| 757 | } | 761 | } |
| ... | @@ -820,6 +824,7 @@ pub fn writev(fd: fd_t, iov: []const iovec_const) WriteError!usize { | ... | @@ -820,6 +824,7 @@ pub fn writev(fd: fd_t, iov: []const iovec_const) WriteError!usize { |
| 820 | ENOSPC => return error.NoSpaceLeft, | 824 | ENOSPC => return error.NoSpaceLeft, |
| 821 | EPERM => return error.AccessDenied, | 825 | EPERM => return error.AccessDenied, |
| 822 | EPIPE => return error.BrokenPipe, | 826 | EPIPE => return error.BrokenPipe, |
| | 827 | ECONNRESET => return error.ConnectionResetByPeer, |
| 823 | else => |err| return unexpectedErrno(err), | 828 | else => |err| return unexpectedErrno(err), |
| 824 | } | 829 | } |
| 825 | } | 830 | } |