2008-06-30 10:25:01 +00:00
|
|
|
#ifndef _LIGHTTPD_REQUEST_H_
|
|
|
|
#define _LIGHTTPD_REQUEST_H_
|
|
|
|
|
2008-10-28 21:11:50 +00:00
|
|
|
#ifndef _LIGHTTPD_BASE_H_
|
2008-11-16 20:33:53 +00:00
|
|
|
#error Please include <lighttpd/base.h> instead of this file
|
2008-10-28 21:11:50 +00:00
|
|
|
#endif
|
2008-07-01 18:56:59 +00:00
|
|
|
|
2008-06-30 10:25:01 +00:00
|
|
|
struct request_uri {
|
2008-08-09 15:20:12 +00:00
|
|
|
GString *raw;
|
2008-06-30 10:25:01 +00:00
|
|
|
|
|
|
|
GString *scheme;
|
2008-08-09 15:20:12 +00:00
|
|
|
GString *authority;
|
2009-01-01 15:44:42 +00:00
|
|
|
GString *path, *orig_path;
|
2008-06-30 10:25:01 +00:00
|
|
|
GString *query;
|
2008-08-09 15:20:12 +00:00
|
|
|
|
|
|
|
GString *host; /* without userinfo and port */
|
2008-06-30 10:25:01 +00:00
|
|
|
};
|
|
|
|
|
2008-06-30 11:38:52 +00:00
|
|
|
struct physical {
|
2008-06-30 10:25:01 +00:00
|
|
|
GString *path;
|
|
|
|
GString *basedir;
|
|
|
|
|
|
|
|
GString *doc_root;
|
|
|
|
GString *rel_path;
|
|
|
|
|
|
|
|
GString *pathinfo;
|
2008-06-30 11:38:52 +00:00
|
|
|
|
2009-01-05 21:24:54 +00:00
|
|
|
gboolean have_stat;
|
2009-01-07 23:26:30 +00:00
|
|
|
gboolean have_errno;
|
|
|
|
guint stat_errno;
|
2009-01-05 21:24:54 +00:00
|
|
|
struct stat stat; /* contains valid data only if have_stat is true */
|
2008-06-30 10:25:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct request {
|
|
|
|
http_method_t http_method;
|
|
|
|
GString *http_method_str;
|
|
|
|
http_version_t http_version;
|
|
|
|
|
|
|
|
request_uri uri;
|
|
|
|
|
2008-07-01 18:56:59 +00:00
|
|
|
http_headers *headers;
|
2008-06-30 10:25:01 +00:00
|
|
|
/* Parsed headers: */
|
|
|
|
goffset content_length;
|
|
|
|
};
|
|
|
|
|
2008-09-29 15:07:53 +00:00
|
|
|
LI_API void request_init(request *req);
|
2008-08-05 15:08:32 +00:00
|
|
|
LI_API void request_reset(request *req);
|
|
|
|
LI_API void request_clear(request *req);
|
2008-07-01 18:56:59 +00:00
|
|
|
|
2008-10-25 12:53:57 +00:00
|
|
|
LI_API gboolean request_validate_header(connection *con);
|
2008-08-06 18:46:42 +00:00
|
|
|
|
2008-08-07 12:12:51 +00:00
|
|
|
LI_API void physical_init(physical *phys);
|
|
|
|
LI_API void physical_reset(physical *phys);
|
|
|
|
LI_API void physical_clear(physical *phys);
|
|
|
|
|
2008-06-30 10:25:01 +00:00
|
|
|
#endif
|