This change make it clear what is configuration file for Gunicorn.
Using a filename with an extension different than a python extension
was never supported. Also it gives us some room for a proper config file.
on osx and maybe some other systems, SO_PROTOCOL is not set, also
the socket family is not detected correctly.
This patch remove default values in socketfromfd and do the following:
* detect proper family using getsockname instead of getsocktopt
* if no type is given, default to SOCK_STREAM (we don't have any other type)
* if no protocol is given, default to 0 and let the system take care of it.
This change make it clear what is configuration file for Gunicorn.
Using a filename with an extension different than a python extension
was never supported. Also it gives us some room for a proper config file.
on osx and maybe some other systems, SO_PROTOCOL is not set, also
the socket family is not detected correctly.
This patch remove default values in socketfromfd and do the following:
* detect proper family using getsockname instead of getsocktopt
* if no type is given, default to SOCK_STREAM (we don't have any other type)
* if no protocol is given, default to 0 and let the system take care of it.
When reloading the worker canbe in the select loop and it will wait until timeout before handling any change. So make sure to wake up the loop before going further.
Sometimes both TRANSFER-ENCODING=chunked and CONTENT_LENGTH are set. Since gunicorn prioritise (following the HTTP1.1 spec) chunked encoding we should make sure in this case to signal to th application that the input is terminated by the server.
Without the change gunicorn were always setting wsg.input_terminated to False when a CONTENT_LENGTH header was present ignoring that Gunicorn was afaik handling the termination.
find_library('c') doesn't work in Alpine Linux. This happen because musl has a simpler implementation of libc.
This patch fix it by extending ctypes.util.find_library to search the libs using LD_LIBRARY_PATH.
Patch is based on e3f67780aa
See also https://bugs.python.org/issue21622fix#2160