about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-03-17 11:58:50 -0400
committerJune McEnroe <june@causal.agency>2020-03-17 11:58:50 -0400
commit1d5c4a5e346f0a295818441eb37697be283130ec (patch)
tree2489786631df84fcacca766a4917d4002298ab59
parentIgnore 422 ERR_NOMOTD (diff)
downloadcatgirl-1d5c4a5e346f0a295818441eb37697be283130ec.tar.gz
catgirl-1d5c4a5e346f0a295818441eb37697be283130ec.zip
Send blank line after 10 minutes idle
Without this, I was having catgirl "time out" from pounce's POV, but
without catgirl noticing anything... I still don't understand this. Been
using this fix for a couple weeks though and it stopped happening, and
it's otherwise harmless, but yikes.
-rw-r--r--chat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/chat.c b/chat.c
index fa1240a..e998812 100644
--- a/chat.c
+++ b/chat.c
@@ -264,7 +264,7 @@ int main(int argc, char *argv[]) {
 		{ .events = POLLIN, .fd = execPipe[0] },
 	};
 	while (!self.quit) {
-		int nfds = poll(fds, (self.restricted ? 2 : ARRAY_LEN(fds)), -1);
+		int nfds = poll(fds, (self.restricted ? 2 : ARRAY_LEN(fds)), 600000);
 		if (nfds < 0 && errno != EINTR) err(EX_IOERR, "poll");
 		if (nfds > 0) {
 			if (fds[0].revents) uiRead();
@@ -273,6 +273,11 @@ int main(int argc, char *argv[]) {
 			if (fds[3].revents) execRead();
 		}
 
+		// XXX: Socket seems to just stop working when connected to something
+		// like pounce which sends no pings and there is no activity for a long
+		// time, so just send something...
+		if (!nfds) ircFormat("\r\n");
+
 		if (signals[SIGHUP]) self.quit = "zzz";
 		if (signals[SIGINT] || signals[SIGTERM]) break;
 
agency/pkg-plist?id=372a30c1839bc61d35f5209dac589d9697b7fe46&follow=1'>Update cgit-causal-agency to 8a10aa5June McEnroe 2021-01-17Update cgit-causal-agencyJune McEnroe 2021-01-17Update scooper to 1.1June McEnroe 2021-01-17Update catgirl to 1.5 (BONUS WEBISODE)June McEnroe 2021-01-15Update litterbox to 1.7June McEnroe 2021-01-15Update pounce to 2.2June McEnroe 2021-01-15Update catgirl to 1.4June McEnroe 2020-12-28Replace cgit-patched with cgit-causal-agencyJune McEnroe 2020-12-18Add notemap portJune McEnroe 2020-12-15Update libretls to 3.3.1June McEnroe 2020-12-15Update catsit to 1.1June McEnroe 2020-12-15Update pounce to 2.1p1June McEnroe 2020-12-15Add imbox portJune McEnroe 2020-11-24Update pounce to 2.1June McEnroe 2020-11-24Update libretls to 3.3.0June McEnroe 2020-11-17Update catgirl to 1.3June McEnroe 2020-11-17Update libretls to 3.2.2June McEnroe 2020-09-29Update libretls to 3.2.1June McEnroe 2020-09-10Update catgirl to 1.2June McEnroe 2020-09-09Add pounce-palaver portJune McEnroe 2020-09-09Update pounce to 2.0June McEnroe 2020-09-09Update litterbox to 1.6June McEnroe 2020-08-23Add scooper portJune McEnroe 2020-08-23Add catsit portJune McEnroe 2020-08-13Update pounce to 1.4p2June McEnroe 2020-08-11Update pounce to 1.4p1June McEnroe 2020-08-10Add litterbox portJune McEnroe 2020-08-10Add missing USES=pkgconfig to pounceJune McEnroe