diff options
author | Determinant <[email protected]> | 2018-07-12 20:25:41 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2018-07-12 20:25:41 -0400 |
commit | b98265d732bad274f66de66cb93d891e9c41a112 (patch) | |
tree | 38eb8c584a4a3ab65d833c25eac08fa1b3a6f179 /src | |
parent | 53f4c5137da249e5e955809ffe32afa3cf5c3522 (diff) |
fix bugs
Diffstat (limited to 'src')
-rw-r--r-- | src/conn.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/conn.cpp b/src/conn.cpp index 2bcd0ae..0b42853 100644 --- a/src/conn.cpp +++ b/src/conn.cpp @@ -136,7 +136,7 @@ void ConnPool::accept_client(evutil_socket_t fd, short) { NetAddr addr((struct sockaddr_in *)&client_addr); conn_t conn = create_conn(); - Conn *conn_ptr = conn; + Conn *conn_ptr = conn.get(); conn->fd = client_fd; conn->cpool = this; conn->mode = Conn::PASSIVE; @@ -165,7 +165,7 @@ void ConnPool::Conn::conn_server(evutil_socket_t fd, short events) { std::bind(&Conn::send_data, this, _1, _2)); ev_read.add(); ev_write.add(); - ev_connect.del(); + ev_connect.clear(); ready_send = false; SALTICIDAE_LOG_INFO("connected to peer %s", std::string(*this).c_str()); on_setup(); @@ -212,7 +212,7 @@ void ConnPool::Conn::terminate() { { /* temporarily pin the conn before it dies */ auto conn = it->second; - assert(conn == this); + assert(conn.get() == this); pool.erase(it); close(); /* inform the upper layer the connection will be destroyed */ @@ -252,7 +252,7 @@ ConnPool::conn_t ConnPool::create_conn(const NetAddr &addr) { if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) throw ConnPoolError(std::string("unable to set nonblocking socket")); conn_t conn = create_conn(); - Conn * conn_ptr = conn; + Conn * conn_ptr = conn.get(); conn->fd = fd; conn->cpool = this; conn->mode = Conn::ACTIVE; |