Track HTTP crate
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
use super::{huffman, Header};
|
||||
use frame;
|
||||
|
||||
use http::{method, header, status};
|
||||
use http::{header};
|
||||
use http::method::{self, Method};
|
||||
use http::status::{self, StatusCode};
|
||||
use bytes::{Buf, Bytes, BytesMut};
|
||||
use string::String;
|
||||
|
||||
@@ -544,24 +546,24 @@ impl From<DecoderError> for frame::Error {
|
||||
|
||||
/// Get an entry from the static table
|
||||
pub fn get_static(idx: usize) -> Header {
|
||||
use http::{status, method, header};
|
||||
use http::header;
|
||||
use http::header::HeaderValue;
|
||||
|
||||
match idx {
|
||||
1 => Header::Authority(from_static("")),
|
||||
2 => Header::Method(method::GET),
|
||||
3 => Header::Method(method::POST),
|
||||
2 => Header::Method(Method::GET),
|
||||
3 => Header::Method(Method::POST),
|
||||
4 => Header::Path(from_static("/")),
|
||||
5 => Header::Path(from_static("/index.html")),
|
||||
6 => Header::Scheme(from_static("http")),
|
||||
7 => Header::Scheme(from_static("https")),
|
||||
8 => Header::Status(status::OK),
|
||||
9 => Header::Status(status::NO_CONTENT),
|
||||
10 => Header::Status(status::PARTIAL_CONTENT),
|
||||
11 => Header::Status(status::NOT_MODIFIED),
|
||||
12 => Header::Status(status::BAD_REQUEST),
|
||||
13 => Header::Status(status::NOT_FOUND),
|
||||
14 => Header::Status(status::INTERNAL_SERVER_ERROR),
|
||||
8 => Header::Status(StatusCode::OK),
|
||||
9 => Header::Status(StatusCode::NO_CONTENT),
|
||||
10 => Header::Status(StatusCode::PARTIAL_CONTENT),
|
||||
11 => Header::Status(StatusCode::NOT_MODIFIED),
|
||||
12 => Header::Status(StatusCode::BAD_REQUEST),
|
||||
13 => Header::Status(StatusCode::NOT_FOUND),
|
||||
14 => Header::Status(StatusCode::INTERNAL_SERVER_ERROR),
|
||||
15 => Header::Field {
|
||||
name: header::ACCEPT_CHARSET,
|
||||
value: HeaderValue::from_static(""),
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use super::Header;
|
||||
|
||||
use fnv::FnvHasher;
|
||||
use http::{method, header};
|
||||
use http::header;
|
||||
use http::method::Method;
|
||||
|
||||
use std::{cmp, mem, usize};
|
||||
use std::collections::VecDeque;
|
||||
@@ -721,8 +722,8 @@ fn index_static(header: &Header) -> Option<(usize, bool)> {
|
||||
Header::Authority(_) => Some((1, false)),
|
||||
Header::Method(ref v) => {
|
||||
match *v {
|
||||
method::GET => Some((2, true)),
|
||||
method::POST => Some((3, true)),
|
||||
Method::GET => Some((2, true)),
|
||||
Method::POST => Some((3, true)),
|
||||
_ => Some((2, false)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,8 +176,7 @@ impl Arbitrary for FuzzHpack {
|
||||
}
|
||||
|
||||
fn gen_header(g: &mut StdRng) -> Header<Option<HeaderName>> {
|
||||
use http::StatusCode;
|
||||
use http::method::{self, Method};
|
||||
use http::{Method, StatusCode};
|
||||
|
||||
if g.gen_weighted_bool(10) {
|
||||
match g.next_u32() % 5 {
|
||||
@@ -187,11 +186,11 @@ fn gen_header(g: &mut StdRng) -> Header<Option<HeaderName>> {
|
||||
}
|
||||
1 => {
|
||||
let method = match g.next_u32() % 6 {
|
||||
0 => method::GET,
|
||||
1 => method::POST,
|
||||
2 => method::PUT,
|
||||
3 => method::PATCH,
|
||||
4 => method::DELETE,
|
||||
0 => Method::GET,
|
||||
1 => Method::POST,
|
||||
2 => Method::PUT,
|
||||
3 => Method::PATCH,
|
||||
4 => Method::DELETE,
|
||||
5 => {
|
||||
let n: usize = g.gen_range(3, 7);
|
||||
let bytes: Vec<u8> = (0..n).map(|_| {
|
||||
|
||||
@@ -299,7 +299,7 @@ impl<B, P> Streams<B, P>
|
||||
pub fn send_request(&mut self, request: Request<()>, end_of_stream: bool)
|
||||
-> Result<StreamRef<B, P>, SendError>
|
||||
{
|
||||
use http::method;
|
||||
use http::Method;
|
||||
use super::stream::ContentLength;
|
||||
|
||||
// TODO: There is a hazard with assigning a stream ID before the
|
||||
@@ -319,7 +319,7 @@ impl<B, P> Streams<B, P>
|
||||
me.actions.send.init_window_sz(),
|
||||
me.actions.recv.init_window_sz());
|
||||
|
||||
if *request.method() == method::HEAD {
|
||||
if *request.method() == Method::HEAD {
|
||||
stream.content_length = ContentLength::Head;
|
||||
}
|
||||
|
||||
|
||||
@@ -418,7 +418,7 @@ impl proto::Peer for Peer {
|
||||
fn convert_poll_message(headers: frame::Headers)
|
||||
-> Result<Self::Poll, RecvError>
|
||||
{
|
||||
use http::{version, uri};
|
||||
use http::{Version, uri};
|
||||
|
||||
let mut b = Request::builder();
|
||||
|
||||
@@ -434,7 +434,7 @@ impl proto::Peer for Peer {
|
||||
}
|
||||
};
|
||||
|
||||
b.version(version::HTTP_2);
|
||||
b.version(Version::HTTP_2);
|
||||
|
||||
if let Some(method) = pseudo.method {
|
||||
b.method(method);
|
||||
|
||||
Reference in New Issue
Block a user