Commit c954e37b authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Eliminate the 'T0' argument from SES_RxStuff() it only saves a

timestamp syscall in very rare circumstances.
parent b6645ff2
......@@ -980,7 +980,7 @@ void SES_RxInit(struct http_conn *htc, struct ws *ws,
unsigned maxbytes, unsigned maxhdr);
void SES_RxReInit(struct http_conn *htc);
enum htc_status_e SES_Rx(struct http_conn *htc, double tmo);
enum htc_status_e SES_RxStuff(struct http_conn *, htc_complete_f *, double t0,
enum htc_status_e SES_RxStuff(struct http_conn *, htc_complete_f *,
double *t1, double *t2, double ti, double tn);
#define SESS_ATTR(UP, low, typ, len) \
......
......@@ -226,7 +226,7 @@ SES_Rx(struct http_conn *htc, double tmo)
*/
enum htc_status_e
SES_RxStuff(struct http_conn *htc, htc_complete_f *func, double t0,
SES_RxStuff(struct http_conn *htc, htc_complete_f *func,
double *t1, double *t2, double ti, double tn)
{
double tmo;
......@@ -236,7 +236,6 @@ SES_RxStuff(struct http_conn *htc, htc_complete_f *func, double t0,
CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC);
AZ(isnan(t0));
AZ(isnan(tn));
if (t1 != NULL)
assert(isnan(*t1));
......@@ -258,7 +257,7 @@ SES_RxStuff(struct http_conn *htc, htc_complete_f *func, double t0,
return (HTC_S_COMPLETE);
}
if (tn < now) {
/* XXX: WS_ReleaseP(htc->ws, htc->rxbuf_b); ? */
WS_ReleaseP(htc->ws, htc->rxbuf_b);
return (HTC_S_TIMEOUT);
}
if (hs == HTC_S_MORE) {
......@@ -269,9 +268,9 @@ SES_RxStuff(struct http_conn *htc, htc_complete_f *func, double t0,
} else if (hs != HTC_S_EMPTY)
WRONG("htc_status_e");
tmo = tn - t0;
tmo = tn - now;
if (!isnan(ti) && ti < tn)
tmo = ti - t0;
tmo = ti - now;
i = (htc->ws->r - htc->rxbuf_e) - 1; /* space for NUL */
if (i <= 0) {
WS_ReleaseP(htc->ws, htc->rxbuf_b);
......
......@@ -200,7 +200,7 @@ HTTP1_Session(struct worker *wrk, struct req *req)
AZ(req->vcl);
AZ(req->esi_level);
hs = SES_RxStuff(req->htc, HTTP1_Complete, sp->t_idle,
hs = SES_RxStuff(req->htc, HTTP1_Complete,
&req->t_first, &req->t_req,
sp->t_idle + cache_param->timeout_linger,
sp->t_idle + cache_param->timeout_idle);
......
......@@ -351,7 +351,7 @@ VPX_Proto_Sess(struct worker *wrk, void *priv)
assert(sizeof vpx1_sig == 5);
assert(sizeof vpx2_sig == 12);
hs = SES_RxStuff(req->htc, vpx_complete, sp->t_idle,
hs = SES_RxStuff(req->htc, vpx_complete,
NULL, NULL, NAN, sp->t_idle + cache_param->timeout_idle);
if (hs != HTC_S_COMPLETE) {
Req_Release(req);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment