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

Support more headers #20

Open
steveklabnik opened this issue Oct 15, 2017 · 1 comment
Open

Support more headers #20

steveklabnik opened this issue Oct 15, 2017 · 1 comment

Comments

@steveklabnik
Copy link
Owner

steveklabnik commented Oct 15, 2017

Right now, we only support 16 headers:

let mut headers = [httparse::EMPTY_HEADER; 16];

A real server should support more.

@cmckni3
Copy link

cmckni3 commented Oct 17, 2017

I believe this is the cause of my crash since my browser extensions send extra headers. Private browsing works fine.

Stacktrace below

thread '<unnamed>' panicked at 'Tried to unwrap Status::Partial', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/httparse-1.2.3/src/lib.rs:254:31
stack backtrace:
   0:     0x55d0c5f39203 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::hfc7985b08e763a82
                               at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x55d0c5f354c4 - std::sys_common::backtrace::_print::h16a1db02a59ead63
                               at /checkout/src/libstd/sys_common/backtrace.rs:71
   2:     0x55d0c5f3b813 - std::panicking::default_hook::{{closure}}::h48ecee46f2eefc30
                               at /checkout/src/libstd/sys_common/backtrace.rs:60
                               at /checkout/src/libstd/panicking.rs:381
   3:     0x55d0c5f3b582 - std::panicking::default_hook::hb4c92ae8d005ca44
                               at /checkout/src/libstd/panicking.rs:397
   4:     0x55d0c5f3bcd7 - std::panicking::rust_panic_with_hook::h25d461655d60b1a5
                               at /checkout/src/libstd/panicking.rs:611
   5:     0x55d0c5d438b6 - std::panicking::begin_panic::h9bdcd5c66c5d5dbb
                               at /checkout/src/libstd/panicking.rs:572
   6:     0x55d0c5d3f93b - <httparse::Status<T>>::unwrap::h46ea993084b0876c
                               at /home/rust/hello_world/<panic macros>:3
   7:     0x55d0c5d69d65 - simple_server::parse_request::h7b3e32d026288916
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/simple-server-0.1.0/src/lib.rs:206
   8:     0x55d0c5d6814c - simple_server::Server::handle_connection::h7df1a41e2dc5ab28
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/simple-server-0.1.0/src/lib.rs:144
   9:     0x55d0c5d67ebf - simple_server::Server::listen::{{closure}}::{{closure}}::h93a3c8a913685d2f
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/simple-server-0.1.0/src/lib.rs:131
  10:     0x55d0c5d455e7 - <F as scoped_threadpool::FnBox>::call_box::h50b27dc8fe834905
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.8/src/lib.rs:71
  11:     0x55d0c5f294b8 - scoped_threadpool::Pool::new::{{closure}}::hbc55196e04c3a541
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.8/src/lib.rs:127
  12:     0x55d0c5f02632 - std::sys_common::backtrace::__rust_begin_short_backtrace::hfd3ed8d19e354d91
                               at /checkout/src/libstd/sys_common/backtrace.rs:136
  13:     0x55d0c5f04bfa - std::thread::Builder::spawn::{{closure}}::{{closure}}::he960c90ced50896a
                               at /checkout/src/libstd/thread/mod.rs:394
  14:     0x55d0c5efd9e2 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h0f9ae768cd5d11ec
                               at /checkout/src/libstd/panic.rs:296
  15:     0x55d0c5f04ef4 - std::panicking::try::do_call::h06767c0406f7d952
                               at /checkout/src/libstd/panicking.rs:480
  16:     0x55d0c5f42bdc - __rust_maybe_catch_panic
                               at /checkout/src/libpanic_unwind/lib.rs:99
  17:     0x55d0c5f04df5 - std::panicking::try::hcb7290c08c488e56
                               at /checkout/src/libstd/panicking.rs:459
  18:     0x55d0c5f04089 - std::panic::catch_unwind::h9881f8c99f6e055c
                               at /checkout/src/libstd/panic.rs:361
  19:     0x55d0c5f04a21 - std::thread::Builder::spawn::{{closure}}::h46421082e44024b0
                               at /checkout/src/libstd/thread/mod.rs:393
  20:     0x55d0c5f1e5e7 - <F as alloc::boxed::FnBox<A>>::call_box::hb93baed3fda5af3c
                               at /checkout/src/liballoc/boxed.rs:682
  21:     0x55d0c5f3ac6b - std::sys::imp::thread::Thread::new::thread_start::hf0e7be833820328e
                               at /checkout/src/liballoc/boxed.rs:692
                               at /checkout/src/libstd/sys_common/thread.rs:21
                               at /checkout/src/libstd/sys/unix/thread.rs:84
  22:     0x7fc9f0e0a493 - start_thread
  23:     0x7fc9f0935afe - __clone
  24:                0x0 - <unknown>
thread 'main' panicked at 'Thread pool worker panicked', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.8/src/lib.rs:236:12
stack backtrace:
   0:     0x55d0c5f39203 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::hfc7985b08e763a82
                               at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x55d0c5f354c4 - std::sys_common::backtrace::_print::h16a1db02a59ead63
                               at /checkout/src/libstd/sys_common/backtrace.rs:71
   2:     0x55d0c5f3b813 - std::panicking::default_hook::{{closure}}::h48ecee46f2eefc30
                               at /checkout/src/libstd/sys_common/backtrace.rs:60
                               at /checkout/src/libstd/panicking.rs:381
   3:     0x55d0c5f3b582 - std::panicking::default_hook::hb4c92ae8d005ca44
                               at /checkout/src/libstd/panicking.rs:397
   4:     0x55d0c5f3bcd7 - std::panicking::rust_panic_with_hook::h25d461655d60b1a5
                               at /checkout/src/libstd/panicking.rs:611
   5:     0x55d0c5f04cc6 - std::panicking::begin_panic::hee8e45285f6b9409
                               at /checkout/src/libstd/panicking.rs:572
   6:     0x55d0c5f29901 - scoped_threadpool::Scope::join_all::h2bc64569a2fe3268
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.8/src/lib.rs:236
   7:     0x55d0c5f299ac - <scoped_threadpool::Scope<'pool, 'scope> as core::ops::drop::Drop>::drop::hcb2a5179f93c7f5f
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.8/src/lib.rs:248
   8:     0x55d0c5d51334 - core::ptr::drop_in_place::h5a52d60ff9e21911
                               at /checkout/src/libcore/ptr.rs:61
   9:     0x55d0c5d3daf5 - scoped_threadpool::Pool::scoped::hd46bb0e79e3c2378
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.8/src/lib.rs:182
  10:     0x55d0c5d67c9f - simple_server::Server::listen::ha0ad9e37103eb544
                               at /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/simple-server-0.1.0/src/lib.rs:129
  11:     0x55d0c5d3c635 - hello_world::main::ha53a3edcff9e5f20
                               at src/main.rs:20
  12:     0x55d0c5f42bdc - __rust_maybe_catch_panic
                               at /checkout/src/libpanic_unwind/lib.rs:99
  13:     0x55d0c5f3c3fb - std::rt::lang_start::hdcba96cc6d0f043d
                               at /checkout/src/libstd/panicking.rs:459
                               at /checkout/src/libstd/panic.rs:361
                               at /checkout/src/libstd/rt.rs:61
  14:     0x55d0c5d3cd22 - main
  15:     0x7fc9f086d2b0 - __libc_start_main
  16:     0x55d0c5d38b29 - _start
  17:                0x0 - <unknown>

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

No branches or pull requests

2 participants