Skip to content

Commit

Permalink
Connection: Check socket close in handle_write
Browse files Browse the repository at this point in the history
  • Loading branch information
htfy96 committed Feb 3, 2017
1 parent e114234 commit 75928e8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/c10k/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ namespace c10k
throw std::system_error(errno, std::system_category());
else
break;
if (write_result == 0)
throw std::runtime_error("Write found socket is closed");
req.offset += write_result;
}
if (req.offset == req.buf.size()) // write OK
Expand Down

0 comments on commit 75928e8

Please sign in to comment.