Skip to content

Commit

Permalink
msg/async/rdma: keep send after shutdown errno same with posix
Browse files Browse the repository at this point in the history
Signed-off-by: Haomai Wang <haomai@xsky.com>
  • Loading branch information
yuyuyu101 committed Oct 23, 2016
1 parent 5828f28 commit 289fad1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/msg/async/rdma/RDMAConnectedSocketImpl.cc
Expand Up @@ -308,8 +308,11 @@ ssize_t RDMAConnectedSocketImpl::zero_copy_read(bufferptr &data)

ssize_t RDMAConnectedSocketImpl::send(bufferlist &bl, bool more)
{
if (error)
if (error) {
if (!active)
return -EPIPE;
return -error;
}
size_t bytes = bl.length();
if (!bytes)
return 0;
Expand Down
2 changes: 2 additions & 0 deletions src/msg/async/rdma/RDMAStack.h
Expand Up @@ -330,11 +330,13 @@ class RDMAConnectedSocketImpl : public ConnectedSocketImpl {
if (!error)
fin();
error = ECONNRESET;
active = false;
}
virtual void close() override {
if (!error)
fin();
error = ECONNRESET;
active = false;
}
virtual int fd() const override {
return notify_fd;
Expand Down

0 comments on commit 289fad1

Please sign in to comment.