fixed a bug of not resetting htre's flags field when clearing it
This commit is contained in:
parent
c5001505cd
commit
ca272bb55e
@ -144,6 +144,11 @@ server-default {
|
|||||||
|
|
||||||
#pseudonym = "nice-host";
|
#pseudonym = "nice-host";
|
||||||
|
|
||||||
|
# TOOD: add-headers and remove-headers
|
||||||
|
#add-headers = "X-Forwarded-For: ${Client_Ipaddr}",
|
||||||
|
# "X-Forwarded-Proto: ${Client-Proto}";
|
||||||
|
#remove-headers = "Connection";
|
||||||
|
|
||||||
dns-enabled = yes; # yes/on, no/off
|
dns-enabled = yes; # yes/on, no/off
|
||||||
dns-server = "192.168.1.1:53";
|
dns-server = "192.168.1.1:53";
|
||||||
#dns-server = "[::1]:53";
|
#dns-server = "[::1]:53";
|
||||||
|
@ -40,6 +40,7 @@ enum qse_htre_state_t
|
|||||||
QSE_HTRE_DISCARDED = (1 << 0), /** content has been discarded */
|
QSE_HTRE_DISCARDED = (1 << 0), /** content has been discarded */
|
||||||
QSE_HTRE_COMPLETED = (1 << 1) /** complete content has been seen */
|
QSE_HTRE_COMPLETED = (1 << 1) /** complete content has been seen */
|
||||||
};
|
};
|
||||||
|
typedef enum qse_htre_state_t qse_htre_state_t;
|
||||||
|
|
||||||
typedef int (*qse_htre_concb_t) (
|
typedef int (*qse_htre_concb_t) (
|
||||||
qse_htre_t* re,
|
qse_htre_t* re,
|
||||||
@ -92,7 +93,6 @@ struct qse_htre_t
|
|||||||
} s;
|
} s;
|
||||||
} u;
|
} u;
|
||||||
|
|
||||||
|
|
||||||
#define QSE_HTRE_ATTR_CHUNKED (1 << 0)
|
#define QSE_HTRE_ATTR_CHUNKED (1 << 0)
|
||||||
#define QSE_HTRE_ATTR_LENGTH (1 << 1)
|
#define QSE_HTRE_ATTR_LENGTH (1 << 1)
|
||||||
#define QSE_HTRE_ATTR_KEEPALIVE (1 << 2)
|
#define QSE_HTRE_ATTR_KEEPALIVE (1 << 2)
|
||||||
@ -120,7 +120,7 @@ struct qse_htre_t
|
|||||||
qse_htre_concb_t concb;
|
qse_htre_concb_t concb;
|
||||||
void* concb_ctx;
|
void* concb_ctx;
|
||||||
|
|
||||||
/* ORed of qse_htre_state_t */
|
/* bitwise-ORed of qse_htre_state_t */
|
||||||
int state;
|
int state;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ void qse_htre_clear (qse_htre_t* re)
|
|||||||
}
|
}
|
||||||
|
|
||||||
re->state = 0;
|
re->state = 0;
|
||||||
|
re->flags = 0;
|
||||||
|
|
||||||
QSE_MEMSET (&re->version, 0, QSE_SIZEOF(re->version));
|
QSE_MEMSET (&re->version, 0, QSE_SIZEOF(re->version));
|
||||||
QSE_MEMSET (&re->attr, 0, QSE_SIZEOF(re->attr));
|
QSE_MEMSET (&re->attr, 0, QSE_SIZEOF(re->attr));
|
||||||
@ -104,7 +105,6 @@ void qse_htre_clear (qse_htre_t* re)
|
|||||||
#if 0
|
#if 0
|
||||||
qse_mbs_clear (&re->iniline);
|
qse_mbs_clear (&re->iniline);
|
||||||
#endif
|
#endif
|
||||||
re->state = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int qse_htre_setstrfromcstr (
|
int qse_htre_setstrfromcstr (
|
||||||
@ -268,7 +268,9 @@ int qse_htre_perdecqpath (qse_htre_t* re)
|
|||||||
{
|
{
|
||||||
/* percent decode the query path */
|
/* percent decode the query path */
|
||||||
if (re->type != QSE_HTRE_Q || (re->flags & QSE_HTRE_QPATH_PERDEC)) return -1;
|
if (re->type != QSE_HTRE_Q || (re->flags & QSE_HTRE_QPATH_PERDEC)) return -1;
|
||||||
if (qse_perdechttpstr ((re)->u.q.path, (re)->u.q.path) > 0)
|
if (qse_perdechttpstr (re->u.q.path, re->u.q.path) > 0)
|
||||||
|
{
|
||||||
re->flags |= QSE_HTRE_QPATH_PERDEC;
|
re->flags |= QSE_HTRE_QPATH_PERDEC;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user