diff options
| -rw-r--r-- | xlators/protocol/server/src/server-helpers.c | 6 | ||||
| -rw-r--r-- | xlators/protocol/server/src/server-protocol.c | 27 | 
2 files changed, 22 insertions, 11 deletions
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c index dd7e54fb6..c7e7f32d5 100644 --- a/xlators/protocol/server/src/server-helpers.c +++ b/xlators/protocol/server/src/server-helpers.c @@ -423,8 +423,6 @@ server_connection_cleanup (xlator_t *this, server_connection_t *conn)          int32_t             i = 0;          if (conn == NULL) { -                gf_log (this->name, GF_LOG_DEBUG, -                        "connection is NULL");                  goto out;          } @@ -583,8 +581,6 @@ server_connection_destroy (xlator_t *this, server_connection_t *conn)          uint32_t             fd_count = 0;          if (conn == NULL) { -                gf_log (this->name, GF_LOG_DEBUG, -                        "connection is NULL");                  ret = 0;                  goto out;          } @@ -776,8 +772,6 @@ server_connection_put (xlator_t *this, server_connection_t *conn)  	server_connection_t *todel = NULL;          if (conn == NULL) { -                gf_log (this->name, GF_LOG_DEBUG, -                        "connection is NULL");                  goto out;          } diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c index d4d75c1ab..ed75e97eb 100644 --- a/xlators/protocol/server/src/server-protocol.c +++ b/xlators/protocol/server/src/server-protocol.c @@ -8253,6 +8253,13 @@ notify (xlator_t *this, int32_t event, void *data, ...)  {  	int          ret = 0;  	transport_t *trans = data; +        peer_info_t *peerinfo = NULL; +        peer_info_t *myinfo = NULL; + +        if (trans != NULL) { +                peerinfo = &(trans->peerinfo); +                myinfo = &(trans->myinfo); +        }  	switch (event) {  	case GF_EVENT_POLLIN: @@ -8260,22 +8267,32 @@ notify (xlator_t *this, int32_t event, void *data, ...)  		break;  	case GF_EVENT_POLLERR:  	{ -		peer_info_t *peerinfo = NULL; - -		peerinfo = &(trans->peerinfo);  		gf_log (trans->xl->name, GF_LOG_INFO, "%s disconnected",  			peerinfo->identifier);  		ret = -1;  		transport_disconnect (trans); -                server_connection_cleanup (this, trans->xl_private); +                if (trans->xl_private == NULL) { +                        gf_log (this->name, GF_LOG_DEBUG, +                                "POLLERR received on (%s) even before " +                                "handshake with (%s) is successful", +                                myinfo->identifier, peerinfo->identifier); +                } else { +                        server_connection_cleanup (this, trans->xl_private); +                }  	}  	break;  	case GF_EVENT_TRANSPORT_CLEANUP:  	{ -		if (trans->xl_private) +		if (trans->xl_private) {  			server_connection_put (this, trans->xl_private); +                } else { +                        gf_log (this->name, GF_LOG_DEBUG, +                                "transport (%s) cleaned up even before " +                                "handshake with (%s) is successful", +                                myinfo->identifier, peerinfo->identifier); +                }  	}  	break;  | 
