lower limit

This commit is contained in:
nora 2024-08-13 22:55:01 +02:00
parent 46f73c2de4
commit f4ba9a2939

View file

@ -168,13 +168,17 @@ async fn handle_connection(
// .do_operation(update.number.construct_op(ChannelOperationKind::Data(data)));
// arbitrary limit
if total_sent_data.len() < 500_000 {
if total_sent_data.len() < 50_000 {
total_sent_data.extend_from_slice(&data);
} else {
info!(channel = %update.number, "Reached stdin limit");
state.do_operation(update.number.construct_op(ChannelOperationKind::Data(b"Thanks Hayley!".to_vec())));
state.do_operation(
update.number.construct_op(ChannelOperationKind::Data(
b"Thanks Hayley!".to_vec(),
)),
);
state.do_operation(update.number.construct_op(ChannelOperationKind::Close));
}
}
if is_eof {
debug!(channel = %update.number, "Received EOF, closing channel");