2
0
Fork 0
lighttpd2/src/request.h

100 lines
1.8 KiB
C
Raw Normal View History

2008-06-30 10:25:01 +00:00
#ifndef _LIGHTTPD_REQUEST_H_
#define _LIGHTTPD_REQUEST_H_
typedef enum {
HTTP_METHOD_UNSET = -1,
HTTP_METHOD_GET,
HTTP_METHOD_POST,
HTTP_METHOD_HEAD,
HTTP_METHOD_OPTIONS,
HTTP_METHOD_PROPFIND, /* WebDAV */
HTTP_METHOD_MKCOL,
HTTP_METHOD_PUT,
HTTP_METHOD_DELETE,
HTTP_METHOD_COPY,
HTTP_METHOD_MOVE,
HTTP_METHOD_PROPPATCH,
HTTP_METHOD_REPORT, /* DeltaV */
HTTP_METHOD_CHECKOUT,
HTTP_METHOD_CHECKIN,
HTTP_METHOD_VERSION_CONTROL,
HTTP_METHOD_UNCHECKOUT,
HTTP_METHOD_MKACTIVITY,
HTTP_METHOD_MERGE,
HTTP_METHOD_LOCK,
HTTP_METHOD_UNLOCK,
HTTP_METHOD_LABEL,
HTTP_METHOD_CONNECT
} http_method_t;
typedef enum {
HTTP_VERSION_UNSET = -1,
HTTP_VERSION_1_0,
HTTP_VERSION_1_1
} http_version_t;
struct request;
typedef struct request request;
struct request_uri;
typedef struct request_uri request_uri;
2008-06-30 11:38:52 +00:00
struct physical;
typedef struct physical physical;
#include "http_headers.h"
2008-08-05 15:08:32 +00:00
#include "http_request_parser.h"
2008-06-30 10:25:01 +00:00
struct request_uri {
GString *raw;
2008-06-30 10:25:01 +00:00
GString *scheme;
GString *authority;
2008-06-30 10:25:01 +00:00
GString *path;
GString *query;
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
2008-08-07 12:12:51 +00:00
gint64 size;
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;
http_headers *headers;
2008-06-30 10:25:01 +00:00
/* Parsed headers: */
goffset content_length;
2008-08-05 15:08:32 +00:00
http_request_ctx parser_ctx;
2008-06-30 10:25:01 +00:00
};
#include "base.h"
2008-08-05 15:08:32 +00:00
LI_API void request_init(request *req, chunkqueue *in);
LI_API void request_reset(request *req);
LI_API void request_clear(request *req);
2008-08-06 18:46:42 +00:00
LI_API void request_validate_header(server *srv, connection *con);
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