Skip to content

Commit

Permalink
Merge pull request #59 from armyofevilrobots/master
Browse files Browse the repository at this point in the history
Modification to allow for empty message bodies.
  • Loading branch information
ask committed Nov 19, 2014
2 parents e6225f1 + 639570b commit abbd949
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Modules/_librabbitmq/connection.c
Original file line number Diff line number Diff line change
@@ -1340,7 +1340,11 @@ PyRabbitMQ_recv(PyRabbitMQ_Connection *self, PyObject *p,
*buf++ = *bufp++, j++);
}
if (p) {
if (!payload) goto error;
if (body_target && !payload) //We expected content, got none
goto error;
else if (!payload) //We expected no content, return emptystring
payload = PyString_FromStringAndSize(NULL, 0);

PyDict_SetItemString(p, "properties", propdict);
PyDict_SetItemString(p, "body", payload);
PyDict_SetItemString(p, "channel", channel);

0 comments on commit abbd949

Please sign in to comment.