Skip to content

Commit

Permalink
apply review: cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Keksoj committed Mar 11, 2024
1 parent 653220b commit bb80fdf
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions bin/src/command/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ fn set_logging_level(server: &mut Server, client: &mut ClientSession, logging_fi
let (directives, errors) = logging::parse_logging_spec(&logging_filter);
if !errors.is_empty() {
client.finish_failure(format!(
"Error parsing logging filter:\n {}",
"Error parsing logging filter:\n- {}",
errors
.iter()
.map(logging::LogSpecParseError::to_string)
.collect::<Vec<String>>()
.join("\n ")
.join("\n- ")
));
return;
}
Expand Down
3 changes: 2 additions & 1 deletion bin/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,10 @@ pub unsafe fn get_executable_path() -> Result<String, UtilError> {
Ok(path_str)
}


#[cfg(target_os = "macos")]
extern "C" {
pub fn _NSGetExecutablePath(buf: *mut c_char, size: *mut u32) -> i32;
pub fn _NSGetExecutablePath(buf: *mut libc::c_char, size: *mut u32) -> i32;
}

#[cfg(target_os = "macos")]
Expand Down
5 changes: 1 addition & 4 deletions bin/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ use std::{
process::Command,
};

#[cfg(target_os = "macos")]
use libc::c_char;
use libc::pid_t;
#[cfg(target_os = "freebsd")]
use libc::{sysctl, CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, PATH_MAX};

use mio::net::UnixStream;
use nix::{
errno::Errno,
Expand Down
5 changes: 3 additions & 2 deletions command/examples/bench_logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
//! You can change the number of logs, log target, log filter and if they are colored with env
//! variables.
#[macro_use]
extern crate sozu_command_lib;

use std::time::Instant;

use rand::{rngs::StdRng, Rng, RngCore, SeedableRng};

#[macro_use]
extern crate sozu_command_lib;
use sozu_command_lib::logging::setup_logging;

struct LogLine {
Expand Down
2 changes: 1 addition & 1 deletion command/src/command.proto
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ message HttpEndpoint {
optional string authority = 2;
optional string path = 3;
// warning: this should be a u16 but protobuf only has uint32.
// Make sure the value never exceeds u16 bounds.
// Make sure the value never exceeds u16 bounds.
optional uint32 status = 4;
optional string reason = 5;
}
Expand Down
4 changes: 1 addition & 3 deletions lib/src/protocol/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ use sozu_command::{
use crate::{
backends::Backend,
pool::Checkout,
protocol::SessionState,
protocol::{http::parser::Method, SessionState},
socket::{stats::socket_rtt, SocketHandler, SocketResult, TransportProtocol},
sozu_command::ready::Ready,
timer::TimeoutContainer,
L7Proxy, ListenerHandler, Protocol, Readiness, SessionMetrics, SessionResult, StateResult,
};

use super::http::parser::Method;

#[derive(PartialEq, Eq)]
pub enum SessionStatus {
Normal,
Expand Down

0 comments on commit bb80fdf

Please sign in to comment.