handled dns timeout in httpd
This commit is contained in:
@ -57,6 +57,9 @@ struct qse_tmr_event_t
|
||||
|
||||
#define QSE_TMR_INVALID ((qse_size_t)-1)
|
||||
|
||||
#define QSE_TMR_SIZE(tmr) ((tmr)->size)
|
||||
#define QSE_TMR_CAPA(tmr) ((tmr)->capa);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -423,7 +423,6 @@ struct qse_httpd_client_t
|
||||
qse_ntime_t last_active;
|
||||
|
||||
qse_size_t tmr_idle;
|
||||
qse_size_t tmr_dns;
|
||||
|
||||
qse_httpd_client_t* prev;
|
||||
qse_httpd_client_t* next;
|
||||
|
@ -142,6 +142,16 @@ enum qse_httpd_serverstd_opt_t
|
||||
};
|
||||
typedef enum qse_httpd_serverstd_opt_t qse_httpd_serverstd_opt_t;
|
||||
|
||||
#define QSE_HTTPD_DNSSTD_DEFAULT_TMOUT 10
|
||||
|
||||
struct qse_httpd_dnsstd_t
|
||||
{
|
||||
qse_nwad_t nwad;
|
||||
qse_ntime_t tmout;
|
||||
};
|
||||
|
||||
typedef struct qse_httpd_dnsstd_t qse_httpd_dnsstd_t;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -196,8 +206,8 @@ QSE_EXPORT void* qse_httpd_getserverstdxtn (
|
||||
);
|
||||
|
||||
QSE_EXPORT int qse_httpd_loopstd (
|
||||
qse_httpd_t* httpd,
|
||||
const qse_nwad_t* dnsnwad
|
||||
qse_httpd_t* httpd,
|
||||
const qse_httpd_dnsstd_t* dns
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -287,32 +287,6 @@
|
||||
# define QSE_STRUCT_FIELD(id,value) value
|
||||
#endif
|
||||
|
||||
#ifdef NDEBUG
|
||||
# define QSE_ASSERT(expr) ((void)0)
|
||||
# define QSE_ASSERTX(expr,desc) ((void)0)
|
||||
#else
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
QSE_EXPORT void qse_assert_failed (
|
||||
const qse_char_t* expr, const qse_char_t* desc,
|
||||
const qse_char_t* file, qse_size_t line);
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
# define QSE_ASSERT(expr) (void)((expr) || \
|
||||
(qse_assert_failed (QSE_T(#expr), QSE_NULL, QSE_T(__FILE__), __LINE__), 0))
|
||||
# define QSE_ASSERTX(expr,desc) (void)((expr) || \
|
||||
(qse_assert_failed (QSE_T(#expr), QSE_T(desc), QSE_T(__FILE__), __LINE__), 0))
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define QSE_BEGIN_NAMESPACE(x) namespace x {
|
||||
# define QSE_END_NAMESPACE(x) }
|
||||
# define QSE_BEGIN_NAMESPACE2(x,y) namespace x { namespace y {
|
||||
# define QSE_END_NAMESPACE2(y,x) }}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The QSE_XTN() macro is a convenience macro to retrieve the pointer to
|
||||
@ -321,4 +295,39 @@
|
||||
*/
|
||||
#define QSE_XTN(obj) ((void*)(obj + 1))
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* ASSERTION
|
||||
* ---------------------------------------------------------------------- */
|
||||
|
||||
#ifdef NDEBUG
|
||||
# define QSE_ASSERT(expr) ((void)0)
|
||||
# define QSE_ASSERTX(expr,desc) ((void)0)
|
||||
#else
|
||||
|
||||
# define QSE_ASSERT(expr) (void)((expr) || \
|
||||
(qse_assert_failed (QSE_T(#expr), QSE_NULL, QSE_T(__FILE__), __LINE__), 0))
|
||||
# define QSE_ASSERTX(expr,desc) (void)((expr) || \
|
||||
(qse_assert_failed (QSE_T(#expr), QSE_T(desc), QSE_T(__FILE__), __LINE__), 0))
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
QSE_EXPORT void qse_assert_failed (
|
||||
const qse_char_t* expr, const qse_char_t* desc,
|
||||
const qse_char_t* file, qse_size_t line);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* C++ NAMESPACE
|
||||
* ---------------------------------------------------------------------- */
|
||||
#ifdef __cplusplus
|
||||
# define QSE_BEGIN_NAMESPACE(x) namespace x {
|
||||
# define QSE_END_NAMESPACE(x) }
|
||||
# define QSE_BEGIN_NAMESPACE2(x,y) namespace x { namespace y {
|
||||
# define QSE_END_NAMESPACE2(y,x) }}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user