chitralverma commented on code in PR #7977:
URL: https://github.com/apache/opendal/pull/7977#discussion_r4757390824
##########
.github/scripts/test_behavior/plan.py:
##########
@@ -271,6 +276,8 @@ def generate_core_cases(
def _filter_binding_cases(
cases: list[dict[str, str]], language: str
) -> list[dict[str, str]]:
+ cases = [v for v in cases if (v["service"], v["setup"]) not in
WINDOWS_SETUPS]
Review Comment:
45adba84b moves it below, next to the `remotestorage` filter. It stays
before `unique_cases`, which keeps one setup per service: if a Windows setup
sorted first, a later filter would drop the whole service from the binding jobs.
*This comment is AI assisted.*
##########
core/services/sftp/src/backend.rs:
##########
@@ -62,16 +67,16 @@ impl SftpBuilder {
/// Sets the time limit for each connection setup stage and each pooled
connection health check.
///
- /// The limit applies separately to SSH connection and authentication,
SFTP subsystem
- /// initialization, and root directory initialization. Defaults to 10
seconds.
- /// A zero duration disables these limits.
+ /// The limit applies separately to waiting for an SSH handshake slot, SSH
connection and
+ /// authentication, SFTP subsystem initialization, and root directory
initialization.
+ /// Defaults to 10 seconds. A zero duration disables these limits.
pub fn connect_timeout(mut self, timeout: Duration) -> Self {
self.connect_timeout = Some(timeout);
self
}
/// set endpoint for sftp backend.
- /// The format is same as `openssh`, using either `[user@]hostname` or
`ssh://[user@]hostname[:port]`. A username or port that is specified in the
endpoint overrides the one set in the builder (but does not change the builder).
+ /// The format is either `[user@]hostname[:port]` or
`ssh://[user@]hostname[:port]`, and the port defaults to 22. A username that is
specified in the endpoint overrides the one set in the builder (but does not
change the builder).
Review Comment:
Done in 23e887c1b.
*This comment is AI assisted.*
##########
core/services/sftp/src/backend.rs:
##########
@@ -465,3 +394,108 @@ impl Service for SftpBackend {
))
}
}
+
+/// Request data of the `copy-data` extension in
+/// draft-ietf-secsh-filexfer-extensions-00.
+#[derive(Serialize)]
+struct CopyData<'a> {
+ read_from: &'a SftpHandle,
+ read_from_offset: u64,
+ /// Zero copies until the end of the source.
+ read_data_length: u64,
+ write_to: &'a SftpHandle,
+ write_to_offset: u64,
+}
+
+async fn copy_file(
+ core: Arc<SftpCore>,
+ from: String,
+ to: String,
+ source_content_length_hint: Option<u64>,
+) -> Result<Metadata> {
+ let client = Arc::new(core.connect().await?);
Review Comment:
The library doesn't need it. `RawSftpSession` takes `&self` for every
request, so `stat`, `rename`, and `delete` use the checkout directly. The `Arc`
wraps only the pool checkout (`SftpConnection`), so that several `OpenHandle`s
can share one connection: copy opens the source and destination on it, and a
handle dropped without `close()` closes itself in a task that needs its own
reference. The connection returns to the pool when the last handle is closed.
The pool is `main`'s (64 connections). Since #8959 a reader, writer, or
lister keeps its connection until it closes. SFTP handles belong to one
session, so a stream can't move to another connection. One session can carry
many requests, so a shared session is possible, but that changes the capacity
contract and is better as a separate change.
*This comment is AI assisted.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]