Browse Source

Treat EOF as expected if self.quit

znc doesn't seem to respond to QUIT with ERROR like an IRCd would.
master
Causal Agent 6 months ago
parent
commit
a7681579fa
Signed by: Curtis McEnroe <june@causal.agency> GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      irc.c

+ 5
- 1
irc.c View File

@@ -131,7 +131,11 @@ retry:
131 131
 	read = tls_read(client, &buf[len], sizeof(buf) - len);
132 132
 	if (read == TLS_WANT_POLLIN || read == TLS_WANT_POLLOUT) goto retry;
133 133
 	if (read < 0) errx(EX_IOERR, "tls_read: %s", tls_error(client));
134
-	if (!read) errx(EX_PROTOCOL, "unexpected eof");
134
+	if (!read) {
135
+		if (!self.quit) errx(EX_PROTOCOL, "unexpected eof");
136
+		uiExit();
137
+		exit(EX_OK);
138
+	}
135 139
 	len += read;
136 140
 
137 141
 	char *crlf;

Loading…
Cancel
Save