mirror of
https://github.com/sadoyan/aralez.git
synced 2026-10-23 06:01:35 +08:00
merge
This commit is contained in:
+1
-2
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "aralez"
|
name = "aralez"
|
||||||
version = "0.94.1"
|
version = "0.94.1"
|
||||||
edition = "2021"
|
edition = "2024"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
description = "Reverse proxy built on top of Cloudflare's Pingora"
|
description = "Reverse proxy built on top of Cloudflare's Pingora"
|
||||||
exclude = ["configs/*"]
|
exclude = ["configs/*"]
|
||||||
@@ -32,7 +32,6 @@ noyalib = { version = "0.0.44", features = ["compat-serde-yaml"] }
|
|||||||
rand = "0.10.2"
|
rand = "0.10.2"
|
||||||
base64 = "0.23.1"
|
base64 = "0.23.1"
|
||||||
jsonwebtoken = { version = "11.1.0", default-features = false, features = ["use_pem", "rust_crypto"] }
|
jsonwebtoken = { version = "11.1.0", default-features = false, features = ["use_pem", "rust_crypto"] }
|
||||||
#sha2 = { version = "0.11.0-rc.5", default-features = false }
|
|
||||||
sha2 = { version = "0.11.0", default-features = false }
|
sha2 = { version = "0.11.0", default-features = false }
|
||||||
base16ct = { version = "1.0.0", features = ["alloc"] }
|
base16ct = { version = "1.0.0", features = ["alloc"] }
|
||||||
urlencoding = "2.1.3"
|
urlencoding = "2.1.3"
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ use arc_swap::ArcSwap;
|
|||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use axum::body::Bytes;
|
use axum::body::Bytes;
|
||||||
use log::error;
|
use log::error;
|
||||||
|
use pingora::ErrorSource::Upstream;
|
||||||
use pingora::http::{Method, RequestHeader, ResponseHeader, StatusCode};
|
use pingora::http::{Method, RequestHeader, ResponseHeader, StatusCode};
|
||||||
use pingora::prelude::*;
|
use pingora::prelude::*;
|
||||||
use pingora::ErrorSource::Upstream;
|
|
||||||
use pingora_cache::cache_control::CacheControl;
|
use pingora_cache::cache_control::CacheControl;
|
||||||
use pingora_cache::{CacheKey, CacheMetaDefaults, RespCacheable};
|
use pingora_cache::{CacheKey, CacheMetaDefaults, RespCacheable};
|
||||||
use pingora_core::listeners::ALPN;
|
use pingora_core::listeners::ALPN;
|
||||||
@@ -109,7 +109,7 @@ impl ProxyHttp for LB {
|
|||||||
let hostname = return_header_host_from_upstream(session, &self.ump_upst);
|
let hostname = return_header_host_from_upstream(session, &self.ump_upst);
|
||||||
_ctx.hostname = hostname;
|
_ctx.hostname = hostname;
|
||||||
let mut backend_id = None;
|
let mut backend_id = None;
|
||||||
if let Some(_) = _ctx.extraparams.sticky_sessions {
|
if _ctx.extraparams.sticky_sessions.is_some() {
|
||||||
if let Some(cookies) = session.req_header().headers.get("cookie") {
|
if let Some(cookies) = session.req_header().headers.get("cookie") {
|
||||||
if let Ok(cookie_str) = cookies.to_str() {
|
if let Ok(cookie_str) = cookies.to_str() {
|
||||||
if let Some(pos) = cookie_str.find("backend_id=") {
|
if let Some(pos) = cookie_str.find("backend_id=") {
|
||||||
|
|||||||
@@ -8,12 +8,13 @@ pub static DEALLOC_COUNT: AtomicUsize = AtomicUsize::new(0);
|
|||||||
pub static ALLOC_BYTES: AtomicUsize = AtomicUsize::new(0);
|
pub static ALLOC_BYTES: AtomicUsize = AtomicUsize::new(0);
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
unsafe impl GlobalAlloc for CountingAllocator {
|
unsafe impl GlobalAlloc for CountingAllocator {
|
||||||
|
#[allow(unsafe_op_in_unsafe_fn)]
|
||||||
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||||
ALLOC_COUNT.fetch_add(1, Ordering::Relaxed);
|
ALLOC_COUNT.fetch_add(1, Ordering::Relaxed);
|
||||||
ALLOC_BYTES.fetch_add(layout.size(), Ordering::Relaxed);
|
ALLOC_BYTES.fetch_add(layout.size(), Ordering::Relaxed);
|
||||||
System.alloc(layout)
|
System.alloc(layout)
|
||||||
}
|
}
|
||||||
|
#[allow(unsafe_op_in_unsafe_fn)]
|
||||||
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
|
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
|
||||||
DEALLOC_COUNT.fetch_add(1, Ordering::Relaxed);
|
DEALLOC_COUNT.fetch_add(1, Ordering::Relaxed);
|
||||||
System.dealloc(ptr, layout)
|
System.dealloc(ptr, layout)
|
||||||
|
|||||||
Reference in New Issue
Block a user