KIO::SlaveBase::openPassDlg question
Dawit A.
adawit at kde.org
Sun Jun 20 19:02:37 BST 2004
On Sunday 20 June 2004 13:49, Martin Koller wrote:
> Hi all,
>
> looking on the openPassDlg() method, I ask myself what does the
> checkCachedAuthentication() method do ?
>
> I assume, the latter only checks if there is already a user/pass pair
> available in cache, whereby the other would ask (with a dialog) for one, if
> not already in cache - correct ?
>
> If this assumption is correct, I would not understand the doc for
> checkCachedAuthentication() which says:
>
> Here is a simple example:
> *
> * \code
> * AuthInfo info;
> * info.url = KURL("http://www.foobar.org/foo/bar");
> * info.username = "somename";
> * info.verifyPath = true;
> * if ( !checkCachedAuthentication( info ) )
> * {
> * if ( !openPassDlg(info) )
> * ....
> * }
> * \endcode
>
> But wouldn't one then always simply call openPassDlg() without the
> checkCache.. in advance ?
The example is old and predates the current implementation of password
caching. IIRC the current openPassDlg function indeed checks for cached
password first so there is no need to do that. The reason
checkCachedAuthentication is there is to allow you to pre-emptively send
cached password before the server requests one that way you do not end up
doing 2 round trips for every requested in password authenticated sites...
You can remove the "if(!openPassDlg..." line from the example ; otherwise I
will do it when I get a chance...
--
Regards,
Dawit A.
"Preach what you practice, practice what you preach"
More information about the kde-core-devel
mailing list