fix(server): Flush 100-continue messages

Closes #704
This commit is contained in:
Steven Fackler
2015-12-18 15:58:51 -08:00
parent 40d4014781
commit 92ff50f2e5

View File

@@ -369,7 +369,7 @@ impl<H: Handler + 'static> Worker<H> {
fn handle_expect<W: Write>(&self, req: &Request, wrt: &mut W) -> bool { fn handle_expect<W: Write>(&self, req: &Request, wrt: &mut W) -> bool {
if req.version == Http11 && req.headers.get() == Some(&Expect::Continue) { if req.version == Http11 && req.headers.get() == Some(&Expect::Continue) {
let status = self.handler.check_continue((&req.method, &req.uri, &req.headers)); let status = self.handler.check_continue((&req.method, &req.uri, &req.headers));
match write!(wrt, "{} {}\r\n\r\n", Http11, status) { match write!(wrt, "{} {}\r\n\r\n", Http11, status).and_then(|_| wrt.flush()) {
Ok(..) => (), Ok(..) => (),
Err(e) => { Err(e) => {
error!("error writing 100-continue: {:?}", e); error!("error writing 100-continue: {:?}", e);