commit af899f15e0dbdbf05b32a7fdee68af765bd664be
parent ec901d03390396962970437d9659fd00dc3d5bfc
Author: Joris Vink <joris@coders.se>
Date: Mon, 13 Mar 2017 11:19:58 +0100
Set error if http_body_rewind() fails.
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/python.c b/src/python.c
@@ -1017,7 +1017,11 @@ pyhttp_get_body(struct pyhttp_request *pyreq, void *closure)
u_int8_t data[BUFSIZ];
kore_buf_init(&buf, 1024);
- http_body_rewind(pyreq->req);
+ if (!http_body_rewind(pyreq->req)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "http_body_rewind() failed");
+ return (NULL);
+ }
for (;;) {
ret = http_body_read(pyreq->req, data, sizeof(data));