http-server.c revision e1a4ea6ad3e799ef8df7395e765c0ae9218e6c5d
02c335c23bf5fa225a467c19f2c063fb0dc7b8c3Timo Sirainen/* Copyright (c) 2013-2016 Dovecot authors, see the included COPYING file */
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Boschstruct http_server *http_server_init(const struct http_server_settings *set)
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch pool = pool_alloconly_create("http server", 1024);
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch if (set->rawlog_dir != NULL && *set->rawlog_dir != '\0')
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch server->set.rawlog_dir = p_strdup(pool, set->rawlog_dir);
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch server->set.max_client_idle_time_msecs = set->max_client_idle_time_msecs;
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch (set->max_pipelined_requests > 0 ? set->max_pipelined_requests : 1);
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch server->set.request_limits = set->request_limits;
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch server->conn_list = http_server_connection_list_init();
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Boschvoid http_server_deinit(struct http_server **_server)
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch ssl_iostream_context_deinit(&server->ssl_ctx);
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Boschvoid http_server_switch_ioloop(struct http_server *server)
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch struct connection *_conn = server->conn_list->connections;
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch /* move connections */
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch /* FIXME: we wouldn't necessarily need to switch all of them
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch immediately, only those that have requests now. but also connections
3fcb3d2d1f3583025ff62bae95ec706920f398b1Stephan Bosch that get new requests before ioloop is switched again.. */