Fix typos and grammar issues

Co-authored-by: =?~~~?q?Ren=C3=A9=20Kla=C4=8Dan?= <rene@klacan.sk>
Co-authored-by: 12932 <68835423+12932@users.noreply.github.com>
Co-authored-by: Alessandro <aleferrara1998@gmail.com>
Co-authored-by: InImpasse <40639475+InImpasse@users.noreply.github.com>
Co-authored-by: Paul James Cleary <pauljamescleary@gmail.com>
Co-authored-by: Yang Hau <yuanyanghau@gmail.com>
Co-authored-by: Morpheus <40785143+Muzych@users.noreply.github.com>
Co-authored-by: mobeicanyue <81098819+mobeicanyue@users.noreply.github.com>
Co-authored-by: Twacqwq <69360546+Twacqwq@users.noreply.github.com>
Co-authored-by: Bobby <zkd8907@live.com>
Co-authored-by: Dup4 <lyuzhi.pan@gmail.com>
Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Sheldon <1415182877@qq.com>
Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: ZhangIvan1 <zhang_ivan1@163.com>
Co-authored-by: GrahamQuan <33834833+GrahamQuan@users.noreply.github.com>
Co-authored-by: =?~~~?q?Cristian=20Paul=20Pe=C3=B1aranda=20Rojas?= <paul@kristianpaul.org>
Co-authored-by: Nathan Sit <nsit.earth@gmail.com>
Co-authored-by: David Lee <67067729+LordMoMA@users.noreply.github.com>
Co-authored-by: Mengliang Su <mengliang.su@shopee.com>
Co-authored-by: =?~~~?q?=EA=B9=80=EC=84=A0=EC=9A=B0?= <seonwoo960000@toss.im>
Co-authored-by: Allen Huang <huangseji@meituan.com>
Co-authored-by: Opacity <70315161+zreren@users.noreply.github.com>
Co-authored-by: cris <sqdcmk@gmail.com>
Co-authored-by: Killian Ye <40255385+ykw1129@users.noreply.github.com>
Co-authored-by: Jiwei-dev <hi.jiwei@gmail.com>
Co-authored-by: Jinfeng Wang <41931794+wjf40390@users.noreply.github.com>
Co-authored-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
This commit is contained in:
Yuchen Wu 2024-03-01 11:51:14 -08:00 committed by Yuchen Wu
parent e811382224
commit 8160ad1698
39 changed files with 70 additions and 70 deletions

2
.bleep
View file

@ -1 +1 @@
fec326a416d91d8d1d5b7a165ba371c478c1e278
39f0cfd032dab4ed6a064873c44b7f96a7710df4

View file

