summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/transport.c
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2010-01-22 08:53:49 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-01-22 06:31:32 -0800
commit375f08e1b56f61c5687bb276fb95bea230085f77 (patch)
tree3a99a4ca6072aab5cdd91065dec91ee24341965f /libglusterfs/src/transport.c
parenta116e5b3ef2d4fbb57a5690a01368ec7aa0942aa (diff)
transport: set proper reference counts on peer_trans for local connections
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 562 (crash resulting from bad refs in transport_setpeer) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=562
Diffstat (limited to 'libglusterfs/src/transport.c')
-rw-r--r--libglusterfs/src/transport.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libglusterfs/src/transport.c b/libglusterfs/src/transport.c
index 56781efe8..f3175272d 100644
--- a/libglusterfs/src/transport.c
+++ b/libglusterfs/src/transport.c
@@ -421,7 +421,7 @@ transport_peerproc (void *trans_data)
int
transport_setpeer (transport_t *trans, transport_t *peer_trans)
{
- trans->peer_trans = peer_trans;
+ trans->peer_trans = transport_ref (peer_trans);
INIT_LIST_HEAD (&trans->handover.msgs);
pthread_cond_init (&trans->handover.cond, NULL);
@@ -429,7 +429,7 @@ transport_setpeer (transport_t *trans, transport_t *peer_trans)
pthread_create (&trans->handover.thread, NULL,
transport_peerproc, trans);
- peer_trans->peer_trans = trans;
+ peer_trans->peer_trans = transport_ref (trans);
INIT_LIST_HEAD (&peer_trans->handover.msgs);
pthread_cond_init (&peer_trans->handover.cond, NULL);