|
SmartFTP FTP Library
|
import "sfFTPLib.idl";
Public Member Functions | |
| HRESULT | IsExtension ([in] BSTR extension, [out, retval] VARIANT_BOOL *retval) |
| Checks if the connected server supports a specific SFTP protocol extension. | |
Properties | |
| BSTR | EOL [get] |
| Retrieves the line ending sequence explicitly reported by the server's operating system. | |
| ISFTPVendorId | VendorId [get] |
| Retrieves the software identification data reported by the remote SFTP server. | |
| HRESULT ISFTPServerState::IsExtension | ( | [in] BSTR | extension, |
| [out, retval] VARIANT_BOOL * | retval ) |
Checks if the connected server supports a specific SFTP protocol extension.
The Mechanism: During the initial version negotiation (Handshake), the server sends a list of supported extensions (Name-Data pairs). These extensions define capabilities beyond the standard SFTP protocol version.
Usage (Feature Detection): Before attempting to use advanced features, use this method to verify support. For example:
Format: Extension names are typically formatted as name (standard IETF extensions) or name@domain (vendor-specific extensions). The comparison is case-sensitive.
| [in] | extension | The exact name of the extension to query (e.g., "posix-rename@openssh.com"). |
| [out] | retval | Returns VARIANT_TRUE if the server advertised this extension; otherwise VARIANT_FALSE. |
|
getproperty |
Retrieves the line ending sequence explicitly reported by the server's operating system.
The Negotiation: In SFTP protocol versions 4, 5, and 6, the server can include a newline extension in its version packet. This informs the client exactly which character sequence defines the end of a line (e.g., \n for Unix/Linux, \r\n for Windows).
Usage: This value is used to automatically configure text-mode transfers. If the connection's ISFTPConnection::ServerLineTerminator property is empty (the default), the component uses this value to perform the correct translation.
Protocol Limitations (OpenSSH): SFTP Version 3 (used by standard OpenSSH) does not support this extension. In those cases, this property may return an empty string or a default value (usually \n) inferred from the server's OS string.
| [out] | retval | Receives the server's newline string (e.g., "\n" or "\r\n"). |
|
getproperty |
Retrieves the software identification data reported by the remote SFTP server.
The Source: This object is populated automatically during the SFTP Protocol Version Exchange. It reflects the data found in the vendor-id extension structure within the SSH_FXP_VERSION packet sent by the server.
Usage: Read this property to fingerprint the server implementation (e.g., "Bitvise"). This is critical for applying compatibility workarounds. For example, if VendorName is "LegacyServer" and ProductVersion is "1.0", you might choose to disable newer features like CopyFile or CheckFile that are known to be broken on that version.
OpenSSH Note: Standard OpenSSH servers (and many strictly RFC-compliant v3 servers) do not send this extension. In those cases, this object will contain empty strings and 0 values.
| [out] | retval | Receives the ISFTPVendorId object containing the server's reported identity. |