Skip to content

Commit 54d04a4

Browse files
committed
Remove debugging println
Signed-off-by: Eloi DEMOLIS <[email protected]>
1 parent faac102 commit 54d04a4

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

bin/config.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ frontends = [
324324
# - weight: weight used by the load balancing algorithm
325325
# - sticky-id: sticky session identifier
326326
backends = [
327-
{ address = "127.0.0.1:1026", backend_id = "the-backend-to-my-app" }
327+
{ address = "127.0.0.1:1026", backend_id = "back26" },
328+
{ address = "127.0.0.1:1027", backend_id = "back27" }
328329
]
329330

330331
# this is an example of a routing configuration for the TCP proxy

lib/src/https.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ impl HttpsSession {
272272
// Some client don't fill in the ALPN protocol, in this case we default to Http/1.1
273273
None => AlpnProtocol::Http11,
274274
};
275-
println!("ALPN: {alpn:?}");
275+
// println!("ALPN: {alpn:?}");
276276

277277
if let Some(version) = handshake.session.protocol_version() {
278278
incr!(rustls_version_str(version));
@@ -480,23 +480,23 @@ impl ProxySession for HttpsSession {
480480
token,
481481
super::ready_to_string(events)
482482
);
483-
println!("EVENT: {token:?}->{events:?}");
483+
// println!("EVENT: {token:?}->{events:?}");
484484
self.last_event = Instant::now();
485485
self.metrics.wait_start();
486486
self.state.update_readiness(token, events);
487487
}
488488

489489
fn ready(&mut self, session: Rc<RefCell<dyn ProxySession>>) -> SessionIsToBeClosed {
490-
let start = std::time::Instant::now();
491-
println!("READY {start:?}");
490+
// let start = std::time::Instant::now();
491+
// println!("READY {start:?}");
492492
self.metrics.service_start();
493493

494494
let session_result =
495495
self.state
496496
.ready(session.clone(), self.proxy.clone(), &mut self.metrics);
497497

498-
let end = std::time::Instant::now();
499-
println!("READY END {end:?} -> {:?}", end.duration_since(start));
498+
// let end = std::time::Instant::now();
499+
// println!("READY END {end:?} -> {:?}", end.duration_since(start));
500500

501501
let to_be_closed = match session_result {
502502
SessionResult::Close => true,

lib/src/protocol/mux/h1.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<Front: SocketHandler> ConnectionH1<Front> {
4949
return MuxResult::Continue;
5050
}
5151

52-
let was_initial = kawa.is_initial();
52+
let was_main_phase = kawa.is_main_phase();
5353
kawa::h1::parse(kawa, parts.context);
5454
debug_kawa(kawa);
5555
if kawa.is_error() {
@@ -80,7 +80,7 @@ impl<Front: SocketHandler> ConnectionH1<Front> {
8080
}
8181
match self.position {
8282
Position::Server => {
83-
if was_initial {
83+
if !was_main_phase {
8484
self.requests += 1;
8585
println_!("REQUESTS: {}", self.requests);
8686
stream.state = StreamState::Link
@@ -153,9 +153,9 @@ impl<Front: SocketHandler> ConnectionH1<Front> {
153153
let old_state = std::mem::replace(&mut stream.state, StreamState::Unlinked);
154154
if stream.context.keep_alive_frontend {
155155
self.timeout_container.reset();
156-
println!("{old_state:?} {:?}", self.readiness);
156+
// println!("{old_state:?} {:?}", self.readiness);
157157
if let StreamState::Linked(token) = old_state {
158-
println!("{:?}", endpoint.readiness(token));
158+
// println!("{:?}", endpoint.readiness(token));
159159
endpoint.end_stream(token, self.stream, context);
160160
}
161161
self.readiness.interest.insert(Ready::READABLE);

lib/src/protocol/mux/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{
22
cell::RefCell,
33
collections::HashMap,
4-
io::{ErrorKind, Write},
4+
io::ErrorKind,
55
net::{Shutdown, SocketAddr},
66
rc::{Rc, Weak},
77
time::Duration,
@@ -42,7 +42,7 @@ use self::h2::Prioriser;
4242
macro_rules! println_ {
4343
($($t:expr),*) => {
4444
// print!("{}:{} ", file!(), line!());
45-
println!($($t),*)
45+
// println!($($t),*)
4646
// $(let _ = &$t;)*
4747
};
4848
}
@@ -942,7 +942,7 @@ impl<Front: SocketHandler + std::fmt::Debug> SessionState for Mux<Front> {
942942
let mut dead_backends = Vec::new();
943943
for (token, backend) in self.router.backends.iter_mut() {
944944
let readiness = backend.readiness_mut();
945-
println!("{token:?} -> {readiness:?}");
945+
// println!("{token:?} -> {readiness:?}");
946946
let dead = readiness.filter_interest().is_hup()
947947
|| readiness.filter_interest().is_error();
948948
if dead {
@@ -1011,7 +1011,7 @@ impl<Front: SocketHandler + std::fmt::Debug> SessionState for Mux<Front> {
10111011
if !proxy_borrow.remove_session(*token) {
10121012
error!("session {:?} was already removed!", token);
10131013
} else {
1014-
println!("SUCCESS: session {token:?} was removed!");
1014+
// println!("SUCCESS: session {token:?} was removed!");
10151015
}
10161016
}
10171017
println_!("FRONTEND: {:#?}", self.frontend);
@@ -1257,7 +1257,7 @@ impl<Front: SocketHandler + std::fmt::Debug> SessionState for Mux<Front> {
12571257
if !proxy_borrow.remove_session(*token) {
12581258
error!("session {:?} was already removed!", token);
12591259
} else {
1260-
println!("SUCCESS: session {token:?} was removed!");
1260+
// println!("SUCCESS: session {token:?} was removed!");
12611261
}
12621262
}
12631263
// let s = match &mut self.frontend {

lib/src/router/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ mod tests {
936936
),
937937
Ok(Route::Cluster {
938938
id: "examplewildcard".to_string(),
939-
h2: true
939+
h2: false
940940
})
941941
);
942942
assert_eq!(

0 commit comments

Comments
 (0)