Skip to content

Commit

Permalink
fixup couchbase#6
Browse files Browse the repository at this point in the history
Change-Id: I8dc7b6a6970919bec203a037c5882f7373885bab
  • Loading branch information
mnunberg committed Feb 1, 2014
1 parent 7674642 commit 6f37615
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/connmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,15 +432,15 @@ void connmgr_req_init(connmgr_request *req, const char *host, const char *port,
sprintf(req->key, "%s:%s", host, port);
}

static const char *indent = " ";
#define CONN_INDENT " "

static void write_he_list(lcb_clist_t *ll, FILE *out)
{
lcb_list_t *llcur;
LCB_LIST_FOR(llcur, (lcb_list_t *)ll) {
connmgr_cinfo *info = LCB_LIST_ITEM(llcur, connmgr_cinfo, llnode);
fprintf(out, "%sCONN [I=%p,C=%p ",
indent,
CONN_INDENT,
(void *)info,
(void *)&info->connection);

Expand Down Expand Up @@ -472,14 +472,11 @@ static void dumpfunc(const void *k, lcb_size_t nk, const void *v, lcb_size_t nv,
(int)HE_NPEND(he),
he->n_leased);

fprintf(out, "Idle Connections:\n");
fprintf(out, CONN_INDENT "Idle Connections:\n");
write_he_list(&he->ll_idle, out);
fprintf(out, "Pending Connections: \n");
fprintf(out, CONN_INDENT "Pending Connections: \n");
write_he_list(&he->ll_pending, out);


fprintf(out, "\n");
fprintf(out, "Pending Requests:\n");
fprintf(out, CONN_INDENT "Pending Requests:\n");

LCB_LIST_FOR(llcur, (lcb_list_t *)&he->requests) {
connmgr_request *req = LCB_LIST_ITEM(llcur, connmgr_request, llnode);
Expand All @@ -491,7 +488,7 @@ static void dumpfunc(const void *k, lcb_size_t nk, const void *v, lcb_size_t nv,
u_cb.cb = req->callback;

fprintf(out, "%sREQ [R=%p, Callback=%p, Data=%p, State=0x%x]\n",
indent,
CONN_INDENT,
(void *)req,
u_cb.ptr,
(void *)req->data,
Expand Down

0 comments on commit 6f37615

Please sign in to comment.