Skip to content

Commit

Permalink
Fixed bug that send cancellation token to a broken connection
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeajimenezl committed Jun 30, 2023
1 parent a4a3f4c commit 980450f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "proxyswarm"
version = "0.3.6"
version = "0.3.7"
authors = ["Jorge Alejandro Jimenez Luna <[email protected]>"]
edition = "2021"
description = "Proxyswarm is a tiny lightweight proxy that allows redirect HTTP(S) traffic through a proxy."
Expand Down
2 changes: 1 addition & 1 deletion build/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Jorge Alejandro Jimenez Luna <[email protected]>

pkgname=proxyswarm
pkgver=0.3.6
pkgver=0.3.7
pkgrel=1
pkgdesc="Lightweight proxy that allows redirect HTTP(S) traffic through a proxy."
arch=('x86_64')
Expand Down
4 changes: 2 additions & 2 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl HttpHandler {
return Ok(());
}
if res.status() != StatusCode::PROXY_AUTHENTICATION_REQUIRED {
tx.send(()).unwrap();
let _ = tx.send(());
return Err(Error::UnexpectedStatusCode {
code: res.status().as_u16(),
reason: res.status().canonical_reason().map(|x| x.to_string()),
Expand Down Expand Up @@ -257,7 +257,7 @@ impl HttpHandler {
trace!("[#{id}] Proxy closes the connection");

// Send token to cancel wait
tx.send(()).unwrap();
let _ = tx.send(());

// Build a new proxy connection
let t = self.get_proxy_transport(proxy).await?;
Expand Down

0 comments on commit 980450f

Please sign in to comment.