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

webinterface bug when we have too many torrents

Tags: None
(comma "," separated)
Zajec
Registered Member
Posts
53
Karma
0
In file "php_handler.cpp" we use QString variable called "php_s" to prepare data that will be processed by PHP. If there is too many torrents on the list, function php_i->downloadStatus() returns really huge QString.

There are two possible bugged situations caused by this:
1) php_i->downloadStatus() works fine but when we append it's output to php_s (which already contains some code) then php_s can't manage with such a big amount of data and something will be lost.
2) php_i->downloadStatus() tries to return huge QString and somethig is being lost here.

I am not sure about sollution. Is there some alternative for QString with unlimited amount of chars? If so, can we use it?

It there isn't alternative maybe we should return array of QStrings?
George
Moderator
Posts
5421
Karma
1

Thu Dec 20, 2007 5:11 pm
Maybe QByteArray is a better alternative
Zajec
Registered Member
Posts
53
Karma
0

Thu Dec 20, 2007 6:01 pm
Hmm, I am not sure of my idea anymore... I found a litte of time today and googled for a moment. I found information that QString can containt about 2^32 (or 2^3) of QChar... So it's probably not o problem.

I checked log from urbinek again and I can see that interface.php was loaded until this line:
Code: Select all
echo "<td style=\"text-align:left;\" onmouseover=\"this.T_TITLE='$torrent_name';return escape('Download speed:&lt;strong&gt;{$torrent['download_rate']}&lt;/strong&gt;&lt;br /&gt; Upload speed:&lt;strong&gt;{$torrent['upload_rate']}&lt;/strong&gt;&lt;/td&gt;')\">$file_td_content</td>";


So now I think te problem may be something about reading file with
Code: Select all
\"hey\"
construction.
George
Moderator
Posts
5421
Karma
1

Thu Dec 20, 2007 6:11 pm
What do you think about this patch :

http://ktorrent.org/misc/webinterface_bytearrays.patch

It uses QByteArray and QTextStream
George
Moderator
Posts
5421
Karma
1

Thu Dec 20, 2007 10:43 pm
There were some problems with the previous one, test with this :

http://ktorrent.org/misc/webinterfaces_ ... ray2.patch
urbinek
Registered Member
Posts
18
Karma
0

Mon Dec 24, 2007 1:09 am
George wrote:There were some problems with the previous one, test with this :

http://ktorrent.org/misc/webinterfaces_ ... ray2.patch

something isn't working ;)
Code: Select all
urbinek@haruko:~/ktorrent-2.2.4$  wgethttp://ktorrent.org/misc/webinterfaces_qbytearray2.patch
urbinek@haruko:~/ktorrent-2.2.4$ patch -p0 < webinterfaces_qbytearray2.patch
patching file plugins/webinterface/php_interface.cpp
patching file plugins/webinterface/php_interface.h
patching file plugins/webinterface/httpclienthandler.cpp
patching file plugins/webinterface/php_handler.cpp
Hunk #4 FAILED at 64.
1 out of 5 hunks FAILED -- saving rejects to file plugins/webinterface/php_handler.cpp.rej
patching file plugins/webinterface/php_handler.h
George
Moderator
Posts
5421
Karma
1

Mon Dec 24, 2007 4:54 pm
This is a patch based upon the latest SVN code
Zajec
Registered Member
Posts
53
Karma
0

Tue Dec 25, 2007 8:46 am
George wrote:This is a patch based upon the latest SVN code
urbinek, try to use:
Code: Select all
svn co svn://anonsvn.kde.org/home/kde/branches/extragear/kde3/network/ktorrent
cd ktorrent
svn co svn://anonsvn.kde.org/home/kde/branches/KDE/3.5/kde-common/admin/
svn cat svn://anonsvn.kde.org/home/kde/branches/extragear/kde3/network/Makefile.cvs > Makefile.cvs
make -f Makefile.cvs
wget http://ktorrent.org/misc/webinterfaces_qbytearray2.patch
patch -p0 < webinterfaces_qbytearray2.patch

After that normal configure, make, make install.
urbinek
Registered Member
Posts
18
Karma
0

Tue Dec 25, 2007 11:04 pm
patch works perfectly
but ktorrent seems to by a litle bit unstable(crashing while doing some operations on webgui) and needs more CPU power
George
Moderator
Posts
5421
Karma
1

Thu Dec 27, 2007 2:18 pm
I will do some more testing and fix the the unstable issues before commiting it
urbinek
Registered Member
Posts
18
Karma
0

Tue Jan 15, 2008 1:30 pm
any progress :D?
George
Moderator
Posts
5421
Karma
1

Tue Jan 15, 2008 6:43 pm
The stability issues should be fixed
urbinek
Registered Member
Posts
18
Karma
0

Tue Jan 15, 2008 6:47 pm
and what about CPU usage ?
ktorrent is consuming about 30-50 % of my CPU ( i have only 16 tasks at my list)


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]