chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
server/*.c: Don't try reading per-user configuration.
[disorder]
/
cgi
/
actions.c
diff --git
a/cgi/actions.c
b/cgi/actions.c
index 584da76c040a88c0ea8988c17366c7ae86201acd..6f094cb7780a98b928092fcfe45869d801c3e7c0 100644
(file)
--- a/
cgi/actions.c
+++ b/
cgi/actions.c
@@
-76,14
+76,13
@@
static void act_playing(void) {
&& dcgi_playing->sofar >= 0) {
/* Try to put the next refresh at the start of the next track. */
xtime(&now);
&& dcgi_playing->sofar >= 0) {
/* Try to put the next refresh at the start of the next track. */
xtime(&now);
- fin = now + length - dcgi_playing->sofar
+ config->gap
;
+ fin = now + length - dcgi_playing->sofar;
if(now + refresh > fin)
refresh = fin - now;
}
if(dcgi_queue && dcgi_queue->origin == origin_scratch) {
if(now + refresh > fin)
refresh = fin - now;
}
if(dcgi_queue && dcgi_queue->origin == origin_scratch) {
- /* next track is a scratch, don't leave more than the inter-track gap */
- if(refresh > config->gap)
- refresh = config->gap;
+ /* next track is a scratch, refresh immediately */
+ refresh = 0;
}
if(!dcgi_playing
&& ((dcgi_queue
}
if(!dcgi_playing
&& ((dcgi_queue
@@
-91,9
+90,8
@@
static void act_playing(void) {
|| dcgi_random_enabled)
&& dcgi_enabled) {
/* no track playing but playing is enabled and there is something coming
|| dcgi_random_enabled)
&& dcgi_enabled) {
/* no track playing but playing is enabled and there is something coming
- * up, must be in a gap */
- if(refresh > config->gap)
- refresh = config->gap;
+ * up, so refresh immediately */
+ refresh = 0;
}
/* Bound the refresh interval below as a back-stop against the above
* calculations coming up with a stupid answer */
}
/* Bound the refresh interval below as a back-stop against the above
* calculations coming up with a stupid answer */
@@
-309,8
+307,12
@@
static int login_as(const char *username, const char *password) {
if(dcgi_cookie && dcgi_client)
disorder_revoke(dcgi_client);
if(dcgi_cookie && dcgi_client)
disorder_revoke(dcgi_client);
- /* We'll need a new connection as we are going to stop being guest */
+ /* We'll need a new connection as we are going to stop being guest.
+ * Make sure it's unprivileged, so that the server actually bothers checking
+ * the password we supply.
+ */
c = disorder_new(0);
c = disorder_new(0);
+ disorder_force_unpriv(c);
if(disorder_connect_user(c, username, password)) {
login_error("loginfailed");
return -1;
if(disorder_connect_user(c, username, password)) {
login_error("loginfailed");
return -1;