Changeset 8369


Ignore:
Timestamp:
May 9, 2009, 12:23:42 AM (12 years ago)
Author:
charles
Message:

(trunk qt) fix odd wart reported by kjg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/session.cc

    r8358 r8369  
    544544        if( !mySessionId.isEmpty( ) )
    545545            header.setValue( TR_RPC_SESSION_ID_HEADER, mySessionId );
    546         QBuffer * buf = new QBuffer;
    547         buf->setData( data );
    548         myHttp.request( header, buf, &myBuffer );
     546        myHttp.setProperty( "current-request", data );
     547        myHttp.request( header, data, &myBuffer );
    549548#ifdef DEBUG_HTTP
    550549        std::cerr << "sending " << qPrintable(header.toString()) << "\nBody:\n" << request << std::endl;
     
    567566
    568567    QHttpResponseHeader response = myHttp.lastResponse();
    569     QIODevice * sourceDevice = myHttp.currentSourceDevice( );
    570568
    571569#ifdef DEBUG_HTTP
     
    577575#endif
    578576
    579     if( ( response.statusCode() == 409 ) && response.hasKey( TR_RPC_SESSION_ID_HEADER ) )
     577    if( ( response.statusCode() == 409 ) && ( myBuffer.buffer().indexOf("invalid session-id") != -1 ) )
    580578    {
    581579        // we got a 409 telling us our session id has expired.
    582580        // update it and resubmit the request.
    583581        mySessionId = response.value( TR_RPC_SESSION_ID_HEADER );
    584         exec( qobject_cast<QBuffer*>(sourceDevice)->buffer().constData( ) );
     582        exec( myHttp.property("current-request").toByteArray().constData() );
    585583    }
    586584    else if( error )
     
    597595    }
    598596
    599     delete sourceDevice;
    600597    myBuffer.buffer( ).clear( );
    601598    myBuffer.reset( );
Note: See TracChangeset for help on using the changeset viewer.