added body to spooler

This commit is contained in:
roberto@maverick64
2011-07-05 14:55:10 +02:00
parent 513c9cee3d
commit ec899a45d5
5 changed files with 63 additions and 19 deletions

View File

@@ -1023,7 +1023,7 @@ void uwsgi_python_add_item(char *key, uint16_t keylen, char *val, uint16_t valle
PyDict_SetItem(pydict, PyString_FromStringAndSize(key, keylen), PyString_FromStringAndSize(val, vallen));
}
int uwsgi_python_spooler(char *buf, uint16_t len) {
int uwsgi_python_spooler(char *buf, uint16_t len, char *body, size_t body_len) {
static int random_seed_reset = 0;
@@ -1057,6 +1057,9 @@ int uwsgi_python_spooler(char *buf, uint16_t len) {
}
pyargs = PyTuple_New(1);
if (body && body_len > 0) {
PyDict_SetItemString(spool_dict, "body", PyString_FromStringAndSize(body, body_len));
}
PyTuple_SetItem(pyargs, 0, spool_dict);
ret = python_call(spool_func, pyargs, 0);