lighttpd 1.4.x https://www.lighttpd.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.0 KiB

#ifndef _RESPONSE_H_
#define _RESPONSE_H_
#include "first.h"
#include "base_decls.h"
#include "buffer.h"
#include "array.h"
#include <time.h>
int http_response_parse(server *srv, connection *con);
int http_response_write_header(server *srv, connection *con);
typedef struct http_cgi_opts_t {
int authorizer;
int break_scriptfilename_for_php;
buffer *docroot;
buffer *strip_request_uri;
} http_cgi_opts;
enum {
BACKEND_UNSET = 0,
BACKEND_PROXY,
BACKEND_CGI,
BACKEND_FASTCGI,
BACKEND_SCGI
};
typedef struct http_response_opts_t {
int fdfmt;
int backend;
int authorizer;
unsigned short local_redir;
unsigned short xsendfile_allow;
array *xsendfile_docroot;
void *pdata;
[core] shared code for socket backends common codebase for socket backends, based off mod_fastcgi with some features added for mod_proxy (mostly intended to reduce code duplication and enhance code isolation) mod_fastcgi and mod_scgi can now use fastcgi.balance and scgi.balance for similar behavior as proxy.balance, but the balancing is per-host and not per-proc. proxy.balance is also per-host and not per-proc. mod_proxy and mod_scgi can now use proxy.map-extensions and scgi.map-extensions, similar to fastcgi.map-extensions. mod_fastcgi behavior change (affects only mod_status): - statistics tags have been renamed from &#34;fastcgi.*&#34; to &#34;gw.*&#34; &#34;fastcgi.backend.*&#34; -&gt; &#34;gw.backend.*&#34; &#34;fastcgi.active-requests&#34; -&gt; &#34;gw.active-requests&#34; (&#34;fastcgi.requests&#34; remains &#34;fastcgi.requests&#34;) (&#34;proxy.requests&#34; is new) (&#34;scgi.requests&#34; is new) mod_scgi behavior change (likely minor): - removed scgi_proclist_sort_down() and scgi_proclist_sort_up(). procs now chosen based on load as measured by num socket connnections Note: modules using gw_backend.[ch] are currently still independent modules. If it had been written as a single module with fastcgi, scgi, proxy implementations, then there would have been a chance of breaking some existing user configurations where module ordering made a difference for which module handled a given request, though for most people, this would have made no difference. Details about mod_fastcgi code transformations: unsigned int debug -&gt; int debug fastcgi_env member removed from plugin_config renamed &#34;fcgi&#34; and &#34;fastcgi&#34; to &#34;gw&#34;, and &#34;FCGI&#34; to &#34;GW&#34; reorganize routines for high-level and lower-level interfaces some lower-level internal interfaces changed to use host,proc,debug args rather than knowing about higher-level (app) hctx and plugin_data tabs-&gt;spaces and reformatting
4 years ago
handler_t(*parse)(server *, connection *, struct http_response_opts_t *, buffer *, size_t);
handler_t(*headers)(server *, connection *, struct http_response_opts_t *);
} http_response_opts;
typedef int (*http_cgi_header_append_cb)(void *vdata, const char *k, size_t klen, const char *v, size_t vlen);
int http_cgi_headers(server *srv, connection *con, http_cgi_opts *opts, http_cgi_header_append_cb cb, void *vdata);
handler_t http_response_parse_headers(server *srv, connection *con, http_response_opts *opts, buffer *hdrs);
handler_t http_response_read(server *srv, connection *con, http_response_opts *opts, buffer *b, fdnode *fdn);
handler_t http_response_prepare(server *srv, connection *con);
int http_response_buffer_append_authority(server *srv, connection *con, buffer *b);
int http_response_redirect_to_directory(server *srv, connection *con, int status);
int http_response_handle_cachable(server *srv, connection *con, buffer * mtime);
void http_response_body_clear(connection *con, int preserve_length);
void http_response_send_file (server *srv, connection *con, buffer *path);
void http_response_backend_done (server *srv, connection *con);
void http_response_backend_error (server *srv, connection *con);
void http_response_upgrade_read_body_unknown(server *srv, connection *con);
buffer * strftime_cache_get(server *srv, time_t last_mod);
#endif