Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-16023

Aborting authentication loop gives strange warning 'QHttpNetworkConnectionChannel::sendRequest() called without QHttpNetworkReply'

    XMLWordPrintable

Details

    Description

      Aborting the infinite authentication loop calling reply->abort() causes QHttpNetworkConnectionChannel::sendRequest() getting called with invalid data.
      Based on the comment "// heh, how should that happen!" this is not the intended behaviour.

      void Example::onAuthenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator)
      {
      	if(authenticator->user().isEmpty() && authenticator->password().isEmpty())  {
      		authenticator->setPassword("FOO");
      		authenticator->setUser("BAR");
      	}
      	else {
      		// Abort reply to terminate authentication loop.
      		authenticator->setPassword("");
      		authenticator->setUser("");
      		reply->abort();
      	}
      }
      
      
      bool QHttpNetworkConnectionChannel::sendRequest() 
       { 
      	if (!reply) { 
      		// heh, how should that happen! 
      		qWarning() << "QHttpNetworkConnectionChannel::sendRequest() called without QHttpNetworkReply"; 
      		state = QHttpNetworkConnectionChannel::IdleState; 
      		return false; 
      	}
      ... 
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            ebragge Eero Bragge
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes