Merge pull request #636 from Barenboim/master

remove CommSession::connect_timeout and response_timeout.
This commit is contained in:
xiehan
2021-11-10 22:07:57 +08:00
committed by GitHub
2 changed files with 3 additions and 10 deletions
+3 -3
View File
@@ -305,7 +305,7 @@ CommSession::~CommSession()
inline int Communicator::first_timeout(CommSession *session)
{
int timeout = session->response_timeout();
int timeout = session->target->response_timeout;
if (timeout < 0 || (unsigned int)session->timeout <= (unsigned int)timeout)
{
@@ -321,7 +321,7 @@ inline int Communicator::first_timeout(CommSession *session)
int Communicator::next_timeout(CommSession *session)
{
int timeout = session->response_timeout();
int timeout = session->target->response_timeout;
struct timespec cur_time;
int time_used, time_left;
@@ -1520,7 +1520,7 @@ int Communicator::request(CommSession *session, CommTarget *target)
data.fd = entry->sockfd;
data.ssl = NULL;
data.context = entry;
timeout = session->connect_timeout();
timeout = session->target->connect_timeout;
if (mpoller_add(&data, timeout, this->mpoller) >= 0)
break;
-7
View File
@@ -50,9 +50,6 @@ public:
*addrlen = this->addrlen;
}
int get_connect_timeout() const { return this->connect_timeout; }
int get_response_timeout() const { return this->response_timeout; }
protected:
void set_ssl(SSL_CTX *ssl_ctx, int ssl_connect_timeout)
{
@@ -139,10 +136,6 @@ private:
virtual int first_timeout() { return 0; } /* for client session only. */
virtual void handle(int state, int error) = 0;
private:
virtual int connect_timeout() { return this->target->connect_timeout; }
virtual int response_timeout() { return this->target->response_timeout; }
protected:
CommTarget *get_target() const { return this->target; }
CommConnection *get_connection() const { return this->conn; }