This forum has been archived. All content is frozen. Please use KDE Discuss instead.

ktorrent startup prog prob

Tags: None
(comma "," separated)
cruicent
Registered Member
Posts
24
Karma
0

ktorrent startup prog prob

Sat Dec 30, 2006 4:15 pm
I wrote a c++ program to restart ktorrent each time it crashes (more like disappears as nothing comes up to say its crashed).
Unfortunatly, it doesnt work :lol:
At least for ktorrent, this is the output of the program:
Code: Select all
Enter Program Name: ktorrent
Program Start Time: Sat Dec 30 20:03:14 2006
Qt: Warning: QObject::disconnect: Unexpected null parameter
Program Terminated
Program Close Time: Sat Dec 30 20:03:14 2006

Reopening Program
Program Start Time: Sat Dec 30 20:03:14 2006
ktorrent is already running!
Program Terminated
Program Close Time: Sat Dec 30 20:03:14 2006

it then repeats the reopening program already running terminated.......

This is the program code:

Code: Select all
#include <iostream>
#include <ctime>

using namespace std;

int main()
{
    char name[15];

    cout<<"Enter Program Name: ";
    cin>>name;
  time_t hold_time;
  hold_time=time(NULL);
  cout<<"Program Start Time: "<<ctime(&hold_time);

  while(system (name) !=1)
  {
    for (time_t t = time(0) + 5; time(0) < t; ) {}
      cerr<<"Program Terminated"<<endl;
      cout<<"Program Close Time: "<<ctime(&hold_time)<<endl;
      cout<<"Reopening Program"<<endl;
      cout<<"Program Start Time: "<<ctime(&hold_time);
  }

  return 0;

}

Ktorrent stays open but I just get a lot of scrolling text on the console.
Is there anyway I can get this to work as ktorrent closes at the most annoying times (when Im sleeping :roll: )
Thanks for any help
George
Moderator
Posts
5421
Karma
1

Sun Dec 31, 2006 11:32 am
What version are you running ?
cruicent
Registered Member
Posts
24
Karma
0

Sun Dec 31, 2006 6:59 pm
mon dec 18 svn.
I changed the time to check every 45 mins (5 secs is a bit too short), it works fine (except for the huge resources for some reason), just something saying warning and disconnect for a torrent proggie doesnt sound nice.
Thanks
cruicent
Registered Member
Posts
24
Karma
0

Sun Dec 31, 2006 8:21 pm
Just installed the latest svn, same error.
rapsys
Registered Member
Posts
71
Karma
0

Sun Dec 31, 2006 10:10 pm
In fact the problem seems to comes from small marked as not dl files !

I have similar problem with multi-file torrent where I ask ktorrent to not dl the .sfv file of the torrent.

It makes ktorrent find the torrent as incompleted and stupidly re-dl that file (as I said I don't want it at all!).

This whould be cool to fix it.

Either by adding a set of files to avoid and store needed side chuck in .dtd or .dtd.chunck for example, like this :
ignore[0]=some_torrent_relative_path/somefile.ext
ignore[1]=some_torrent_relative_path/somefile.ext
...

or makes ktorrent better use .dtd files to store only needed partial chunck to makes data integrity check works.
(or lower the filecheck at torrent load)

See this example :
http://rapsys.free.fr/ktorrent/ktorrent ... dl_bug.png
George
Moderator
Posts
5421
Karma
1

Mon Jan 01, 2007 3:01 pm
cruicent wrote:Just installed the latest svn, same error.


A backtrace would be nice, for this crash.

Btw, for your restart program, you should use the function sleep, to sleep 5 seconds. That will get rid of the CPU usage, seeing that sleep will give the CPU to somebody else.
George
Moderator
Posts
5421
Karma
1

Mon Jan 01, 2007 3:04 pm
rapsys wrote:In fact the problem seems to comes from small marked as not dl files !

I have similar problem with multi-file torrent where I ask ktorrent to not dl the .sfv file of the torrent.

It makes ktorrent find the torrent as incompleted and stupidly re-dl that file (as I said I don't want it at all!).

This whould be cool to fix it.

Either by adding a set of files to avoid and store needed side chuck in .dtd or .dtd.chunck for example, like this :
ignore[0]=some_torrent_relative_path/somefile.ext
ignore[1]=some_torrent_relative_path/somefile.ext
...

or makes ktorrent better use .dtd files to store only needed partial chunck to makes data integrity check works.
(or lower the filecheck at torrent load)

See this example :
http://rapsys.free.fr/ktorrent/ktorrent ... dl_bug.png


This is totally not related.

Anyway, I can see this happening when you import a torrent, or the data is allready there. But this should not happen with a download where you start from scratch.

Also deselecting those tiny files is totally useless, the data of those files will be downloaded anyway.
rapsys
Registered Member
Posts
71
Karma
0

Mon Jan 01, 2007 6:57 pm
Is it fixed in latest release ?
(or shoud I request a new fix for avoid having forever a popup for each nodownload file at start)
cruicent
Registered Member
Posts
24
Karma
0

Mon Jan 01, 2007 7:23 pm
George wrote:
cruicent wrote:Just installed the latest svn, same error.


A backtrace would be nice, for this crash.

Btw, for your restart program, you should use the function sleep, to sleep 5 seconds. That will get rid of the CPU usage, seeing that sleep will give the CPU to somebody else.


Ill do it tonight and save the debug log (everytime ive done this so far it hasnt crashed yet though so fingers crossed it does tonight :) ). I dont get the kde screen saying the program crashed though, it just dissapears.
Thanks for the sleep tip.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft