Second try [was: HTTPPostJob]

Dawit A. adawit at kde.org
Tue May 13 14:13:40 BST 2003


Hello,

Here is a second try for a new job to provide data streaming
to a remote server. For those who did not see the original post,
http://lists.kde.org/?l=kfm-devel&m=104520816914645&w=2,
this job is meant to fix the problem of uploading very large files to
remote machines which currently will bring your machine down to 
its knees unless you have gobbles and gobbles of memory.  Anyways,
based on the feedback I got from Waldo, I tried to deal with several 
related side issues in this current iteration. Namely, accommodating a 
KIO::put requests. Breifly here is a list of things that changed:

1.) For upload requests by KIO::put, cache the data in a temp file in case we 
have to retransmit the data to the io-slave, for example the io-slave had to 
do authentication and re-requests the data to be transmitted.  Note the 
intention here is to prevent/discourage the io-slave from storing data it 
needs to retransmit locally like kio_http does currently...

2.) Renamed to DataStreamJob since it no longer deals with POST requests only.
This might be a moot point however.

3.) Made the set/get the data transfer rate size functions protected since 
they are only implementation details as pointed out by Waldo.  They can be 
completely removed as well.

4.) If we error while reading from the data source in ::slotDataRequest, kill 
the job. For this Job::kill needs to be modified only a bit as follow:
    ...
    // Only set the error condition, if one has not already been provided.
    if (!m_error) 
      m_error = ERR_USER_CANCELED;


One thing I am not sure about, but something that can be easily changed is how 
the io-slave would indicate to the job that it needs it to retransmit the 
data, i.e. start over again. I think sending back an error message would not 
work since it would simply result in the job being killed. Waldo, any ideas ?

I also want to note that after making the changes above I realized that there 
is actually no need for a new job. Instead the changes, if agreed 
upon/improved..., can be simply merged back into KIO::TransferJob. I am 
providing it as is so that it is easier to see how and what the job does.

Any feedback ?

Regards,
Dawit A.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postjob.cpp
Type: text/x-c++src
Size: 10013 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20030513/364afbd4/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postjob.hpp
Type: text/x-c++src
Size: 4007 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20030513/364afbd4/attachment.c>


More information about the kfm-devel mailing list