improved dns and proxy handling in httpd

This commit is contained in:
2014-07-23 16:07:43 +00:00
parent 5703aaa8a5
commit 1231b3b941
13 changed files with 200 additions and 50 deletions

View File

@ -110,6 +110,9 @@ QSE_EXPORT void qse_setnwadport (
qse_uint16_t port
);
QSE_EXPORT qse_uint16_t qse_getnwadport (
qse_nwad_t* nwad
);
QSE_EXPORT int qse_mbstonwad (
const qse_mchar_t* mbs,

View File

@ -251,7 +251,8 @@ QSE_EXPORT qse_ssize_t qse_sio_getmbsn (
* The qse_sio_getwcs() function reads at most @a size - 1 characters
* from the stream @a sio into the buffer @a buf. If a new line or EOF
* is encountered, it stops reading from the stream. It null-terminates
* the buffer if @a size is greater than 0. */
* the buffer if @a size is greater than 0.
*/
QSE_EXPORT qse_ssize_t qse_sio_getwcs (
qse_sio_t* sio,
qse_wchar_t* buf,

View File

@ -89,7 +89,7 @@ struct qse_htre_t
const qse_mchar_t* str;
} code;
const qse_mchar_t* mesg;
} s;
} s;
} u;
/* special attributes derived from the header */

View File

@ -56,6 +56,7 @@ enum qse_httpd_errnum_t
QSE_HTTPD_ENOBUF, /* no buffer available */
QSE_HTTPD_EDISCON, /* client disconnnected */
QSE_HTTPD_EBADREQ, /* bad request */
QSE_HTTPD_ENODNS, /* dns service not activated */
QSE_HTTPD_ETASK
};
typedef enum qse_httpd_errnum_t qse_httpd_errnum_t;
@ -77,7 +78,9 @@ enum qse_httpd_trait_t
QSE_HTTPD_CGINOCLOEXEC = (1 << 2),
QSE_HTTPD_CGINOCHUNKED = (1 << 3),
QSE_HTTPD_PROXYNOVIA = (1 << 4),
QSE_HTTPD_LOGACT = (1 << 5)
QSE_HTTPD_LOGACT = (1 << 5),
QSE_HTTPD_DNSNOA = (1 << 6),
QSE_HTTPD_DNSNOAAAA = (1 << 7),
};
typedef enum qse_httpd_trait_t qse_httpd_trait_t;
@ -358,9 +361,7 @@ enum qse_httpd_task_trigger_mask_t
typedef struct qse_httpd_task_trigger_t qse_httpd_task_trigger_t;
struct qse_httpd_task_trigger_t
{
int flags; /**< [IN] bitwise-ORed of #qse_httpd_task_trigger_flag_t enumerators*/
int cmask; /* client mask - QSE_HTTPD_TASK_TRIGGER_READ | QSE_HTTPD_TASK_TRIGGER_WRITE */
struct
{

View File

@ -23,7 +23,6 @@
#include <qse/http/httpd.h>
typedef int (*qse_httpd_serverstd_makersrc_t) (
qse_httpd_t* httpd,
qse_httpd_client_t* client,
@ -196,7 +195,8 @@ QSE_EXPORT void* qse_httpd_getserverstdxtn (
);
QSE_EXPORT int qse_httpd_loopstd (
qse_httpd_t* httpd
qse_httpd_t* httpd,
const qse_nwad_t* dnsnwad
);
#ifdef __cplusplus