Skip to content

Commit

Permalink
Reply message is not always present in reply handler (issue #75)
Browse files Browse the repository at this point in the history
For example when required.acks is set to 0 there is no reply
and thus no reply message in the reply handler.
  • Loading branch information
edenhill committed Feb 8, 2014
1 parent f0f5c22 commit 05378be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rdkafka_broker.c
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@ static void rd_kafka_produce_msgset_reply (rd_kafka_broker_t *rkb,
request->rkbuf_msgq.rkmq_msg_cnt, err ? "not ": "");

/* Parse Produce reply (unless the request errored) */
if (!err)
if (!err && reply)
err = rd_kafka_produce_reply_handle(rkb, reply);


Expand Down Expand Up @@ -2796,7 +2796,7 @@ static void rd_kafka_broker_fetch_reply (rd_kafka_broker_t *rkb,
rkb->rkb_fetching = 0;

/* Parse and handle the messages (unless the request errored) */
if (!err)
if (!err && reply)
err = rd_kafka_fetch_reply_handle(rkb, reply);

rd_rkb_dbg(rkb, MSG, "FETCH", "Fetch reply: %s",
Expand Down Expand Up @@ -2933,7 +2933,7 @@ static void rd_kafka_toppar_offset_reply (rd_kafka_broker_t *rkb,
rd_kafka_toppar_t *rktp = opaque;
rd_kafka_op_t *rko;

if (likely(!err))
if (likely(!err && reply))
err = rd_kafka_toppar_offset_reply_handle(rkb, reply, rktp);

rd_rkb_dbg(rkb, TOPIC, "OFFSET",
Expand Down

0 comments on commit 05378be

Please sign in to comment.