Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
working in progress
  • Loading branch information
hqin committed Oct 26, 2016
commit 8f88eb1aaf99c91f1f147897db3efe8a7d44d814
18 changes: 7 additions & 11 deletions confluent_kafka/src/confluent_kafka.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,14 +836,13 @@ static void error_cb (rd_kafka_t *rk, int err, const char *reason, void *opaque)
CallState_resume(cs);
}

static int stats_cb(rd_kafka_t *rk, char *json, size_t json_len, void *opaque)
{
static int stats_cb(rd_kafka_t *rk, char *json, size_t json_len, void *opaque) {
Handle *h = opaque;
PyObject *eo=NULL, *result=NULL;
CallState *cs=NULL;
PyObject *eo = NULL, *result = NULL;
CallState *cs = NULL;

cs = CallState_get(h);
if (json_len== 0 || !h->stats_cb) {
if (json_len == 0 || !h->stats_cb) {
/* Neither data nor call back defined. */
goto done;
}
Expand Down Expand Up @@ -880,13 +879,11 @@ static int stats_cb(rd_kafka_t *rk, char *json, size_t json_len, void *opaque)
* Clear Python object references in Handle
*/
void Handle_clear (Handle *h) {
if (h->error_cb) {
if (h->error_cb)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: There's a trailing whitespace after ). This might seem silly but it will show up as a red blob in editors and git gui :)

Py_DECREF(h->error_cb);
}

if (h->stats_cb) {
if (h->stats_cb)
Py_DECREF(h->stats_cb);
}

PyThread_delete_key(h->tlskey);
}
Expand Down Expand Up @@ -1220,9 +1217,8 @@ rd_kafka_conf_t *common_conf_setup (rd_kafka_type_t ktype,
if (h->error_cb)
rd_kafka_conf_set_error_cb(conf, error_cb);

if (h->stats_cb) {
if (h->stats_cb)
rd_kafka_conf_set_stats_cb(conf, stats_cb);
}

rd_kafka_topic_conf_set_opaque(tconf, h);
rd_kafka_conf_set_default_topic_conf(conf, tconf);
Expand Down