From c30bd0d9ab5fd06ccdff59e3bb6baa780d6764b0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 3 Oct 2023 17:18:22 +0200 Subject: [PATCH] Fix typo ... also make it possible to pre-define `STROPHE_MESSAGE_BUFFER_SIZE` in a custom build if someone doesn't want such a huge stack buffer. Signed-off-by: Steffen Jaeckel --- src/event.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/event.c b/src/event.c index 82e5388..b79710b 100644 --- a/src/event.c +++ b/src/event.c @@ -58,8 +58,10 @@ #include "common.h" #include "parser.h" +#ifndef STROPHE_MESSAGE_BUFFER_SIZE /** Max buffer size for receiving messages. */ -#define STROPE_MESSAGE_BUFFER_SIZE 4096 +#define STROPHE_MESSAGE_BUFFER_SIZE 4096 +#endif static int _connect_next(xmpp_conn_t *conn) { @@ -96,7 +98,7 @@ void xmpp_run_once(xmpp_ctx_t *ctx, unsigned long timeout) struct timeval tv; xmpp_send_queue_t *sq, *tsq; int towrite; - char buf[STROPE_MESSAGE_BUFFER_SIZE]; + char buf[STROPHE_MESSAGE_BUFFER_SIZE]; uint64_t next; uint64_t usec; int tls_read_bytes = 0; @@ -308,10 +310,10 @@ next_item: if (FD_ISSET(conn->sock, &rfds) || (conn->tls && tls_pending(conn->tls))) { if (conn->tls) { - ret = tls_read(conn->tls, buf, STROPE_MESSAGE_BUFFER_SIZE); + ret = tls_read(conn->tls, buf, STROPHE_MESSAGE_BUFFER_SIZE); } else { ret = - sock_read(conn->sock, buf, STROPE_MESSAGE_BUFFER_SIZE); + sock_read(conn->sock, buf, STROPHE_MESSAGE_BUFFER_SIZE); } if (ret > 0) {