Skip to content

Commit 76093e7

Browse files
authored
refactor(sandbox): remove dead relay_response_to_client wrapper (#1125)
relay_response_to_client had no callers; all call sites use relay_response directly. The allow(dead_code) comment on parse_target_query was also misleading since proxy.rs calls it from production code, so that annotation is removed along with the incorrect comment.
1 parent 5d0a44c commit 76093e7

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

  • crates/openshell-sandbox/src/l7

crates/openshell-sandbox/src/l7/rest.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ fn rewrite_request_line_target(
234234
Ok(out)
235235
}
236236

237-
// Used only in tests; kept as a `pub(crate)` helper for clarity.
238-
#[allow(dead_code)]
239237
pub(crate) fn parse_target_query(target: &str) -> Result<(String, HashMap<String, Vec<String>>)> {
240238
match target.split_once('?') {
241239
Some((path, query)) => Ok((path.to_string(), parse_query_params(query)?)),
@@ -697,28 +695,6 @@ fn find_crlf(buf: &[u8], start: usize) -> Option<usize> {
697695
.map(|offset| start + offset)
698696
}
699697

700-
/// Read and relay a full HTTP response (headers + body) from upstream to client.
701-
///
702-
/// Returns a [`RelayOutcome`] indicating whether the connection is reusable,
703-
/// consumed, or has been upgraded (101 Switching Protocols).
704-
///
705-
/// Note: callers that receive `Upgraded` are responsible for switching to
706-
/// raw bidirectional relay and forwarding the overflow bytes.
707-
// Public helper retained as part of the relay API surface; internal callers
708-
// currently use `relay_response` directly.
709-
#[allow(dead_code)]
710-
pub(crate) async fn relay_response_to_client<U, C>(
711-
upstream: &mut U,
712-
client: &mut C,
713-
request_method: &str,
714-
) -> Result<RelayOutcome>
715-
where
716-
U: AsyncRead + Unpin,
717-
C: AsyncWrite + Unpin,
718-
{
719-
relay_response(request_method, upstream, client).await
720-
}
721-
722698
async fn relay_response<U, C>(
723699
request_method: &str,
724700
upstream: &mut U,

0 commit comments

Comments
 (0)