Treat EOF as expected if self.quit

znc doesn't seem to respond to QUIT with ERROR like an IRCd would.
master
Curtis McEnroe 2018-12-14 16:48:16 -05:00
parent e84c36a0bd
commit a7681579fa
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 5 additions and 1 deletions

6
irc.c
View File

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