http job doesn't suspend in kde4 and k- vs qprocess

koos vriezen koos.vriezen at gmail.com
Tue Oct 16 11:13:19 BST 2007


2007/10/16, Thiago Macieira <thiago at kde.org>:
> Em Monday 15 October 2007 22:59:37 koos vriezen escreveu:
> > I noticed data corruption in my code that stream data from kio to
> > stdin of a kprocess. The cause is that in kde3, I did a job suspend
> > which stopped the data signals until resumed, but it doesn't do so in
> > kde4. In fact the suspend return false now.
>
> Example code?

The code is in branches/work/kde4/extragear/multimedia/kmplayer/src/kmplayerprocess.cpp
But it's about code that worked in kde3, like

  void NpStream::slotData (KIO::Job*, const QByteArray& qb) {
        pending_buf = qb;
        if (qb.size()) {
            job->suspend ();

which stopped this job from pushing data.

> > Another thing I'm watching is the replacement of k3process to
> > qprocess. While k3process is lightweight in passing the data to the
> > final stdout, qprocess copies the data. So now I'm wondering if I
> > should use popen or something else and use socketnotifiers instead.
> > Actually what I really would like is not the data signals itself, but
> > a unix domain socket where the data could be read from directly from
> > the slave, as I need it to send to another application anyhow, that
> > application could read it directly instead. Any other signal, should
> > still be signal'ed though.
> > Any advice on the matter would be appreciated.
>
> Don't use popen and don't use socket notifiers. Anything else is acceptable. I
> did not understand what you meant about QProcess.

What is the issue with socketnotifiers? k3process uses these.
(sometimes I get 100% CPU usages and notice constant QSocketNotifier
events, I wonder if this might be related)

> IOSlaves only talk to the application and to klauncher. You cannot make them
> talk to something else without changing the protocol.

Ok.

> Why are you passing
> data from it to a third party? Why can't that application request data from
> the IOSlave directly and bypass the middle-man (you)?

That's because in my case I need the hosting application to open the
url for http cookies etc to work.

Br.
Koos




More information about the kde-core-devel mailing list