Browse Source

Use ref_client_by_id in send_client instead of open coding it

master
Con Kolivas 10 years ago
parent
commit
1efe7120c4
  1. 7
      src/connector.c

7
src/connector.c

@ -681,14 +681,9 @@ static void send_client(cdata_t *cdata, int64_t id, char *buf)
return; return;
} }
ck_wlock(&cdata->lock);
HASH_FIND_I64(cdata->clients, &id, client);
/* Grab a reference to this client until the sender_send has /* Grab a reference to this client until the sender_send has
* completed processing. */ * completed processing. */
if (likely(client)) client = ref_client_by_id(cdata, id);
__inc_instance_ref(client);
ck_wunlock(&cdata->lock);
if (unlikely(!client)) { if (unlikely(!client)) {
ckpool_t *ckp = cdata->ckp; ckpool_t *ckp = cdata->ckp;

Loading…
Cancel
Save