diff --git a/sls/trunk/src/sll/connection.cc b/sls/trunk/src/sll/connection.cc index 597f29bb0b95bce61c675486f75b534cbc44c411..a688f02a29dbb9471cfdde5449c57a122f1e2959 100644 --- a/sls/trunk/src/sll/connection.cc +++ b/sls/trunk/src/sll/connection.cc @@ -144,11 +144,12 @@ void Connection::connect(const char *addr, int port) { // connect if (::connect(socket_fd_, (struct sockaddr *) &daddr, sizeof daddr) == -1) { + int errno__ = errno; disconnect_(); pthread_mutex_unlock(&w_mutex_); pthread_mutex_unlock(&r_mutex_); pthread_mutex_unlock(&c_mutex_); - throw Error(ERR_NET, (string) "Unable to connect to " + addr + ": " + hstrerror(h_errno)); + throw Error(ERR_NET, (string) "Unable to connect to " + addr + ": " + strerror(errno__)); } // set infos @@ -308,7 +309,7 @@ void Connection::send(const char* buf, size_t len) { pthread_mutex_unlock(&r_mutex_); pthread_mutex_unlock(&c_mutex_); pthread_mutex_unlock(&r_mutex_); - if (errno__ == ECONNRESET)// || errno__ == EPIPE) + if (errno__ == ECONNRESET || errno__ == EPIPE) throw Error(ERR_NET, "Connection reset by peer"); else throw Error(ERR_NET, "send: " + (string) strerror(errno__));