Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71706588d3
|
||
|
|
721ce459de
|
||
|
|
bd36d58911
|
||
|
|
44402acfca
|
||
|
|
a531f48a5d
|
||
|
|
ca53e50053
|
||
|
|
1f268116de
|
||
|
|
f03c06fdf2
|
||
|
|
27f6557197
|
||
|
|
344f345854
|
@@ -120,6 +120,7 @@ async fn main() -> Result<(), Error> {
|
|||||||
async move {
|
async move {
|
||||||
const IPXE_PATTERN: &str = "ipxe/";
|
const IPXE_PATTERN: &str = "ipxe/";
|
||||||
if let Some(filename) = filename.strip_prefix(IPXE_PATTERN) {
|
if let Some(filename) = filename.strip_prefix(IPXE_PATTERN) {
|
||||||
|
println!("Looking for iPXE binary: {filename}");
|
||||||
Some(IPXE_DIR.get_file(filename)?.contents().to_owned())
|
Some(IPXE_DIR.get_file(filename)?.contents().to_owned())
|
||||||
} else if let Some(caps) = re.captures(&filename) {
|
} else if let Some(caps) = re.captures(&filename) {
|
||||||
let cluster = &caps["cluster"];
|
let cluster = &caps["cluster"];
|
||||||
|
|||||||
+3
-3
@@ -37,7 +37,7 @@ where
|
|||||||
F: Fn(&str) -> Fut,
|
F: Fn(&str) -> Fut,
|
||||||
Fut: Future<Output = Option<Vec<u8>>>,
|
Fut: Future<Output = Option<Vec<u8>>>,
|
||||||
{
|
{
|
||||||
let socket = UdpSocket::bind("0.0.0.0:0").await?;
|
let socket = UdpSocket::bind("127.0.0.1:0").await?;
|
||||||
println!(
|
println!(
|
||||||
"{src}: Connecting from {}",
|
"{src}: Connecting from {}",
|
||||||
socket.local_addr().expect("Socket is bound")
|
socket.local_addr().expect("Socket is bound")
|
||||||
@@ -85,7 +85,7 @@ where
|
|||||||
let mut timeout = 0;
|
let mut timeout = 0;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
// Send the first chunk
|
// Send the first byte
|
||||||
if let Some((index, chunk)) = chunk {
|
if let Some((index, chunk)) = chunk {
|
||||||
Packet::data((index + 1) as u16, chunk)
|
Packet::data((index + 1) as u16, chunk)
|
||||||
.send_to(&socket, &src)
|
.send_to(&socket, &src)
|
||||||
@@ -150,7 +150,7 @@ where
|
|||||||
F: Fn(&str) -> Fut + Clone + Send + 'static,
|
F: Fn(&str) -> Fut + Clone + Send + 'static,
|
||||||
Fut: Future<Output = Option<Vec<u8>>> + Send + 'static,
|
Fut: Future<Output = Option<Vec<u8>>> + Send + 'static,
|
||||||
{
|
{
|
||||||
let socket = UdpSocket::bind("0.0.0.0:69").await?;
|
let socket = UdpSocket::bind("127.0.0.1:69").await?;
|
||||||
|
|
||||||
println!("Server started");
|
println!("Server started");
|
||||||
loop {
|
loop {
|
||||||
|
|||||||
Reference in New Issue
Block a user