[First post]
Hi all,
this piece of C code is freezing at
It sounds like I'm making a C web server, right? That's because I am. ; )
Hi all,
this piece of C code is freezing at
PyObject *result = PyObject_CallObject(...)
. I'd expect it to hang and get a segfault, but it's freezing! Can anyone help?
C:
PyObject *page_module = PyImport_ImportModule(strtok(basename(reqline[1]), "."));
PyObject *page_main_func = PyObject_GetAttrString(page_module, "http_main");
PyObject *page_url_params = PyList_New(0);
PyObject *param = NULL;
for (int i = 0; i != url_params_count; ++i) {
param = Py_BuildValue("s", (const char*) url_params[i]);
PyList_Append(page_url_params, param);
}
PyObject *result = PyObject_CallObject(page_main_func, Py_BuildValue("(O)", page_url_params));
PyObject *type, *value, *traceback;
PyErr_Fetch(&type, &value, &traceback);
if (type != NULL) {
PyErr_Restore(type, value, traceback);
PyErr_Print();
printf("\n");
write(clients[n], resp_500_header, strlen(resp_500_header));
write(clients[n], default_resp_500_page, strlen(default_resp_500_page));
}