pycap doesn't release the GIL
Status: Alpha
Brought to you by:
bdash
pycap does not release the GIL and thus if the pycap.capture call is called inside a thread, the whole program is stuck while executing the thread. I've done a small change in the code so that the GIL is released while waiting for a package. The change starts from line 115 of the capture.c file. Here is the cnaged piece of code:
Py_BEGIN_ALLOW_THREADS;
packet = (u_char *) pcap_next(self->pcap, &header);
Py_END_ALLOW_THREADS;
You can find the changed file applied to this description
capture.c changed to release the GIL