diff options
Diffstat (limited to 'rpc/rpc-transport')
| -rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 13 | 
1 files changed, 8 insertions, 5 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index ae5ed849c9a..f4b9549afd4 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -2371,6 +2371,12 @@ socket_poller (void *ctx)          uint32_t          gen = 0;          char             *cname = NULL; +        GF_ASSERT (this); +        /* Set THIS early on in the life of this thread, instead of setting it +         * conditionally +         */ +        THIS = this->xl; +          priv->ot_state = OT_RUNNING;          if (priv->use_ssl) { @@ -2399,7 +2405,6 @@ socket_poller (void *ctx)          }          if (priv->connected == 0) { -		THIS = this->xl;                  ret = socket_connect_finish (this);                  if (ret != 0) {                          gf_log (this->name, GF_LOG_WARNING, @@ -2440,8 +2445,7 @@ socket_poller (void *ctx)  			       "poll error on pipe");  			break;  		} -		/* Only glusterd actually seems to need this. */ -		THIS = this->xl; +  		if (pfd[1].revents & POLL_MASK_INPUT) {  			ret = socket_event_poll_in(this);  			if (ret >= 0) { @@ -2519,8 +2523,7 @@ err:          priv->sock = -1;          priv->ot_state = OT_IDLE;          pthread_mutex_unlock(&priv->lock); -        rpc_transport_notify (this->listener, RPC_TRANSPORT_DISCONNECT, -                              this); +        rpc_transport_notify (this, RPC_TRANSPORT_DISCONNECT, this);          rpc_transport_unref (this);  	return NULL;  }  | 
