[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    I/O slave -- http_post failure problem
From:       "Ben Schepens" <schepens () mindspring ! com>
Date:       2001-08-21 14:57:59
[Download RAW message or body]

PLEASE Somebody help me.

Is it possible to use one TransferJob within another I/O Slave?
I assume it MUST be possible.

Here is the problem:
--------------------

I have an I/O slave I created for protocol 'hello'.  In the
Get method of the hello I/O slave, I create an instance of
another object I use to get data via the http I/O slave.

(BTW... I have tested the http_post code outside of the
 I/O slave and it works fine.)

I want to use some of the data I get back from the internal
http_post to create the data output for the hello I/O slave.

The client of the hello slave in this case is Konqueror, which
I am assuming is doing somthing like

  ///---------------------------------------------------------------

  job = KIO::Get( "hello://www.foo.com");

  connect (job, SIGNAL( data (KIO::Job*, const QByteArray&),
               SLOT( slotDataArrived(KIO::Job*, const QByteArray&) ));

  connect (job, SIGNAL( result (KIO::Job *),
               SLOT( slotDataArrived( KIO::Job*) ) );

  ///---------------------------------------------------------------


Things work OK until the moment I try to create my internal
http_post job as shown below:

  ///---------------------------------------------------------------
  // Create http_post TransferJob, set Meta data, set callback Slots
  ///---------------------------------------------------------------

  m_transferJob = KIO::http_post(url, postDataXML, bShowProgressInfo);

  m_transferJob->addMetaData("content-type", sContentType );
  m_transferJob->addMetaData("content-length", sContentLength );

  connect( m_transferJob, SIGNAL( data (KIO::Job* ,const QByteArray&) ),
                           SLOT( slotXMLDataArrived( KIO::Job*, 
                                 const QByteArray&) ) );
  connect( m_transferJob, SIGNAL( result (KIO::Job *) ),
                           SLOT( slotXMLResult( KIO::Job*) ) );

  ///---------------------------------------------------------------

As soon as the first line above is executed I get an error 
from Konquerer:

  -----------------
  Error - Konqueror
  -----------------
  The process for the 
  hello protocol 
  died unexpectedly


Any clue how I can do an internal http_post AND successfully send
data back for the hello slave?

Thanks,
Ben

======================================================================
Ben Schepens
schepens _AT_ mindspring _DOT_ com


 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic