Skip to content

Commit

Permalink
bmcd: listen on IPv6 & increase KeepAlive
Browse files Browse the repository at this point in the history
Prevent the TCP connection from closing during a flashing process. When
the receive buffer is full, byte chunk requests will be blocked until
new space becomes available. This caused connection resets, resulting in
an abort of the flashing process. This happens, for example, during the
configuration phase of the node which typically takes longer as 5 sec.
default keep-alive for HTTP1.1 was 5 sec. This CL align sets the
keep-alive timeout to the value of the underlaying OS.
  • Loading branch information
svenrademakers committed Sep 6, 2023
1 parent 8e6c5a4 commit 47fdf4f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bmcd/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::flash_service::FlashService;
use actix_files::Files;
use actix_web::{middleware, web::Data, App, HttpServer};
use actix_web::{http::KeepAlive, middleware, web::Data, App, HttpServer};
use log::LevelFilter;
use std::sync::Arc;
use std::{sync::Arc, time::Duration};

Check failure on line 5 in bmcd/src/main.rs

View workflow job for this annotation

GitHub Actions / clippy

unused import: `time::Duration`

error: unused import: `time::Duration` --> bmcd/src/main.rs:5:22 | 5 | use std::{sync::Arc, time::Duration}; | ^^^^^^^^^^^^^^ | = note: `-D unused-imports` implied by `-D warnings`
use tokio::sync::Mutex;
use tpi_rs::app::{bmc_application::BmcApplication, event_application::run_event_listener};
mod flash_service;
Expand Down Expand Up @@ -32,6 +32,8 @@ async fn main() -> anyhow::Result<()> {
.service(Files::new("/", "/mnt/var/www/").index_file("index.html"))
})
.bind(("0.0.0.0", 80))?
.bind(("::1", 80))?
.keep_alive(KeepAlive::Os)
.workers(2)
.run()
.await?;
Expand Down

0 comments on commit 47fdf4f

Please sign in to comment.