Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error-level logging after the server hangs up #1412

Closed
sfackler opened this issue Jan 9, 2018 · 2 comments
Closed

Error-level logging after the server hangs up #1412

sfackler opened this issue Jan 9, 2018 · 2 comments

Comments

@sfackler
Copy link
Contributor

sfackler commented Jan 9, 2018

When the server hangs up in an orderly fashion, an error-level log is reported.

@sfackler
Copy link
Contributor Author

sfackler commented Jan 9, 2018

extern crate env_logger;
extern crate tokio_core;
extern crate hyper;
extern crate futures;

use hyper::{Client, Request, Method};
use hyper::header::Connection;
use tokio_core::reactor::Core;
use futures::{Stream, Future};

fn main() {
    env_logger::init();

    let mut core = Core::new().unwrap();
    let handle = core.handle();

    let client = Client::new(&handle);

    let mut request = Request::new(Method::Get, "http://www.google.com".parse().unwrap());
    request.headers_mut().set(Connection::close());

    let f = client.request(request)
        .and_then(|r| {
            r.body().concat2()
        });

    let _ = core.run(f).unwrap();
}
ERROR 2018-01-09T23:04:57Z: hyper::client: client connection error: unexpected EOF waiting for response

@sfackler sfackler changed the title Connection-time protocol errors should be propagated to the response future Error-level logging after the server hangs up Jan 9, 2018
@sfackler
Copy link
Contributor Author

sfackler commented Jan 9, 2018

It looks like it first appeared in 0.11.8 (with no_proto turned on there of course).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant