[PATCH] kio_sftp error detection

Thiago Macieira thiago at kde.org
Sun Dec 28 18:55:37 GMT 2008


Michael Leupold wrote:
>Hi there,
>
>for quite a while kio_sftp has been a little poor detecting errors. The
> result of it was (is) usually an empty KDialog with some "unknown
> error" caption. Those errors get especially annoying when they happen
> during KUrlCompletion.
>
>I just figured that the sftp kioslave didn't know about some errors. So
> I implemented:
>- "Name or service not known" (eg. server name is not resolvable)
>- "Connection refused" (eg. no ssh server running on the port specified)
>- "Bad port" (displayed by OpenSSH if the port number is outside the
> allowed TCP port range)
>
>Additionally I removed the modal dialog boxes because I think a kioslave
>shouldn't show dialogboxes for those known errors (as I understand it
>SlaveBase::error() is meant for that, right?). I didn't introduce any
> new strings so far but used the ssh command's output (which might look
> strange sometimes). I also tried to keep interoperability with plink
> and non-free ssh (not sure if I succeeded - I can't test).
>
>Pretty please someone review and tell me if I may commit.

Two things I didn't like about this patch:

1) file-global arrays of QRegExp. Don't do that. Just don't. Either put 
them in a class (non-static) or inside a function. And why are the first 
two entries always alike? What's that about "unused"?

2) "if the user entered an invalid port". That's not possible. If the port 
is not valid, it cannot be entered in the first place, since QUrl/KUrl 
will not accept ports beyond the valid range.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081228/e633df7a/attachment.sig>


More information about the kde-core-devel mailing list