chiark / gitweb /
disobedience more robust against server restart
authorrjk@greenend.org.uk <>
Tue, 10 Jul 2007 23:14:31 +0000 (00:14 +0100)
committerrjk@greenend.org.uk <>
Tue, 10 Jul 2007 23:14:31 +0000 (00:14 +0100)
disobedience/TODO
disobedience/disobedience.c
lib/eclient.c

index 96cd6b9f91e6c2a5bff578ccdc8493bd7895cddb..31168db3a300fb472cdb455d86a1280d49a28073 100644 (file)
@@ -4,7 +4,4 @@ search
        select tracks by tag
 
 general:
-       If the server stops then disobedience crashes.  Specifically,
-       disorder_eclient_polled() finds a stashed 'command' with a
-       callback of authbanner_opcallback, and a NULL cmd, in
-       state_idle and c->authenticated nonzero.
+       disobedience doesn't like starting up if the server isn't running.
index 9ee7b3352c2bfefa19a1f04c01d5f62a6dc5f56e..5fe0a2825cc82a7fe6bcb46d5e0702e4adfc8365 100644 (file)
@@ -335,6 +335,7 @@ int main(int argc, char **argv) {
     default: fatal(0, "invalid option");
     }
   }
+  signal(SIGPIPE, SIG_IGN);
   /* create the event loop */
   D(("create main loop"));
   mainloop = g_main_loop_new(0, 0);
index 971dc4c1e4623b9ca7488588fe109d0d98da3a72..519e6038b04eecf4022caf0b7c010d97e7e9777e 100644 (file)
@@ -546,8 +546,10 @@ static void read_input(disorder_eclient *c) {
     if(c->state > state_connecting)
       consume(&c->input, (nl - c->input.vec) + 1);
   }
-  if(c->eof)
+  if(c->eof) {
     comms_error(c, "reading from %s: server disconnected", c->ident);
+    c->authenticated = 0;
+  }
 }
 
 /* called with a line that has just been read */