Commit 5f25e696 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

When the completion function returns empty, reset the rxbuffer in

the central code, rather than the completion function.
parent a7c85443
...@@ -269,7 +269,10 @@ SES_RxStuff(struct http_conn *htc, htc_complete_f *func, ...@@ -269,7 +269,10 @@ SES_RxStuff(struct http_conn *htc, htc_complete_f *func,
/* Working on it */ /* Working on it */
if (t1 != NULL && isnan(*t1)) if (t1 != NULL && isnan(*t1))
*t1 = now; *t1 = now;
} else if (hs != HTC_S_EMPTY) } else if (hs == HTC_S_EMPTY) {
htc->rxbuf_e = htc->rxbuf_b;
*htc->rxbuf_e = '\0';
} else
WRONG("htc_status_e"); WRONG("htc_status_e");
tmo = tn - now; tmo = tn - now;
......
...@@ -75,12 +75,9 @@ HTTP1_Complete(struct http_conn *htc) ...@@ -75,12 +75,9 @@ HTTP1_Complete(struct http_conn *htc)
/* Skip any leading white space */ /* Skip any leading white space */
for (p = htc->rxbuf_b ; vct_islws(*p); p++) for (p = htc->rxbuf_b ; vct_islws(*p); p++)
continue; continue;
if (p == htc->rxbuf_e) { if (p == htc->rxbuf_e)
/* All white space */
htc->rxbuf_e = htc->rxbuf_b;
*htc->rxbuf_e = '\0';
return (HTC_S_EMPTY); return (HTC_S_EMPTY);
}
/* /*
* Here we just look for NL[CR]NL to see that reception * Here we just look for NL[CR]NL to see that reception
* is completed. More stringent validation happens later. * is completed. More stringent validation happens later.
......
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