@ -17,31 +17,31 @@ Pingora is battle tested as it has been serving more than 40 million Internet re
* Support for a variety of observability tools
## Reasons to use Pingora
* **Security** is your top priority: Pingora is a more memory safe alternative for services that are written in C/C++.
* Your service is **performance-sensitive**: Pingora is fast and efficient.
* Your service requires extensive **customization**: The APIs Pingora proxy framework provides are highly programmable.
* **Security** is your top priority: Pingora is a more memory safe alternative for services that are written in C/C++
* Your service is **performance-sensitive**: Pingora is fast and efficient
* Your service requires extensive **customization**: The APIs Pingora proxy framework provides are highly programmable
# Getting started
See our [quick starting guide](./docs/quick_start.md) to see how easy it is to build a load balancer.
Our [user guide](./docs/user_guide/index.md) covers more topics such as how to configure and run Pingora servers, as well as how to build custom HTTP server and proxy logic on top of Pingora's framework.
Our [user guide](./docs/user_guide/index.md) covers more topics such as how to configure and run Pingora servers, as well as how to build custom HTTP servers and proxy logic on top of Pingora's framework.
API docs are also available for all the crates.
# Notable crates in this workspace
* Pingora: the "public facing" crate to build to build networked systems and proxies.
* Pingora-core: this crates defined the protocols, functionalities and basic traits.
* Pingora-proxy: the logic and APIs to build HTTP proxies.
* Pingora: the "public facing" crate to build networked systems and proxies
* Pingora-core: this crate defines the protocols, functionalities and basic traits
* Pingora-proxy: the logic and APIs to build HTTP proxies
* Pingora-error: the common error type used across Pingora crates
* Pingora-http: the HTTP header definitions and APIs
* Pingora-openssl & pingora-boringssl: SSL related extensions and APIs
* Pingora-ketama: the [Ketama](https://github.com/RJ/ketama) consistent algorithm
* Pingora-limits: efficient counting algorithms
* Pingora-load-balancing: load balancing algorithm extensions for pingora proxy
* Pingora-memory-cache: Async in-memory caching with cache lock to prevent cache stampede.
* Pingora-timeout: A more efficient async timer system.
* TinyUfo: The caching algorithm behind pingora-memory-cache.
* Pingora-load-balancing: load balancing algorithm extensions for pingora-proxy
* Pingora-memory-cache: Async in-memory caching with cache lock to prevent cache stampede
* Pingora-timeout: A more efficient async timer system
* TinyUfo: The caching algorithm behind pingora-memory-cache
# System requirements

View file

@ -187,7 +187,7 @@ fn main() {
}
```
Now if we run our loud balancer again with `cargo run`, and test it with
Now if we run our load balancer again with `cargo run`, and test it with
```
curl 127.0.0.1:6188 -svo /dev/null
@ -297,7 +297,7 @@ Now you can find the pid of the service.
### Gracefully upgrade the service
(Linux only)
Let's say we changed the code of the load balancer, recompiled the binary. Now we want to upgrade the service running in the background to this newer version.
Let's say we changed the code of the load balancer and recompiled the binary. Now we want to upgrade the service running in the background to this newer version.
If we simply stop the old service, then start the new one, some request arriving in between could be lost. Fortunately, Pingora provides a graceful way to upgrade the service.

View file

@ -27,7 +27,7 @@ group: webusers
| client_bind_to_ipv6 | source IPv6 addresses to bind to when connecting to server| list of string |
| ca_file | The path to the root CA file | string |
| work_stealing | Enable work stealing runtime (default true). See Pingora runtime (WIP) section for more info | bool |
| upstream_keepalive_pool_size | The number of total connections to keep in the connetion pool | number |
| upstream_keepalive_pool_size | The number of total connections to keep in the connection pool | number |
## Extension
Any unknown settings will be ignored. This allows extending the conf file to add and pass user defined settings. See User defined configuration section.

View file

@ -6,7 +6,7 @@ Pingora libraries are built to expect issues like disconnects, timeouts and inva
Pingora adopts the idea behind [log](https://docs.rs/log/latest/log/). There are five log levels:
* `error`: This level should be used when the error stops the request from being handled correctly. For example when the server we try to connect to is offline.
* `warning`: This level should be used when an error occurs but the system recovers from it. For example when the primary DNS timed out but the system is able to query the secondary DNS.
* `info`: Pingora logs when the server is starting up or shuting down.
* `info`: Pingora logs when the server is starting up or shutting down.
* `debug`: Internal details. This log level is not compiled in `release` builds.
* `trace`: Fine-grained internal details. This log level is not compiled in `release` builds.

View file

@ -1,6 +1,6 @@
# Graceful restart and shutdown
Graceful restart, upgrade, and shutdown mechanisms are very commonly used to avoid errors or downtime when releasing new versions of pingora servers.
Graceful restart, upgrade, and shutdown mechanisms are very commonly used to avoid errors or downtime when releasing new versions of Pingora servers.
Pingora graceful upgrade mechanism guarantees the following:
* A request is guaranteed to be handled either by the old server instance or the new one. No request will see connection refused when trying to connect to the server endpoints.
@ -11,7 +11,7 @@ Pingora graceful upgrade mechanism guarantees the following:
Configure the upgrade socket. The old and new server need to agree on the same path to this socket. See configuration manual for details.
### Step 1
Start the new instance with the `--upgrade` cli option. The new instance will not try to listen to the service endpoint right away. It will try to acquire the listening socket from the old instance instead.
Start the new instance with the `--upgrade` CLI option. The new instance will not try to listen to the service endpoint right away. It will try to acquire the listening socket from the old instance instead.
### Step 2
Send SIGQUIT signal to the old instance. The old instance will start to transfer the listening socket to the new instance.

View file

@ -132,7 +132,7 @@ For example, this is how an `HttpProxy` struct, from the `pingora-proxy` crate,
└─────────────────────┘
```
Different functionality and helpers are provided at different layers in this representation.
Different functionalities and helpers are provided at different layers in this representation.
```
┌─────────────┐ ┌──────────────────────────────────────┐

View file

@ -22,7 +22,7 @@ A `PeerOptions` defines how to connect to the upstream.
|connection_timeout: `Option<Duration>`| How long to wait before giving up *establishing* a TCP connection |
|total_connection_timeout: `Option<Duration>`| How long to wait before giving up *establishing* a connection including TLS handshake time |
|read_timeout: `Option<Duration>`| How long to wait before each individual `read()` from upstream. The timer is reset after each `read()` |
|idle_timeout: `Option<Duration>`| How long to wait before closing a idle connection waiting for connetion reuse |
|idle_timeout: `Option<Duration>`| How long to wait before closing a idle connection waiting for connection reuse |
|write_timeout: `Option<Duration>`| How long to wait before a `write()` to upstream finishes |
|verify_cert: `bool`| Whether to check if upstream' server cert is valid and validated |
|verify_hostname: `bool`| Whether to check if upstream server cert's CN matches the SNI |

View file

@ -1,4 +1,4 @@
# Starting and stoping Pingora server
# Starting and stopping Pingora server
A pingora server is a regular unprivileged multithreaded process.
@ -11,7 +11,7 @@ A Pingora server by default takes the following command-line arguments:
| ------------- |-------------| ----|
| -d, --daemon | Daemonize the server | false |
| -t, --test | Test the server conf and then exit (WIP) | false |
| -c, --conf | The path to the configuarion file | empty string |
| -c, --conf | The path to the configuration file | empty string |
| -u, --upgrade | This server should gracefully upgrade a running server | false |
## Stop
@ -24,4 +24,4 @@ Upon receiving SIGINT (ctrl + c), the server will exit immediately with no delay
Upon receiving SIGTERM, the server will notify all its services to shutdown, wait for some preconfigured time and then exit. This behavior gives requests a grace period to finish.
### SIGQUIT: graceful upgrade
Similar to SIGQUIT, but the server will also transfer all its listening sockets to a new Pingora server so that there is no downtime during the upgrade. See the [graceful upgrade](graceful.md) section for more details.
Similar to SIGTERM, but the server will also transfer all its listening sockets to a new Pingora server so that there is no downtime during the upgrade. See the [graceful upgrade](graceful.md) section for more details.

View file

@ -32,7 +32,7 @@ use std::time::SystemTime;
///
/// - Space optimized in-memory LRU (see [pingora_lru]).
/// - Instead of a single giant LRU, this struct shards the assets into `N` independent LRUs.
/// This allows [EvictionManager::save()] not to lock the entire cache mananger while performing
/// This allows [EvictionManager::save()] not to lock the entire cache manager while performing
/// serialization.
pub struct Manager<const N: usize>(Lru<CompactCacheKey, N>);

View file

@ -29,9 +29,9 @@ pub mod simple_lru;
/// be handled the implementations internally.
#[async_trait]
pub trait EvictionManager {
/// Total size of the cache in bytes tracked by this eviction mananger
/// Total size of the cache in bytes tracked by this eviction manager
fn total_size(&self) -> usize;
/// Number of assets tracked by this eviction mananger
/// Number of assets tracked by this eviction manager
fn total_items(&self) -> usize;
/// Number of bytes that are already evicted
///
@ -76,7 +76,7 @@ pub trait EvictionManager {
/// method shouldn't change the popularity of the asset being peeked.
fn peek(&self, item: &CompactCacheKey) -> bool;
/// Serialize to save the state of this eviction mananger to disk
/// Serialize to save the state of this eviction manager to disk
///
/// This function is for preserving the eviction manager's state across server restarts.
///

View file

@ -187,7 +187,7 @@ pub mod upstream {
// remove downstream range header as we'd like to cache the entire response (this might change in the future)
req.remove_header(&header::RANGE);
// we have a persumably staled response already, add precondition headers for revalidation
// we have a presumably staled response already, add precondition headers for revalidation
if let Some(m) = meta {
// rfc7232: "SHOULD send both validators in cache validation" but
// there have been weird cases that an origin has matching etag but not Last-Modified

View file

@ -340,7 +340,7 @@ impl HttpCache {
/// Enable the cache
///
/// - `storage`: the cache storage backend that implements [storage::Storage]
/// - `eviction`: optionally the eviction mananger, without it, nothing will be evicted from the storage
/// - `eviction`: optionally the eviction manager, without it, nothing will be evicted from the storage
/// - `predictor`: optionally a cache predictor. The cache predictor predicts whether something is likely
/// to be cacheable or not. This is useful because the proxy can apply different types of optimization to
/// cacheable and uncacheable requests.

View file

@ -151,7 +151,7 @@ impl PartialHit {
};
assert!(bytes_end >= self.bytes_read);
// more data avaliable to read
// more data available to read
if bytes_end > self.bytes_read {
let new_bytes =
Bytes::copy_from_slice(&self.body.read()[self.bytes_read..bytes_end]);

View file

@ -316,7 +316,7 @@ pub(crate) struct CacheMetaInner {
pub(crate) internal: InternalMeta,
pub(crate) header: ResponseHeader,
/// An opaque type map to hold extra information for communication between cache backends
/// and users. This field is **not** garanteed be persistently stored in the cache backend.
/// and users. This field is **not** guaranteed be persistently stored in the cache backend.
pub extensions: Extensions,
}
@ -567,7 +567,7 @@ use pingora_header_serde::HeaderSerde;
use std::fs::File;
use std::io::Read;
/* load header compression engine and its' dictionary globally */
/* load header compression engine and its dictionary globally */
pub(crate) static COMPRESSION_DICT_PATH: OnceCell<String> = OnceCell::new();
fn load_file(path: &String) -> Option<Vec<u8>> {

View file

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! A HTTP application that reports Prometheus metrics.
//! An HTTP application that reports Prometheus metrics.
use async_trait::async_trait;
use http::{self, Response};

View file

@ -263,7 +263,7 @@ impl TransportConnector {
}
// Perform the actual L4 and tls connection steps while respecting the peer's
// connection timeout if there one
// connection timeout if there is one
async fn do_connect<P: Peer + Send + Sync>(
peer: &P,
bind_to: Option<SocketAddr>,

View file

@ -217,7 +217,7 @@ where
if peer.sni().is_empty() {
ssl_conf.set_use_server_name_indication(false);
/* NOTE: technically we can still verify who signs the cert but turn it off to be
consistant with nginx's behavior */
consistent with nginx's behavior */
ssl_conf.set_verify(SslVerifyMode::NONE);
} else if peer.verify_cert() {
if peer.verify_hostname() {

View file

@ -115,7 +115,7 @@ impl Listeners {
listeners
}
/// Create a new [`Listeners`] with with a TLS (TCP) endpoint with the given address string,
/// Create a new [`Listeners`] with a TLS (TCP) endpoint with the given address string,
/// and path to the certificate/private key pairs.
/// This endpoint will adopt the [Mozilla Intermediate](https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29)
/// server side TLS settings.

View file

@ -53,7 +53,7 @@ impl DerefMut for TlsSettings {
}
impl TlsSettings {
/// Create a new [`TlsSettings`] with the the [Mozilla Intermediate](https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29).
/// Create a new [`TlsSettings`] with the [Mozilla Intermediate](https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29).
/// server side TLS settings. Users can adjust the TLS settings after this object is created.
/// Return error if the provided certificate and private key are invalid or not found.
pub fn intermediate(cert_path: &str, key_path: &str) -> Result<Self> {

View file

@ -30,7 +30,7 @@ use std::any::TypeId;
use std::collections::HashMap;
use std::sync::Arc;
/// The trait a HTTP traffic module needs to implement
/// The trait an HTTP traffic module needs to implement
// TODO: * async filters for, e.g., 3rd party auth server; * access the connection for, e.g., GeoIP
pub trait HttpModule {
fn request_header_filter(&mut self, _req: &mut RequestHeader) -> Result<()> {
@ -86,7 +86,7 @@ impl HttpModules {
///
/// Each type of [HttpModule] can be only added once.
/// # Panic
/// Panic if any [HttpModule] is added more tha once.
/// Panic if any [HttpModule] is added more than once.
pub fn add_module(&mut self, builder: ModuleBuilder) {
if self.module_index.get().is_some() {
// We use a shared module_index the index would be out of sync if we
@ -135,7 +135,7 @@ pub struct HttpModuleCtx {
}
impl HttpModuleCtx {
/// Create an placeholder empty [HttpModuleCtx].
/// Create a placeholder empty [HttpModuleCtx].
///
/// [HttpModules] should be used to create nonempty [HttpModuleCtx].
pub fn empty() -> Self {
@ -145,7 +145,7 @@ impl HttpModuleCtx {
}
}
/// Get a ref to [HttpModule] if any.
/// Get a ref to [HttpModule] if any.
pub fn get<T: 'static>(&self) -> Option<&T> {
let idx = self.module_index.get(&TypeId::of::<T>())?;
let ctx = &self.module_ctx[*idx];
@ -156,7 +156,7 @@ impl HttpModuleCtx {
)
}
/// Get a mut ref to [HttpModule] if any.
/// Get a mut ref to [HttpModule] if any.
pub fn get_mut<T: 'static>(&mut self) -> Option<&mut T> {
let idx = self.module_index.get(&TypeId::of::<T>())?;
let ctx = &mut self.module_ctx[*idx];

View file

@ -257,7 +257,7 @@ enum Algorithm {
Zstd,
// TODO: Identify,
// TODO: Deflate
Other, // anyting unknown
Other, // anything unknown
}
impl Algorithm {
@ -322,7 +322,7 @@ enum Action {
Decompress(Algorithm),
}
// parse Accpet-Encoding header and put it to the list
// parse Accept-Encoding header and put it to the list
fn parse_accept_encoding(accept_encoding: Option<&http::HeaderValue>, list: &mut Vec<Algorithm>) {
// https://www.rfc-editor.org/rfc/rfc9110#name-accept-encoding
if let Some(ac) = accept_encoding {
@ -339,7 +339,7 @@ fn parse_accept_encoding(accept_encoding: Option<&http::HeaderValue>, list: &mut
if let Some(s) = i.bare_item.as_token() {
// TODO: support q value
let algorithm = Algorithm::from(s);
// ignore algorithms that we don't understand ingore
// ignore algorithms that we don't understand ignore
if algorithm != Algorithm::Other {
list.push(Algorithm::from(s));
}
@ -400,7 +400,7 @@ fn decide_action(resp: &ResponseHeader, accept_encoding: &[Algorithm]) -> Action
Some(Algorithm::Other)
}
} else {
// no Accpet-encoding
// no Accept-encoding
None
};
@ -582,7 +582,7 @@ fn test_adjust_response_header() {
header.headers.get("content-length").unwrap().as_bytes(),
b"20"
);
assert!(header.headers.get("transfor-encoding").is_none());
assert!(header.headers.get("transfer-encoding").is_none());
// decompress gzip
let mut header = ResponseHeader::build(200, None).unwrap();

View file

@ -231,7 +231,7 @@ impl Session {
/// Send error response to client
pub async fn respond_error(&mut self, error: u16) {
let resp = match error {
/* commmon error responses are pre-generated */
/* common error responses are pre-generated */
502 => error_resp::HTTP_502_RESPONSE.clone(),
400 => error_resp::HTTP_400_RESPONSE.clone(),
_ => error_resp::gen_error_response(error),

View file

@ -312,7 +312,7 @@ impl BodyReader {
} else {
if expecting_from_io > 0 {
trace!(
"parital chunk playload, expecting_from_io: {}, \
"partial chunk payload, expecting_from_io: {}, \
existing_buf_end {}, buf: {:?}",
expecting_from_io,
existing_buf_end,

View file

@ -212,7 +212,7 @@ pub fn get_tcp_info(_fd: RawFd) -> io::Result<TCP_INFO> {
}
/*
* this extention is needed until the following are addressed
* this extension is needed until the following are addressed
* https://github.com/tokio-rs/tokio/issues/1543
* https://github.com/tokio-rs/mio/issues/1257
* https://github.com/tokio-rs/mio/issues/1211

View file

@ -90,13 +90,13 @@ impl Default for ServerConf {
}
}
/// Commandline options
/// Command-line options
///
/// Call `Opt::from_args()` to build this object from the process's command line arguments.
#[derive(StructOpt, Debug)]
#[structopt(name = "basic")]
pub struct Opt {
/// Whether this server should try to upgrade from an running old server
/// Whether this server should try to upgrade from a running old server
///
/// `-u` or `--upgrade` can be used
#[structopt(short, long)]

View file

@ -79,7 +79,7 @@ impl<A> Service<A> {
self.listeners.add_tcp_with_settings(addr, sock_opt);
}
/// Add an Unix domain socket listening endpoint with the given path.
/// Add a Unix domain socket listening endpoint with the given path.
///
/// Optionally take a permission of the socket file. The default is read and write access for
/// everyone (0o666).

View file

@ -119,7 +119,7 @@ pub trait Peer: Display + Clone {
None => None,
}
}
/// How long the overall connection establishment should take before a timeout error is returned.
/// How long the overall connection establishment should take before a timeout error is returned.
fn total_connection_timeout(&self) -> Option<Duration> {
match self.get_peer_options() {
Some(opt) => opt.total_connection_timeout,

View file

@ -32,7 +32,7 @@ http {
keepalive_timeout 30;
keepalive_requests 99999;
upstream plantext {
upstream plaintext {
server 127.0.0.1:8000;
keepalive 128;
keepalive_requests 99999;
@ -53,7 +53,7 @@ http {
location / {
keepalive_timeout 30;
proxy_pass http://plantext;
proxy_pass http://plaintext;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
}

View file

@ -108,7 +108,7 @@ pub enum ErrorType {
TLSHandshakeFailure,
TLSHandshakeTimedout,
InvalidCert,
HandshakeError, // other handhshake
HandshakeError, // other handshake
ConnectError, // catch all
BindError,
AcceptError,

View file

@ -35,7 +35,7 @@ impl CaseHeaderName {
}
}
/// A trait that converts into case sensitive header names.
/// A trait that converts into case-sensitive header names.
pub trait IntoCaseHeaderName {
fn into_case_header_name(self) -> CaseHeaderName;
}

View file

@ -52,7 +52,7 @@ pub struct TcpHealthCheck {
/// The SocketAddr of `peer_template` is just a placeholder which will be replaced by the
/// actual address of the backend when the health check runs.
///
/// By default this check will try to establish a TCP connection. When the the `sni` field is
/// By default this check will try to establish a TCP connection. When the `sni` field is
/// set, it will also try to establish a TLS connection on top of the TCP connection.
pub peer_template: BasicPeer,
connector: TransportConnector,

View file

@ -74,7 +74,7 @@ impl Nodes {
};
// Constrain the growth of vec: vec always double its capacity when it needs to grow
// It could waste too much memory when it is already very large.
// Here we limit the memory waste to 10% onces it grows beyond the cap.
// Here we limit the memory waste to 10% once it grows beyond the cap.
// The amortized growth cost is O(n) beyond the max of the initial reserved capacity and
// the cap. But this list is for limited sized LRU and we recycle released node, so
// hopefully insertions are rare beyond certain sizes

View file

@ -594,7 +594,7 @@ where
};
if *shutdown.borrow() {
// stop downstream downstream from reusing if this service is shutting down soon
// stop downstream from reusing if this service is shutting down soon
session.set_keepalive(None);
} else {
// default 60s

View file

@ -220,7 +220,7 @@ impl<SV> HttpProxy<SV> {
}
Err(e) => {
// Allow cache miss to fill cache even if cache lookup errors
// this is mostly to suppport backward incompatible metadata update
// this is mostly to support backward incompatible metadata update
// TODO: check error types
// session.cache.disable();
self.inner.cache_miss(session, ctx);
@ -280,7 +280,7 @@ impl<SV> HttpProxy<SV> {
Err(e) => {
// TODO: more logging and error handling
session.as_mut().respond_error(500).await;
// we have not write anything dirty to downstream, it is still reuseable
// we have not write anything dirty to downstream, it is still reusable
return (true, Some(e));
}
}
@ -724,7 +724,7 @@ pub(crate) mod range_filter {
use http::header::*;
use std::ops::Range;
// parse bytes into usize, ignores specifc error
// parse bytes into usize, ignores specific error
fn parse_number(input: &[u8]) -> Option<usize> {
str::from_utf8(input).ok()?.parse().ok()
}
@ -734,7 +734,7 @@ pub(crate) mod range_filter {
// single byte range only for now
// https://datatracker.ietf.org/doc/html/rfc7233#section-2.1
// https://datatracker.ietf.org/doc/html/rfc7233#appendix-C: case insensitive
// https://datatracker.ietf.org/doc/html/rfc7233#appendix-C: case-insensitive
static RE_SINGLE_RANGE: Lazy<Regex> =
Lazy::new(|| Regex::new(r"(?i)bytes=(?P<start>\d*)-(?P<end>\d*)").unwrap());

View file

@ -253,7 +253,7 @@ http {
return 200;
}
# 1. A origin load balancer that rejects reused connetions.
# 1. A origin load balancer that rejects reused connections.
# this is to simulate the common problem when customers LB drops
# connection silently after being keepalived for awhile
# 2. A middlebox might drop the connection if the origin takes too long
@ -283,7 +283,7 @@ http {
ngx.print(string.rep("A", 64))
ngx.print(string.rep("A", 64))
ngx.print(string.rep("A", 64))
-- without ngx.req.read_body(), the body will return wihtout waiting for req body
-- without ngx.req.read_body(), the body will return without waiting for req body
}
}

View file

@ -412,7 +412,7 @@ impl Server {
}
}
// FIXME: this still allows multiple servers to spawn across intergration tests
// FIXME: this still allows multiple servers to spawn across integration tests
pub static TEST_SERVER: Lazy<Server> = Lazy::new(Server::start);
use super::mock_origin::MOCK_ORIGIN;

View file

@ -20,7 +20,7 @@
//! - Timeout timers are rounded to the next 10ms tick and timers are shared across all timeouts with the same deadline.
//!
//! In order for this to work, a standalone thread is created to arm the timers, which has its
//! overheads. As a general rule, the benefits of this doesn't outweight the overhead unless
//! overheads. As a general rule, the benefits of this doesn't outweigh the overhead unless
//! there are more than about 100/s timeout() calls in the system. Use regular tokio timeout or
//! [super::tokio_timeout] in the low usage case.

View file

@ -66,7 +66,7 @@ pub mod lb {
#[cfg(feature = "proxy")]
#[cfg_attr(docsrs, doc(cfg(feature = "proxy")))]
/// Load balancing recipes
/// Proxying recipes
pub mod proxy {
pub use pingora_proxy::*;
}