8000 meinheld/meinheld/server/server.c at dev · StetHD/meinheld · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
2606 lines (2246 loc) · 65.6 KB

server.c

File metadata and controls

2606 lines (2246 loc) · 65.6 KB
#include "server.h"
#include <arpa/inet.h>
#include <signal.h>
#ifdef linux
#include <sys/prctl.h>
#include <sys/socket.h>
#endif
#include <sys/un.h>
#include <sys/stat.h>
#include "http_request_parser.h"
#include "response.h"
#include "log.h"
#include "client.h"
#include "util.h"
#include "input.h"
#include "timer.h"
#include "heapq.h"
#ifdef WITH_GREENLET
#include "greensupport.h"
#endif
#define ACCEPT_TIMEOUT_SECS 1
#define READ_TIMEOUT_SECS 30
#define READ_BUF_SIZE 1024 * 64
typedef struct {
TimerObject **q;
uint32_t size;
uint32_t max;
} pending_queue_t;
static char *server_name = "127.0.0.1";
static uint16_t server_port = 8000;
/* static int listen_sock; // listen socket */
static PyObject *listen_socks = NULL; // listen socket
static volatile sig_atomic_t loop_done;
static volatile sig_atomic_t call_shutdown = 0;
static volatile sig_atomic_t catch_signal = 0;
static picoev_loop* main_loop = NULL; //main loop
static heapq_t *g_timers;
static pending_queue_t *g_pendings = NULL;
// active event cnt
static int activecnt = 0;
static PyObject *wsgi_app = NULL; //wsgi app
static uint8_t watch_loop = 0;
static PyObject *watchdog = NULL; //watchdog
static char is_write_access_log = 0;
static int is_keep_alive = 0; //keep alive support
static int keep_alive_timeout = 5;
uint64_t max_content_length = 1024 * 1024 * 16; //max_content_length
int client_body_buffer_size = 1024 * 500; //client_body_buffer_size
static char *unix_sock_name = NULL;
static int backlog = 1024 * 4; // backlog size
static int max_fd = 1024 * 4; // picoev max_fd
// greenlet hub switch value
static PyObject *hub_switch_value;
PyObject* current_client;
PyObject* timeout_error;
/* reuse object */
static PyObject *client_key = NULL; //meinheld.client
static PyObject *wsgi_input_key = NULL; //wsgi.input key
static PyObject *status_code_key = NULL; //STATUS_CODE
static PyObject *bytes_sent_key = NULL; // SEND_BYTES
static PyObject *request_time_key = NULL; // REQUEST_TIME
static PyObject *local_time_key = NULL; // LOCAL_TIME
static PyObject *empty_string = NULL; //""
static PyObject *app_handler_func = NULL;
/* gunicorn */
static int spinner = 0;
static int tempfile_fd = 0;
static int gtimeout = 0;
static int ppid = 0;
#define CLIENT_MAXFREELIST 1024
static client_t *client_free_list[CLIENT_MAXFREELIST];
static int client_numfree = 0;
static void
read_callback(picoev_loop* loop, int fd, int events, void* cb_arg);
#ifndef WITH_GREENLET
static void
write_callback(picoev_loop* loop, int fd, int events, void* cb_arg);
#endif
static void
kill_callback(picoev_loop* loop, int fd, int events, void* cb_arg);
static void
trampoline_callback(picoev_loop* loop, int fd, int events, void* cb_arg);
static PyObject*
internal_schedule_call(int seconds, PyObject *cb, PyObject *args, PyObject *kwargs, PyObject *greenlet);
static int
prepare_call_wsgi(client_t *client);
static void
call_wsgi_handler(client_t *client);
static int
check_status_code(client_t *client);
static pending_queue_t*
init_pendings(void)
{
pending_queue_t *pendings = NULL;
pendings = PyMem_Malloc(sizeof(pending_queue_t));
if (pendings == NULL) {
return NULL;
}
pendings->size = 0;
pendings->max= 1024;
pendings->q = (TimerObject**)malloc(sizeof(TimerObject*) * pendings->max);
if (pendings->q == NULL) {
PyMem_Free(pendings);
return NULL;
}
return pendings;
}
static int
realloc_pendings(void)
{
TimerObject **new_heap;
uint32_t max;
pending_queue_t *pendings = g_pendings;
if (pendings->size >= pendings->max) {
//realloc
max = pendings->max * 2;
new_heap = (TimerObject**)realloc(pendings->q, sizeof(TimerObject*) * max);
if (new_heap == NULL) {
PyErr_SetString(PyExc_Exception, "size over timer queue");
return -1;
}
pendings->max = max;
pendings->q = new_heap;
RDEBUG("realloc max:%d", pendings->max);
}
return 1;
}
static void
destroy_pendings(void)
{
int i = 0, len;
TimerObject *timer = NULL;
TimerObject **t = g_pendings->q;
if (g_pendings == NULL) {
return;
}
len = g_pendings->size;
t += i;
while(len--) {
timer = *t;
Py_DECREF(timer);
t++;
}
free(g_pendings->q);
PyMem_Free(g_pendings);
g_pendings = NULL;
}
static void
client_t_list_fill(void)
{
client_t *client;
while (client_numfree < CLIENT_MAXFREELIST) {
client = (client_t *)PyMem_Malloc(sizeof(client_t));
client_free_list[client_numfree++] = client;
}
}
static void
client_t_list_clear(void)
{
client_t *op;
while (client_numfree) {
op = client_free_list[--client_numfree];
PyMem_Free(op);
}
}
static client_t*
alloc_client_t(void)
{
client_t *client;
if (client_numfree) {
client = client_free_list[--client_numfree];
GDEBUG("use pooled %p", client);
} else {
client = (client_t *)PyMem_Malloc(sizeof(client_t));
GDEBUG("alloc %p", client);
}
memset(client, 0, sizeof(client_t));
return client;
}
static void
dealloc_client(client_t *client)
{
if (client_numfree < CLIENT_MAXFREELIST) {
client_free_list[client_numfree++] = client;
GDEBUG("back to pool %p", client);
} else {
PyMem_Free(client);
}
}
static client_t *
new_client_t(int client_fd, char *remote_addr, uint32_t remote_port)
{
client_t *client;
client = alloc_client_t();
//client = PyMem_Malloc(sizeof(client_t));
//memset(client, 0, sizeof(client_t));
client->fd = client_fd;
client->complete = 1;
client->request_queue = new_request_queue();
client->remote_addr = remote_addr;
client->remote_port = remote_port;
/* client->body_type = BODY_TYPE_NONE; */
GDEBUG("client alloc %p", client);
return client;
}
static void
set_log_value(client_t *client, PyObject *environ, uintptr_t delta_msec)
{
PyObject *status_code = NULL, *bytes = NULL, *request_time = NULL, *local_time = NULL;
status_code = PyLong_FromLong(client->status_code);
bytes = PyLong_FromLong(client->write_bytes);
request_time = PyLong_FromLong(delta_msec);
local_time = NATIVE_FROMSTRING((char*)http_log_time);
if (status_code) {
PyDict_SetItem(environ, status_code_key, status_code);
Py_DECREF(status_code);
}
if (bytes) {
PyDict_SetItem(environ, bytes_sent_key, bytes);
Py_DECREF(bytes);
}
if (request_time) {
PyDict_SetItem(environ, request_time_key, request_time);
Py_DECREF(request_time);
}
if (local_time) {
PyDict_SetItem(environ, local_time_key, local_time);
Py_DECREF(local_time);
}
}
static void
clean_client(client_t *client)
{
PyObject *environ = NULL;
uintptr_t end, delta_msec = 0;
request *req = client->current_req;
if (is_write_access_log) {
DEBUG("write access log");
cache_time_update();
if (req) {
environ = req->environ;
end = current_msec;
if (req->start_msec > 0){
delta_msec = end - req->start_msec;
}
set_log_value(client, environ, delta_msec);
call_access_logger(environ);
} else {
if (client->status_code != 408) {
environ = new_environ(client);
set_log_value(client, environ, delta_msec);
call_access_logger(environ);
}
}
}
Py_CLEAR(client->http_status);
Py_CLEAR(client->headers);
Py_CLEAR(client->response_iter);
Py_CLEAR(client->response);
if (req == NULL) {
goto init;
}
DEBUG("status_code:%d env:%p", client->status_code, req->environ);
if (req->environ) {
/* PyDict_Clear(client->environ); */
/* DEBUG("CLEAR environ"); */
Py_CLEAR(req->environ);
}
if (req->body) {
if (req->body_type == BODY_TYPE_TMPFILE) {
fclose(req->body);
} else {
free_buffer(req->body);
}
req->body = NULL;
}
free_request(req);
init:
client->current_req = NULL;
client->header_done = 0;
client->response_closed = 0;
client->chunked_response = 0;
client->content_length_set = 0;
client->content_length = 0;
client->write_bytes = 0;
}
static void
close_client(client_t *client)
{
client_t *new_client = NULL;
int ret;
if (!client->response_closed) {
close_response(client);
}
DEBUG("start close client:%p fd:%d status_code %d", client, client->fd, client->status_code);
if (picoev_is_active(main_loop, client->fd)) {
if (!picoev_del(main_loop, client->fd)) {
activecnt--;
DEBUG("activecnt:%d", activecnt);
}
DEBUG("picoev_del client:%p fd:%d", client, client->fd);
}
clean_client(client);
DEBUG("remain http pipeline size :%d", client->request_queue->size);
if (client->request_queue->size > 0) {
if (check_status_code(client) > 0) {
//process pipeline
if (prepare_call_wsgi(client) > 0) {
call_wsgi_handler(client);
}
}
return ;
}
if (client->http_parser != NULL) {
/* PyMem_Free(client->http_parser); */
dealloc_parser(client->http_parser);
}
free_request_queue(client->request_queue);
if (!client->keep_alive) {
close(client->fd);
BDEBUG("close client:%p fd:%d", client, client->fd);
} else {
BDEBUG("keep alive client:%p fd:%d", client, client->fd);
new_client = new_client_t(client->fd, client->remote_addr, client->remote_port);
new_client->keep_alive = 1;
init_parser(new_client, server_name, server_port);
ret = picoev_add(main_loop, new_client->fd, PICOEV_READ, keep_alive_timeout, read_callback, (void *)new_client);
if (ret == 0) {
activecnt++;
}
}
//clear old client
dealloc_client(client);
}
static void init_main_loop(void)
{
if (main_loop == NULL) {
/* init picoev */
picoev_init(max_fd);
/* create loop */
main_loop = picoev_create_loop(60);
}
}
static void
kill_callback(picoev_loop* loop, int fd, int events, void* cb_arg)
{
picoev_del(loop, fd);
if ((events & PICOEV_TIMEOUT) != 0) {
DEBUG("force shutdown...");
loop_done = 0;
}
}
static inline void
kill_server(int timeout)
{
int listen_sock = 0;
PyObject *iter = NULL, *item;
int set_callback = 0;
if (main_loop == NULL) {
return;
}
iter = PyObject_GetIter(listen_socks);
if (PyErr_Occurred()){
call_error_logger();
return;
}
while((item = PyIter_Next(iter))){
#ifdef PY3
if (PyLong_Check(item)) {
listen_sock = (int)PyLong_AsLong(item);
#else
if (PyInt_Check(item)) {
listen_sock = (int)PyInt_AsLong(item);
#endif
//stop accepting
if (!picoev_del(main_loop, listen_sock)) {
activecnt--;
DEBUG("activecnt:%d", activecnt);
}
if (!set_callback) {
//shutdown timeout
if (timeout > 0) {
//set timeout
(void)picoev_add(main_loop, listen_sock, PICOEV_TIMEOUT, timeout, kill_callback, NULL);
} else {
(void)picoev_add(main_loop, listen_sock, PICOEV_TIMEOUT, 1, kill_callback, NULL);
}
set_callback = 1;
}
} else {
//TODO WARN???
}
Py_DECREF(item);
}
Py_DECREF(iter);
}
static inline void
set_current_request(client_t *client)
{
request *req;
req = shift_request(client->request_queue);
client->current_req = req;
}
static void
set_bad_request_code(client_t *client, int status_code)
{
request *req;
req = client->request_queue->tail;
req->bad_request_code = status_code;
DEBUG("set bad request code %d", status_code);
}
static int
check_status_code(client_t *client)
{
request *req;
req = client->request_queue->head;
if (req && req->bad_request_code > 200) {
//error
//shift
DEBUG("bad status code %d", req->bad_request_code);
set_current_request(client);
client->status_code = req->bad_request_code;
send_error_page(client);
close_client(client);
return -1;
}
return 1;
}
static PyObject *
app_handler(PyObject *self, PyObject *args)
{
int ret, active;
PyObject *wsgi_args = NULL, *start = NULL, *current = NULL, *parent = NULL, *res = NULL;
PyObject *env = NULL;
ClientObject *pyclient;
client_t *client;
request *req;
response_status status;
if (!PyArg_ParseTuple(args, "O:app_handler", &env)) {
return NULL;
}
pyclient = (ClientObject*)PyDict_GetItem(env, client_key);
client = pyclient->client;
req = client->current_req;
start = create_start_response(client);
if (!start) {
return NULL;
}
DEBUG("call wsgi app");
wsgi_args = PyTuple_Pack(2, env, start);
res = PyObject_CallObject(wsgi_app, wsgi_args);
Py_DECREF(wsgi_args);
DEBUG("called wsgi app");
//check response & PyErr_Occurred
if (res && res == Py_None) {
PyErr_SetString(PyExc_Exception, "response must be a iter or sequence object");
goto error;
}
//Check wsgi_app error
if (PyErr_Occurred()) {
goto error;
}
client->response = res;
if (client->response_closed) {
//closed
close_client(client);
Py_RETURN_NONE;
}
status = response_start(client);
#ifdef WITH_GREENLET
while(status != STATUS_OK) {
if (status == STATUS_ERROR) {
// Internal Server Error
req->bad_request_code = 500;
goto error;
} else {
active = picoev_is_active(main_loop, client->fd);
ret = picoev_add(main_loop, client->fd, PICOEV_WRITE, 300, trampoline_callback, (void *)pyclient);
if ((ret == 0 && !active)) {
activecnt++;
}
// switch to hub
current = pyclient->greenlet;
parent = greenlet_getparent(current);
/* Py_INCREF(hub_switch_value); */
res = greenlet_switch(parent, hub_switch_value, NULL);
Py_XDECREF(res);
// try again after event switch
status = process_body(client);
}
}
status = close_response(client);
if (status == STATUS_ERROR) {
//TODO logging error
}
// send OK
close_client(client);
#else
switch(status) {
case STATUS_ERROR:
// Internal Server Error
req->bad_request_code = 500;
goto error;
case STATUS_SUSPEND:
// continue
// set callback
active = picoev_is_active(main_loop, client->fd);
ret = picoev_add(main_loop, client->fd, PICOEV_WRITE, 300, write_callback, (void *)pyclient);
if ((ret == 0 && !active)) {
activecnt++;
}
default:
// send OK
close_client(client);
}
#endif
Py_RETURN_NONE;
error:
client->status_code = 500;
status = close_response(client);
if (status == STATUS_ERROR) {
//TODO logging error
}
/* write_error_log(__FILE__, __LINE__); */
call_error_logger();
send_error_page(client);
close_client(client);
Py_RETURN_NONE;
}
static PyMethodDef app_handler_def = {"_app_handler", (PyCFunction)app_handler, METH_VARARGS, 0};
static PyObject*
get_app_handler(void)
{
if (app_handler_func == NULL) {
app_handler_func = PyCFunction_NewEx(&app_handler_def, (PyObject *)NULL, NULL);
}
//Py_INCREF(app_handler_func);
return app_handler_func;
}
#ifdef WITH_GREENLET
static void
resume_greenlet(PyObject *greenlet)
{
PyObject *res = NULL;
PyObject *err_type, *err_val, *err_tb;
if (PyErr_Occurred()) {
PyErr_Fetch(&err_type, &err_val, &err_tb);
PyErr_Clear();
//set error
res = greenlet_throw(greenlet, err_type, err_val, err_tb);
} else {
/* Py_INCREF(hub_switch_value); */
res = greenlet_switch(greenlet, hub_switch_value, NULL);
if (res == NULL) {
call_error_logger();
/* PyErr_Fetch(&err_type, &err_val, &err_tb); */
/* PyErr_Clear(); */
//set error
/* res = greenlet_throw(greenlet, err_type, err_val, err_tb); */
}
}
Py_XDECREF(res);
if (greenlet_dead(greenlet)) {
Py_DECREF(greenlet);
}
}
static void
resume_wsgi_handler(ClientObject *pyclient)
{
PyObject *res = NULL;
PyObject *err_type, *err_val, *err_tb;
client_t *old_client;
client_t *client = pyclient->client;
//swap bind client_t
old_client = start_response->cli;
start_response->cli = client;
current_client = (PyObject *)pyclient;
if (PyErr_Occurred()) {
PyErr_Fetch(&err_type, &err_val, &err_tb);
PyErr_Clear();
//set error
res = greenlet_throw(pyclient->greenlet, err_type, err_val, err_tb);
} else {
res = greenlet_switch(pyclient->greenlet, pyclient->args, pyclient->kwargs);
}
start_response->cli = old_client;
Py_CLEAR(pyclient->args);
Py_CLEAR(pyclient->kwargs);
Py_XDECREF(res);
}
#endif
static void
call_wsgi_handler(client_t *client)
{
PyObject *handler, *greenlet, *args, *res;
ClientObject *pyclient;
request *req = NULL;
handler = get_app_handler();
req = client->current_req;
current_client = PyDict_GetItem(req->environ, client_key);
pyclient = (ClientObject *)current_client;
args = PyTuple_Pack(1, req->environ);
#ifdef WITH_GREENLET
//new greenlet
greenlet = greenlet_new(handler, NULL);
// set_greenlet
pyclient->greenlet = greenlet;
Py_INCREF(pyclient->greenlet);
res = greenlet_switch(greenlet, args, NULL);
//res = PyObject_CallObject(wsgi_app, args);
Py_DECREF(args);
Py_DECREF(greenlet);
#else
pyclient->greenlet = NULL;
res = PyObject_CallObject(handler, args);
Py_DECREF(args);
#endif
Py_XDECREF(res);
}
#ifdef WITH_GREENLET
static void
timeout_error_callback(picoev_loop* loop, int fd, int events, void* cb_arg)
{
ClientObject *pyclient = (ClientObject *)(cb_arg);
client_t *client = pyclient->client;
if ((events & PICOEV_TIMEOUT) != 0) {
DEBUG("timeout_error_callback pyclient:%p client:%p fd:%d", pyclient, pyclient->client, pyclient->client->fd);
if (!picoev_del(loop, fd)) {
activecnt--;
DEBUG("activecnt:%d", activecnt);
}
pyclient->suspended = 0;
/* pyclient->resumed = 1; */
PyErr_SetString(timeout_error, "timeout");
set_so_keepalive(client->fd, 0);
resume_wsgi_handler(pyclient);
}
}
static void
timeout_callback(picoev_loop* loop, int fd, int events, void* cb_arg)
{
ClientObject *pyclient = (ClientObject *)(cb_arg);
client_t *client = pyclient->client;
if ((events & PICOEV_TIMEOUT) != 0) {
DEBUG("timeout_callback pyclient:%p client:%p fd:%d", pyclient, pyclient->client, pyclient->client->fd);
//next intval 30sec
picoev_set_timeout(loop, client->fd, 30);
// is_active ??
if (write(client->fd, "", 0) < 0) {
if (!picoev_del(loop, fd)) {
activecnt--;
DEBUG("activecnt:%d", activecnt);
}
//resume
pyclient->suspended = 0;
/* pyclient->resumed = 1; */
PyErr_SetFromErrno(PyExc_IOError);
DEBUG("closed");
set_so_keepalive(client->fd, 0);
resume_wsgi_handler(pyclient);
}
}
}
static void
trampoline_callback(picoev_loop* loop, int fd, int events, void* cb_arg)
{
PyObject *o = NULL;
ClientObject *pyclient = NULL;
client_t *client = NULL;
if (!picoev_del(loop, fd)) {
activecnt--;
DEBUG("activecnt:%d", activecnt);
}
YDEBUG("call trampoline_callback fd:%d event:%d cb_arg:%p", fd, events, cb_arg);
o = (PyObject*)cb_arg;
if (CheckClientObject(o)) {
pyclient = (ClientObject*)cb_arg;
client = pyclient->client;
if ((events & PICOEV_TIMEOUT) != 0) {
RDEBUG("** trampoline_callback timeout **");
//timeout
client->keep_alive = 0;
PyErr_SetString(timeout_error, "timeout");
}
YDEBUG("resume_wsgi_handler");
resume_wsgi_handler(pyclient);
} else if (greenlet_check(o)) {
YDEBUG("resume_greenlet");
resume_greenlet(o);
}
}
#endif
#ifndef WITH_GREENLET
static void
write_callback(picoev_loop* loop, int fd, int events, void* cb_arg)
{
ClientObject *pyclient = (ClientObject*)cb_arg;
client_t *client = pyclient->client;
int ret;
DEBUG("call write_callback");
current_client = (PyObject*)pyclient;
if ((events & PICOEV_TIMEOUT) != 0) {
DEBUG("** write_callback timeout **");
//timeout
client->keep_alive = 0;
close_client(client);
} else if ((events & PICOEV_WRITE) != 0) {
ret = process_body(client);
DEBUG("process_body ret %d", ret);
if (ret != 0) {
//ok or die
close_client(client);
}
}
}
#endif
static int
check_http_expect(client_t *client)
{
PyObject *c = NULL;
char *val = NULL;
int ret;
request *req = client->current_req;
if (client->http_parser->http_minor == 1) {
///TODO CHECK
c = PyDict_GetItemString(req->environ, "HTTP_EXPECT");
if (c) {
val = PyBytes_AS_STRING(c);
if (!strncasecmp(val, "100-continue", 12)) {
ret = write(client->fd, "HTTP/1.1 100 Continue\r\n\r\n", 25);
if (ret < 0) {
//fail
PyErr_SetFromErrno(PyExc_IOError);
/* write_error_log(__FILE__, __LINE__); */
call_error_logger();
client->keep_alive = 0;
client->status_code = 500;
send_error_page(client);
close_client(client);
return -1;
}
} else {
//417
client->keep_alive = 0;
client->status_code = 417;
send_error_page(client);
close_client(client);
return -1;
}
}
return 1;
}
return 0;
}
#ifdef PY3
static int
set_input_file(client_t *client)
{
PyObject *input;
int fd;
request *req = client->current_req;
FILE *tmp = (FILE *)req->body;
fflush(tmp);
rewind(tmp);
fd = fileno(tmp);
input = PyFile_FromFd(fd, "<tmpfile>", "r", -1, NULL, NULL, NULL, 1);
if (input == NULL) {
fclose(tmp);
req->body = NULL;
return -1;
}
//env["wsgi.input"] = tmpfile
//
PyDict_SetItem((PyObject *)req->environ, wsgi_input_key, input);
Py_DECREF(input);
req->body = NULL;
return 1;
}
#else
static int
set_input_file(client_t *client)
{
PyObject *input;
request *req = client->current_req;
FILE *tmp = (FILE *)req->body;
fflush(tmp);
rewind(tmp);
input = PyFile_FromFile(tmp, "<tmpfile>", "r", fclose);
if (input == NULL) {
fclose(tmp);
req->body = NULL;
return -1;
}
//env["wsgi.input"] = tmpfile
//
PyDict_SetItem((PyObject *)req->environ, wsgi_input_key, input);
Py_DECREF(input);
req->body = NULL;
return 0;
}
#endif
static int
set_input_object(client_t *client)
{
PyObject *input = NULL;
request *req = client->current_req;
if (req->body_type == BODY_TYPE_BUFFER) {
input = InputObject_New((buffer_t*)req->body);
} else {
if (req->body) {
input = InputObject_New((buffer_t*)req->body);
} else {
input = InputObject_New(new_buffer(0, 0));
}
}
if (input == NULL) {
return -1;
}
PyDict_SetItem((PyObject *)req->environ, wsgi_input_key, input);
Py_DECREF(input);
req->body = NULL;
return 1;
}
/*
static void
setting_keepalive(client_t *client)
{
PyObject *c;
char *val;
if (is_keep_alive) {
//support keep-alive
c = PyDict_GetItemString(client->environ, "HTTP_CONNECTION");
if (client->http_parser->http_minor == 1) {
//HTTP 1.1
if (c) {
val = PyBytes_AS_STRING(c);
if (!strcasecmp(val, "close")) {
client->keep_alive = 0;
} else {
client->keep_alive = 1;
}
} else {
client->keep_alive = 1;
}
} else {
//HTTP 1.0
if (c) {
val = PyBytes_AS_STRING(c);
if (!strcasecmp(val, "keep-alive")) {
client->keep_alive = 1;
} else {
client->keep_alive = 0;
}
} else {
client->keep_alive = 0;
}
}
}
}
*/
static int
prepare_call_wsgi(client_t *client)
0