enhanced proxying to handle protocol upgrade.

enhanced qse_mbsword() and its family to accept an extra delimiter
This commit is contained in:
2014-10-08 14:07:55 +00:00
parent 8a32cbc4f1
commit 1df4e0bc9f
10 changed files with 310 additions and 187 deletions

View File

@ -1584,40 +1584,52 @@ QSE_EXPORT qse_wchar_t* qse_wcsxnrcasestr (
const qse_mchar_t* qse_mbsword (
const qse_mchar_t* str,
const qse_mchar_t* word
const qse_mchar_t* word,
qse_mchar_t extra_delim
);
const qse_wchar_t* qse_wcsword (
const qse_wchar_t* str,
const qse_wchar_t* word
const qse_wchar_t* word,
qse_wchar_t extra_delim
);
/**
* The qse_mbsxword() function finds a whole word in a string.
* The word can be delimited by white spaces or an extra delimiter
* \a extra_delim. Pass QSE_MT('\0') if no extra delimiter is
* needed.
*/
const qse_mchar_t* qse_mbsxword (
const qse_mchar_t* str,
qse_size_t len,
const qse_mchar_t* word
const qse_mchar_t* word,
qse_mchar_t extra_delim
);
/**
* The qse_wcsxword() function finds a whole word in a string.
* The word can be delimited by white spaces or an extra delimiter
* \a extra_delim. Pass QSE_WT('\0') if no extra delimiter is
* needed.
*/
const qse_wchar_t* qse_wcsxword (
const qse_wchar_t* str,
qse_size_t len,
const qse_wchar_t* word
const qse_wchar_t* word,
qse_wchar_t extra_delim
);
const qse_mchar_t* qse_mbscaseword (
const qse_mchar_t* str,
const qse_mchar_t* word
const qse_mchar_t* word,
qse_mchar_t extra_delim
);
const qse_wchar_t* qse_wcscaseword (
const qse_wchar_t* str,
const qse_wchar_t* word
const qse_wchar_t* word,
qse_wchar_t extra_delim
);
/**
@ -1627,7 +1639,8 @@ const qse_wchar_t* qse_wcscaseword (
const qse_mchar_t* qse_mbsxcaseword (
const qse_mchar_t* str,
qse_size_t len,
const qse_mchar_t* word
const qse_mchar_t* word,
qse_mchar_t extra_delim
);
/**
@ -1637,19 +1650,20 @@ const qse_mchar_t* qse_mbsxcaseword (
const qse_wchar_t* qse_wcsxcaseword (
const qse_wchar_t* str,
qse_size_t len,
const qse_wchar_t* word
const qse_wchar_t* word,
qse_wchar_t extra_delim
);
#if defined(QSE_CHAR_IS_MCHAR)
# define qse_strword(str,word) qse_mbsword(str,word)
# define qse_strxword(str,len,word) qse_mbsxword(str,len,word)
# define qse_strcaseword(str,word) qse_mbscaseword(str,word)
# define qse_strxcaseword(str,len,word) qse_mbsxcaseword(str,len,word)
# define qse_strword(str,word,edelim) qse_mbsword(str,word,edelim)
# define qse_strxword(str,len,word,edelim) qse_mbsxword(str,len,word,edelim)
# define qse_strcaseword(str,word,edelim) qse_mbscaseword(str,word,edelim)
# define qse_strxcaseword(str,len,word,edelim) qse_mbsxcaseword(str,len,word,edelim)
#else
# define qse_strword(str,word) qse_wcsword(str,word)
# define qse_strxword(str,len,word) qse_wcsxword(str,len,word)
# define qse_strcaseword(str,word) qse_wcscaseword(str,word)
# define qse_strxcaseword(str,len,word) qse_wcsxcaseword(str,len,word)
# define qse_strword(str,word,edelim) qse_wcsword(str,word,edelim)
# define qse_strxword(str,len,word,edelim) qse_wcsxword(str,len,word,edelim)
# define qse_strcaseword(str,word,edelim) qse_wcscaseword(str,word,edelim)
# define qse_strxcaseword(str,len,word,edelim) qse_wcsxcaseword(str,len,word,edelim)
#endif
/**

View File

@ -38,7 +38,8 @@ enum qse_htrd_errnum_t
QSE_HTRD_EBADRE,
QSE_HTRD_EBADHDR,
QSE_HTRD_ERECBS,
QSE_HTRD_ECONCB
QSE_HTRD_ECONCB,
QSE_HTRD_ESUSPENDED
};
typedef enum qse_htrd_errnum_t qse_htrd_errnum_t;
@ -56,8 +57,7 @@ enum qse_htrd_option_t
QSE_HTRD_REQUEST = (1 << 4), /**< parse input as a request */
QSE_HTRD_RESPONSE = (1 << 5), /**< parse input as a response */
QSE_HTRD_TRAILERS = (1 << 6), /**< store trailers in a separate table */
QSE_HTRD_STRICT = (1 << 7), /**< be more picky */
QSE_HTRD_DUMMY = (1 << 8) /**< be dummy */
QSE_HTRD_STRICT = (1 << 7) /**< be more picky */
};
typedef enum qse_htrd_option_t qse_htrd_option_t;
@ -75,6 +75,7 @@ struct qse_htrd_t
qse_mmgr_t* mmgr;
qse_htrd_errnum_t errnum;
int option;
int flags;
const qse_htrd_recbs_t* recbs;
@ -149,7 +150,7 @@ QSE_EXPORT void qse_htrd_clear (
);
QSE_EXPORT int qse_htrd_getoption (
qse_htrd_t* htrd
qse_htrd_t* htrd
);
QSE_EXPORT void qse_htrd_setoption (
@ -185,6 +186,22 @@ QSE_EXPORT int qse_htrd_halt (
qse_htrd_t* htrd
);
QSE_EXPORT void qse_htrd_suspend (
qse_htrd_t* htrd
);
QSE_EXPORT void qse_htrd_resume (
qse_htrd_t* htrd
);
QSE_EXPORT void qse_htrd_dummify (
qse_htrd_t* htrd
);
QSE_EXPORT void qse_htrd_undummify (
qse_htrd_t* htrd
);
QSE_EXPORT int qse_htrd_scanqparam (
qse_htrd_t* http,
const qse_mcstr_t* cstr