mirror of
https://github.com/openai/codex.git
synced 2026-11-23 23:10:47 +00:00
Avoid eager copies of plugin startup HTTP response bodies (#63241)
## What changed Convert response bodies with `Vec::from` in both GitHub and public fetches so the conversion can reuse the backing allocation when possible. GitOrigin-RevId: ece0f018a08706a99b80733ec6c916ed39df5213
This commit is contained in:
@@ -960,7 +960,7 @@ async fn fetch_github_bytes(
|
||||
"{context} from {url} failed with status {status}: {body_text}"
|
||||
));
|
||||
}
|
||||
Ok(body.to_vec())
|
||||
Ok(Vec::from(body))
|
||||
}
|
||||
|
||||
async fn fetch_public_text(
|
||||
@@ -1007,7 +1007,7 @@ async fn fetch_public_bytes(
|
||||
"{context} from {url} failed with status {status}: {body_text}"
|
||||
));
|
||||
}
|
||||
Ok(body.to_vec())
|
||||
Ok(Vec::from(body))
|
||||
}
|
||||
|
||||
fn github_request(http_clients: &StartupSyncHttpClient, url: &str) -> RequestBuilder {
|
||||
|
||||
Reference in New Issue
Block a user