Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 204284 - net-p2p/ctcs-1.4: Addition of Page Auto Refresh
Summary: net-p2p/ctcs-1.4: Addition of Page Auto Refresh
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo net-p2p team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-04 15:37 UTC by Shawn
Modified: 2008-01-15 17:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch file for CTCS (ctcs.patch,1.83 KB, patch)
2008-01-04 15:38 UTC, Shawn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn 2008-01-04 15:37:33 UTC
Submitting a patch to allow for auto-refreshing of the webpage. Allows the user to specify how long between refreshes (Seconds)

Reproducible: Always

Steps to Reproduce:

Actual Results:  
Allows for the page to be refreshed automaticaly using HTML META TAGS.

Expected Results:  
Allows for the page to be refreshed automaticaly using HTML META TAGS.

Patch File Contents:

--- ctcs-1.4/ctcs       2007-06-05 05:17:46 +0000
+++ ctcs-1.4/ctcs       2008-01-02 15:17:18 +0000
@@ -29,6 +29,7 @@
 # global variables
 my $ver = "1.4";
 my $bwinterval = 5;    # bandwidth management interval (seconds)
+my $refreshInterval = 300; #Page refresh Interval (seconds)
 my $CTCS_PROTOCOL = "0003";
 my $current_client = "";
 my (%cfh,%torrents,%ctfile,%ctbw,%ctconfig,%ctdetail,%ctstatus,%ctstime,
@@ -548,7 +549,13 @@
                HTTP/1.0 200 OK\r
                Content-Type: text/html\r
                \r
-               <HTML><HEAD><TITLE>CTCS - All Torrents</TITLE></HEAD><BODY>
+               <HTML><HEAD><TITLE>CTCS - All Torrents</TITLE>
+EOF
+       printf $cfh "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"%d\">",$refreshInterval;
+        print $cfh <<EOF =~ /[^\t]*\n/g;
+
+               <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
+               </HEAD><BODY>
                <CENTER>
                <H1><A HREF="http://www.rahul.net/dholmes/ctorrent/ctcs.html">
                <I>CT</I>orrent <I>C</I>ontrol <I>S</I>erver</A></H1>
@@ -569,10 +576,10 @@
                "<INPUT NAME=\"ulimit\" TYPE=\"text\" align=right SIZE=4 VALUE=\"%d\">" .
                "K/s\n</TR>\n",
                $allul / 1024, $tulimit / 1024;
-       printf $cfh "<TR><TD><TD align=right>Change interval: " .
+       printf $cfh "<TR><TD>Reload:<INPUT name=\"refreshInterval\" type=\"text\" size=\"3\" value=\"%d\">sec<TD align=right>Change interval: " .
                "<INPUT name=\"bwinterval\" type=\"text\" align=right size=3 " .
                "value=\"%d\">sec</TR>\n",
-               $bwinterval;
+               $refreshInterval,$bwinterval;
        print $cfh "</TABLE></CENTER></FORM>\n\n";
        print $cfh "<CENTER><A HREF=\"/alimits\">Advanced Limits</A></CENTER>\n\n";

@@ -1511,6 +1518,7 @@
        if ($page =~ /[?&]dlimit=(\d+)/) { $tdlimit = $1 * 1024; }
        if ($page =~ /[?&]ulimit=(\d+)/) { $tulimit = $1 * 1024; }
        if ($page =~ /[?&]bwinterval=(\d+)/) { $bwinterval = $1; }
+       if ($page =~ /[?&]refreshInterval=(\d+)/) { $refreshInterval = $1; }

        $page =~ s/\?.*//;
 #      print $cfh "HTTP/1.0 205 OK\r\n";
Comment 1 Shawn 2008-01-04 15:38:46 UTC
Created attachment 140075 [details, diff]
patch file for CTCS

This patch allows for user control of page refresh intervals
Comment 2 Raúl Porcel (RETIRED) gentoo-dev 2008-01-15 12:47:21 UTC
Please submit this upstream, thanks
Comment 3 Shawn 2008-01-15 17:40:38 UTC
(In reply to comment #2)
> Please submit this upstream, thanks

To be honest this is my first experience with this, could ya tell me what you are refering to?
Comment 4 Raúl Porcel (RETIRED) gentoo-dev 2008-01-15 17:49:21 UTC
You should contact the developer of the application, http://www.rahul.net/dholmes/ctorrent/
Comment 5 Shawn 2008-01-15 17:54:44 UTC
(In reply to comment #4)
> You should contact the developer of the application,
> http://www.rahul.net/dholmes/ctorrent/

Ok thanks, I did that at the same time that I posted this =)
Thanks Again.