If the port is from configuration, try to get the real port with libssh.
Otherwise it may confuse user.
Details
Details
- Reviewers
apol dfaure - Group Reviewers
Frameworks - Commits
- R320:40f1edc9a814: Try to get the real port instead of always use DEFAULT_SFTP_PORT
Manually tested with dolphin.
Diff Detail
Diff Detail
- Repository
- R320 KIO Extras
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
The patch looks good to me, but I'm clueless about this code-base. Let's try to get some feedback.
Comment Actions
Looks good - just a minor nitpick on coding style / readability, feel free to push (either way, actually).
sftp/kio_sftp.cpp | ||
---|---|---|
605 | This is a bit confusing when reading : first it's initialized to a value... | |
607 | ... and here another one is assigned, making the initialization useless. I would find this more readable: unsigned int effectivePort; if (mPort > 0) { effectivePort = mPort; } else { effectivePort = DEFAULT_SFTP_PORT; ssh_options_get_port(mSession, &effectivePort); } This encapsulates the ugly C API with a nasty output parameter in the second block only ;) |