diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2011-04-16 15:28:44 +0000 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2011-04-16 15:28:44 +0000 |
commit | 66148bc91604fbe95ff491f337dab62c5278e9d9 (patch) | |
tree | a6a5f98e4fc566497b2534800b3d4a8a3e096430 | |
parent | 1e9f4b75d14a480f461d91452612ced1be7326e0 (diff) | |
download | pysendfile-66148bc91604fbe95ff491f337dab62c5278e9d9.tar.gz |
be more explicit in sf_hdtr usage
-rw-r--r-- | sendfilemodule.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sendfilemodule.c b/sendfilemodule.c index 4f0c4d8..39eaab5 100644 --- a/sendfilemodule.c +++ b/sendfilemodule.c @@ -63,6 +63,7 @@ method_sendfile(PyObject *self, PyObject *args, PyObject *kwdict) size_t head_len = 0; char * tail = NULL; size_t tail_len = 0; + struct sf_hdtr hdtr; static char *keywords[] = {"out", "in", "offset", "count", "header", "trailer", "flags", NULL}; @@ -83,7 +84,10 @@ method_sendfile(PyObject *self, PyObject *args, PyObject *kwdict) if (head || tail) { struct iovec ivh = {head, head_len}; struct iovec ivt = {tail, tail_len}; - struct sf_hdtr hdtr = {&ivh, 1, &ivt, 1}; + hdtr.headers = &ivh; + hdtr.hdr_cnt = 1; + hdtr.trailers = &ivt; + hdtr.trl_cnt = 1; Py_BEGIN_ALLOW_THREADS #ifdef __APPLE__ sent += head_len; |