chiark / gitweb /
New refresh_min option to bound below the web interface refresh
authorRichard Kettlewell <rjk@greenend.org.uk>
Sun, 14 Feb 2010 11:02:26 +0000 (11:02 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sun, 14 Feb 2010 11:02:26 +0000 (11:02 +0000)
interval.

CHANGES.html
cgi/actions.c
doc/disorder_config.5.in
lib/configuration.c
lib/configuration.h

index 0598fc78e4be1aa539650d8b85d7eca945470219..96342895fdc43d4189e66afc991aa3c8ff072963 100644 (file)
@@ -125,7 +125,7 @@ span.command {
       <p>Confirmation URLs should be cleaner (and in particular not end
       with punctuation).  (Please see <a
       href="README.upgrades">README.upgrades</a> for more about this.)</p>
       <p>Confirmation URLs should be cleaner (and in particular not end
       with punctuation).  (Please see <a
       href="README.upgrades">README.upgrades</a> for more about this.)</p>
-      
+
     </div>
       
     <h3>RTP Player</h3>
     </div>
       
     <h3>RTP Player</h3>
index 30ddba1ae03bea23b0e24e3eb1dbe5ff36318358..fae533a7b3f45ee37c4ab6e2ed5838ef71c4a0e4 100644 (file)
@@ -95,6 +95,10 @@ static void act_playing(void) {
     if(refresh > config->gap)
       refresh = config->gap;
   }
     if(refresh > config->gap)
       refresh = config->gap;
   }
+  /* Bound the refresh interval below as a back-stop against the above
+   * calculations coming up with a stupid answer */
+  if(refresh < config->refresh_min)
+    refresh = config->refresh_min;
   if((action = cgi_get("action")))
     url = cgi_makeurl(config->url, "action", action, (char *)0);
   else
   if((action = cgi_get("action")))
     url = cgi_makeurl(config->url, "action", action, (char *)0);
   else
index ef3a70faee4cf0ed0bb8b3b60e8709a1b22fb441..fd3878888d6e067ac7c929f54ff8ba527b851067 100644 (file)
@@ -808,8 +808,14 @@ This must be set if you have online registration enabled.
 .TP
 .B refresh \fISECONDS\fR
 Specifies the maximum refresh period in seconds.
 .TP
 .B refresh \fISECONDS\fR
 Specifies the maximum refresh period in seconds.
+The refresh period is the time after which the web interface's queue and manage
+pages will automatically reload themselves.
 Default 15.
 .TP
 Default 15.
 .TP
+.B refresh_min \fISECONDS\fR
+Specifies the minimum refresh period in seconds.
+Default 1.
+.TP
 .B sendmail \fIPATH\fR
 The path to the Sendmail executable.
 This must support the \fB-bs\fR option (Postfix, Exim and Sendmail should all
 .B sendmail \fIPATH\fR
 The path to the Sendmail executable.
 This must support the \fB-bs\fR option (Postfix, Exim and Sendmail should all
index 98d672b6ee2c0b36349c8fe2c29a8f6af371ffb7..a4f8b0c71140638aef02876b38a46cfd6e622d49 100644 (file)
@@ -1100,6 +1100,7 @@ static const struct conf conf[] = {
   { C(prefsync),         &type_integer,          validate_positive },
   { C(queue_pad),        &type_integer,          validate_positive },
   { C(refresh),          &type_integer,          validate_positive },
   { C(prefsync),         &type_integer,          validate_positive },
   { C(queue_pad),        &type_integer,          validate_positive },
   { C(refresh),          &type_integer,          validate_positive },
+  { C(refresh_min),      &type_integer,          validate_non_negative },
   { C(reminder_interval), &type_integer,         validate_positive },
   { C(remote_userman),   &type_boolean,          validate_any },
   { C(replay_min),       &type_integer,          validate_non_negative },
   { C(reminder_interval), &type_integer,         validate_positive },
   { C(remote_userman),   &type_boolean,          validate_any },
   { C(replay_min),       &type_integer,          validate_non_negative },
@@ -1337,6 +1338,7 @@ static struct config *config_default(void) {
   logname = pw->pw_name;
   c->username = xstrdup(logname);
   c->refresh = 15;
   logname = pw->pw_name;
   c->username = xstrdup(logname);
   c->refresh = 15;
+  c->refresh_min = 1;
   c->prefsync = 0;
   c->signal = SIGKILL;
   c->alias = xstrdup("{/artist}{/album}{/title}{ext}");
   c->prefsync = 0;
   c->signal = SIGKILL;
   c->alias = xstrdup("{/artist}{/album}{/title}{ext}");
index 0371f3ea642b641aa9477be30618c73847885a4a..617d9293480948d5078279515f1bb84780595127 100644 (file)
@@ -215,6 +215,9 @@ struct config {
   /** @brief Maximum refresh interval for web interface (seconds) */
   long refresh;
 
   /** @brief Maximum refresh interval for web interface (seconds) */
   long refresh;
 
+  /** @brief Minimum refresh interval for web interface (seconds) */
+  long refresh_min;
+
   /** @brief Facilities restricted to trusted users
    *
    * A bitmap of @ref RESTRICT_SCRATCH, @ref RESTRICT_REMOVE and @ref
   /** @brief Facilities restricted to trusted users
    *
    * A bitmap of @ref RESTRICT_SCRATCH, @ref RESTRICT_REMOVE and @ref