chore(lib) shuffle around some debug! and info! calls
This commit is contained in:
@@ -109,10 +109,10 @@ impl Http1Transaction for ServerTransaction {
|
|||||||
}
|
}
|
||||||
Encoder::chunked()
|
Encoder::chunked()
|
||||||
};
|
};
|
||||||
|
debug!("encode headers = {:?}", head.headers);
|
||||||
|
|
||||||
let init_cap = 30 + head.headers.len() * AVERAGE_HEADER_SIZE;
|
let init_cap = 30 + head.headers.len() * AVERAGE_HEADER_SIZE;
|
||||||
dst.reserve(init_cap);
|
dst.reserve(init_cap);
|
||||||
debug!("writing headers = {:?}", head.headers);
|
|
||||||
if head.version == ::HttpVersion::Http11 && head.subject == ::StatusCode::Ok {
|
if head.version == ::HttpVersion::Http11 && head.subject == ::StatusCode::Ok {
|
||||||
extend(dst, b"HTTP/1.1 200 OK\r\n");
|
extend(dst, b"HTTP/1.1 200 OK\r\n");
|
||||||
let _ = write!(FastWrite(dst), "{}", head.headers);
|
let _ = write!(FastWrite(dst), "{}", head.headers);
|
||||||
@@ -250,10 +250,10 @@ impl Http1Transaction for ClientTransaction {
|
|||||||
head.headers.set(TransferEncoding(vec![header::Encoding::Chunked]));
|
head.headers.set(TransferEncoding(vec![header::Encoding::Chunked]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
debug!("encode headers = {:?}", head.headers);
|
||||||
|
|
||||||
let init_cap = 30 + head.headers.len() * AVERAGE_HEADER_SIZE;
|
let init_cap = 30 + head.headers.len() * AVERAGE_HEADER_SIZE;
|
||||||
dst.reserve(init_cap);
|
dst.reserve(init_cap);
|
||||||
debug!("writing {:#?}", head.headers);
|
|
||||||
let _ = write!(FastWrite(dst), "{} {}\r\n{}\r\n", head.subject, head.version, head.headers);
|
let _ = write!(FastWrite(dst), "{} {}\r\n{}\r\n", head.subject, head.version, head.headers);
|
||||||
|
|
||||||
body
|
body
|
||||||
|
|||||||
@@ -137,8 +137,10 @@ struct MaybeAddr<'a>(&'a Option<SocketAddr>);
|
|||||||
impl<'a> fmt::Display for MaybeAddr<'a> {
|
impl<'a> fmt::Display for MaybeAddr<'a> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match *self.0 {
|
match *self.0 {
|
||||||
Some(ref addr) => fmt::Display::fmt(addr, f),
|
Some(ref addr) => {
|
||||||
None => f.write_str("None"),
|
write!(f, "addr={}, ", addr)
|
||||||
|
},
|
||||||
|
None => Ok(()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,7 +148,7 @@ impl<'a> fmt::Display for MaybeAddr<'a> {
|
|||||||
/// Constructs a request using a received ResponseHead and optional body
|
/// Constructs a request using a received ResponseHead and optional body
|
||||||
pub fn from_wire<B>(addr: Option<SocketAddr>, incoming: RequestHead, body: B) -> Request<B> {
|
pub fn from_wire<B>(addr: Option<SocketAddr>, incoming: RequestHead, body: B) -> Request<B> {
|
||||||
let MessageHead { version, subject: RequestLine(method, uri), headers } = incoming;
|
let MessageHead { version, subject: RequestLine(method, uri), headers } = incoming;
|
||||||
debug!("Request::new: addr={}, req=\"{} {} {}\"", MaybeAddr(&addr), method, uri, version);
|
info!("Request::new: {}\"{} {} {}\"", MaybeAddr(&addr), method, uri, version);
|
||||||
debug!("Request::new: headers={:?}", headers);
|
debug!("Request::new: headers={:?}", headers);
|
||||||
|
|
||||||
Request::<B> {
|
Request::<B> {
|
||||||
|
|||||||
@@ -143,9 +143,8 @@ impl fmt::Debug for Response {
|
|||||||
#[cfg(not(feature = "raw_status"))]
|
#[cfg(not(feature = "raw_status"))]
|
||||||
pub fn from_wire<B>(incoming: ResponseHead, body: Option<B>) -> Response<B> {
|
pub fn from_wire<B>(incoming: ResponseHead, body: Option<B>) -> Response<B> {
|
||||||
let status = incoming.status();
|
let status = incoming.status();
|
||||||
trace!("Response::new");
|
info!("Response::new \"{} {}\"", incoming.version, status);
|
||||||
debug!("version={:?}, status={:?}", incoming.version, status);
|
debug!("Response::new headers={:?}", incoming.headers);
|
||||||
debug!("headers={:?}", incoming.headers);
|
|
||||||
|
|
||||||
Response::<B> {
|
Response::<B> {
|
||||||
status: status,
|
status: status,
|
||||||
@@ -160,9 +159,8 @@ pub fn from_wire<B>(incoming: ResponseHead, body: Option<B>) -> Response<B> {
|
|||||||
#[cfg(feature = "raw_status")]
|
#[cfg(feature = "raw_status")]
|
||||||
pub fn from_wire<B>(incoming: ResponseHead, body: Option<B>) -> Response<B> {
|
pub fn from_wire<B>(incoming: ResponseHead, body: Option<B>) -> Response<B> {
|
||||||
let status = incoming.status();
|
let status = incoming.status();
|
||||||
trace!("Response::new");
|
info!("Response::new \"{} {}\"", incoming.version, status);
|
||||||
debug!("version={:?}, status={:?}", incoming.version, status);
|
debug!("Response::new headers={:?}", incoming.headers);
|
||||||
debug!("headers={:?}", incoming.headers);
|
|
||||||
|
|
||||||
Response::<B> {
|
Response::<B> {
|
||||||
status: status,
|
status: status,
|
||||||
|
|||||||
Reference in New Issue
Block a user