summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-10-31 18:01:05 -0400
committerJune McEnroe <june@causal.agency>2019-10-31 18:04:59 -0400
commitd30aee7722a6cd3a68dcd282c626b65e969f6520 (patch)
tree33426c80457bcd22d9a1b918c805d6b8b441886e
parentIterator over pollfds in reverse (diff)
downloadpounce-d30aee7722a6cd3a68dcd282c626b65e969f6520.tar.gz
pounce-d30aee7722a6cd3a68dcd282c626b65e969f6520.zip
Shrink client buffer size
Clients are generally not going to send huge amounts at a time, and IRC
messages are limited to 512 bytes. If in the future we supported message
tags from clients, which have a size limit of 8191 bytes, this would
unfortunately have to be set much higher.
-rw-r--r--client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/client.c b/client.c
index a191f42..bcb281f 100644
--- a/client.c
+++ b/client.c
@@ -38,7 +38,7 @@ struct Client {
 	enum Need need;
 	size_t consumer;
 	bool serverTime;
-	char buf[4096];
+	char buf[1024];
 	size_t len;
 	bool error;
 };
@@ -220,6 +220,7 @@ static bool intercept(const char *line, size_t len) {
 }
 
 void clientRecv(struct Client *client) {
+	assert(client->len < sizeof(client->buf));
 	ssize_t read = tls_read(
 		client->tls,
 		&client->buf[client->len], sizeof(client->buf) - client->len
NGJune McEnroe 2020-08-15Make log messages consistentJune McEnroe 2020-08-15Remove closelog callJune McEnroe 2020-08-15Implement service statusJune McEnroe 2020-08-15Parse control commandsJune McEnroe 2020-08-15Read service pipesJune McEnroe 2020-08-15Implement non-blocking line-buffered readingJune McEnroe 2020-08-15Generate tags fileJune McEnroe 2020-08-15Just use CLOCK_MONOTONIC and clean up includesJune McEnroe 2020-08-15Reap childrenJune McEnroe 2020-08-14Implement serviceSignal, serviceStop, serviceRestartJune McEnroe 2020-08-14Reset restartInterval and restartDeadline on startJune McEnroe 2020-08-14Switch to timespec for timeoutsJune McEnroe 2020-08-14Implement serviceStartJune McEnroe 2020-08-14Flesh out Service structJune McEnroe 2020-08-14Build environment for servicesJune McEnroe 2020-08-14Implement spawntab parsingJune McEnroe 2020-08-14Open syslog, daemonize, write PIDJune McEnroe 2020-08-14Implement user and group lookupJune McEnroe 2020-08-14Add install targetJune McEnroe 2020-08-14Add spawnd skeletonJune McEnroe