enhanced qse_httpd_entaskfile() and qse_httpd_entaskdir() to handle more methods.

added qse_httpd_entaskallow().
removed some unused functions.
This commit is contained in:
2013-03-28 09:43:59 +00:00
parent 595e3be043
commit 28119c7289
13 changed files with 667 additions and 385 deletions

View File

@ -166,6 +166,7 @@ struct qse_httpd_scb_t
int (*stat) (
qse_httpd_t* httpd, const qse_mchar_t* path,
qse_httpd_stat_t* stat);
int (*purge) (qse_httpd_t* httpd, const qse_mchar_t* path);
int (*ropen) (
qse_httpd_t* httpd, const qse_mchar_t* path,
@ -185,6 +186,12 @@ struct qse_httpd_scb_t
struct
{
int (*stat) (
qse_httpd_t* httpd, const qse_mchar_t* path,
qse_httpd_stat_t* stat);
int (*make) (qse_httpd_t* httpd, const qse_mchar_t* path);
int (*purge) (qse_httpd_t* httpd, const qse_mchar_t* path);
int (*open) (
qse_httpd_t* httpd, const qse_mchar_t* path,
qse_ubi_t* handle);
@ -808,6 +815,14 @@ QSE_EXPORT qse_httpd_task_t* qse_httpd_entasknomod (
qse_htre_t* req
);
QSE_EXPORT qse_httpd_task_t* qse_httpd_entaskallow (
qse_httpd_t* httpd,
qse_httpd_client_t* client,
qse_httpd_task_t* pred,
const qse_mchar_t* allow,
qse_htre_t* req
);
QSE_EXPORT qse_httpd_task_t* qse_httpd_entaskdir (
qse_httpd_t* httpd,
qse_httpd_client_t* client,

View File

@ -41,7 +41,8 @@ typedef void (*qse_httpd_serverstd_freersrc_t) (
enum qse_httpd_serverstd_root_type_t
{
QSE_HTTPD_SERVERSTD_ROOT_PATH,
QSE_HTTPD_SERVERSTD_ROOT_NWAD
QSE_HTTPD_SERVERSTD_ROOT_NWAD,
QSE_HTTPD_SERVERSTD_ROOT_TEXT
};
typedef enum qse_httpd_serverstd_root_type_t qse_httpd_serverstd_root_type_t;
@ -57,6 +58,11 @@ struct qse_httpd_serverstd_root_t
qse_size_t rpl; /* replacement length */
} path;
qse_nwad_t nwad;
struct
{
const qse_mchar_t* ptr;
const qse_mchar_t* mime;
} text;
} u;
};