uWSGI 0.9.9-rc1

This commit is contained in:
roberto@debian32
2011-08-19 09:57:58 +02:00
parent eebe757c16
commit d5e6412b20
3 changed files with 70 additions and 3 deletions
+13 -1
View File
@@ -838,17 +838,29 @@ PyObject *py_uwsgi_advanced_sendfile(PyObject * self, PyObject * args) {
return NULL;
}
if (PyString_Check(what)) {
filename = PyString_AsString(what);
fd = open(filename, O_RDONLY);
if (fd < 0) {
uwsgi_error("open");
uwsgi_error_open(filename);
goto clear;
}
}
#ifdef PYTHREE
else if (PyUnicode_Check(what)) {
filename = PyBytes_AsString(PyUnicode_AsASCIIString(what));
fd = open(filename, O_RDONLY);
if (fd < 0) {
uwsgi_error_open(filename);
goto clear;
}
}
#endif
else {
fd = PyObject_AsFileDescriptor(what);
if (fd < 0)