commit f22f43e0d4dcf567f4bdc3a50237443621d13a25
parent e4df314f01700dcd8d374436d0057c8494a70023
Author: Claudio Alessi <smoppy@gmail.com>
Date: Thu, 1 Jun 2023 22:05:52 +0200
Do not send ident if host has not sent any data.
Diffstat:
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/circo.c b/circo.c
@@ -1543,18 +1543,20 @@ run(void) {
}
else {
if(srv && FD_ISSET(fileno(srv), &rd)) {
- if(!online) {
- online = 1;
- sendident();
- }
if(fgets(bufin, sizeof bufin, srv) == NULL) {
- hangsup();
for(b = buffers; b; b = b->next)
- bprintf_prefixed(b, "Remote host closed connection.\n");
+ bprintf_prefixed(b, online
+ ? "Remote host closed connection."
+ : "Cannot connect to the host.");
+ hangsup();
}
else {
trespond = time(NULL);
parsesrv();
+ if(!online) {
+ online = 1;
+ sendident();
+ }
}
}
if(FD_ISSET(0, &rd))