- Add
stream_parse_auto()/stream_parse_auto_with_cap(cap)returningStreamResultAuto::{WebSocket, HttpArena, HttpStreaming}— single 3-way branch for WebSocket upgrade + HTTP size-based dispatch (websocket feature).
- Add streaming body API (
parse_request_streaming,body.read_chunk,body.bytes(cap),body.into_stream,body.into_multipart) on top ofmulter. - Add
parse_request_auto()(default 50 MiB cap) andparse_request_auto_with_cap(cap)returningAutoParseResult::{Arena,Streaming}— picks arena (zero-copy) for small requests, streaming for large ones based onContent-Length. Body.bytes: Vec<u8>field removed; replace withbody.buffered_bytes()orbody.bytes(cap).await?(breaking).Writer.stream/ArenaWriter.streamtypes:TcpStream→OwnedWriteHalf(breaking;SendBytesimpl added so response writes are unaffected).- Add
Options.max_body_sizeandOptions.header_read_deadline_ms(slowloris defense), body reader no longer pre-allocatesContent-Lengthbytes. response_filerejects path traversal viasafe_path_join;get_text/get_jsonenforce strict UTF-8;Form.text_fieldscollects all text parts (was a single-tuple bug).- New
SECURITY.md, GitHub Actions CI (test/MSRV 1.77/fmt/clippy). - 40 lib tests including streaming chunk reassembly and chunked multipart boundary parsing.
- Move
current_client_addrfromOptionstoAccept.peer;Server.optionsis now a sharedArc<Options>(useserver.options_mut()for in-place edits). SplitBytes::split_bytesreturnsVec<&[u8]>instead ofVec<Vec<u8>>(no per-part copy in non-arena multipart).- Header read loop starts at 4 KB and grows progressively instead of forcing a 64 KB zero-init on every request.
- Rewrite
parse_upgrade_requeston top ofhttparse. - Consolidate three
find_header_endimplementations into a single SIMD/scalar-aware function inbytes.
- Reduce per-request allocations across HTTP parsing, multipart, response, and file cache (multipart 1.3–1.7×, 1 MB cache hit 10.7× faster).
- Switch HTTP parser to
httparse; body bytes split off the input without copy. FileLoadResult::MemoryCachepayload:Vec<u8>→Arc<[u8]>(cache hits become atomic refcount).Optionspassed asArc<Options>throughAccept/Writer/ArenaWriterand the stream traits.Server.connection_poolandConnectionPool::globalno longer wrapped in outertokio::sync::Mutex.- Rewrite
get_multi_partsynchronously and use vectored I/O on the bytes-response path. - File streaming uses a fixed 128 KB buffer;
[profile.release]addslto = "fat",codegen-units = 1.
- Add missing codes.
- Update dependencies.
- Update dependencies.
- Add radix trie router with matchit (feature-gated as
router).
- Add websocket in stream.
- Add mtime-based cache invalidation for response_file.
- Add encoding when response_file feature.
- Fixed for arena feature.
- Add unordered for connection pool.
- Fixed for vectored_io in linux.
- Add connection pool for request.
- Add vectored_io for stream write.
- Add SIMD head parser.
- Remove unuse tls options.
- Add Accept struct for Server::accept, remove duplicate code.
- Add zero_copy module and zero_copy module to be default.
- Add arena mode and arena mode is default.
- Add get request ip with option.
- Add for request body with ipAddr.
- Fixed for read stream when first read.
- Remove unused several options. try_read_limit: u16; try_write_limit: u16; use_normal_read: bool; use_send_write_all: bool;
- Fixed for server accept split process because of thread.
- Change option for read stream's binary imcompleted.
- Add option for read stream when binary imcompleted.
- Recovery for read_stream when use_normal_read is false.
- Add option for tcpStream read_retry.
- Add option for tcpStream buffer size.
- Add delay for connecting tcpstream with unkown error.
- Add option for normal_read_timeout_miliseconds.
- Change for debug_print with (min, max) read count, default options.
- Fixed for unwrap function.
- Change method for request parse when content-length showing.
- Fixed for request parse when content-length showing.
- Add re export external list.
pub mod external {
pub use async_trait;
#[cfg(feature = "env")]
pub use dotenv;
pub use http;
#[cfg(feature = "response_file")]
pub use mime_guess;
pub use tokio;
}
- Add for server to auto inject from .env file simply.
.env file example
NO_DELAY=true
TRY_READ_LIMIT=20
TRY_WRITE_LIMIT=20
USE_NORMAL_READ=false
USE_SEND_WRITE_ALL=false
ROOT_PATH=D:\\git\\atomic_http\\test
- Change for request to get_json simply.
- Add options for response file root path.
- Add options for controll request and response.
- Fixed for improve response performance in multithread.
- Change for improve request read performance in multithread.
- Fixed for accept try limit 1 to 200.
- Fixed for convert string from header with utf8_lossy.
- Fixed for split with header and body.
- Fixed for duplicated read request data.
- Fixed for accept request read, add debug feature(if you need log print!).
- Add set nodelay for tcpstream.
- Fixed for read request when read error.
- Add for zip response for response_file feature.
- Fixed for only parse the header format when utf-8.
- Fixed buffer size(1024 -> 4096) and wait for readable stream.
- Fixed status for response_file between plain.
- Fixed status for response_file.
- Add print request bytes len when parse header.
- Fixed none header with request when parse header.
- Fixed parse header.
- Fixed response_file for remove header.
- Fixed response_file for content-type, response status.
- Fixed response_file for content-type with mime_guess.
- Add response_file for response.response_file(features="response_file"), remove zip response.
- Add tokio_rustls for parse_request(features="tokio_rustls"), remove static_str.
- Update dependencies. tokio: 1.36.0 -> 1.38.0 async-trait: 0.1.79 -> 0.1.80 serde_json: 1.0.115 -> 1.0.117 serde 1.0.197 -> 1.0.203
- Fixed blocking empty byte when split bytes.
- Add bytes response(don't use body).
- Change server address type(String -> &str).
- Add pub trait for request.
- Add pub trait for response.
- Add pub struct for request and response.
- First init simple server.