Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
... 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 <[email protected]>
  • Loading branch information
sjaeckel committed Oct 26, 2023
1 parent fdd717a commit c30bd0d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -308,10 +310,10 @@ void xmpp_run_once(xmpp_ctx_t *ctx, unsigned long timeout)
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) {
Expand Down

0 comments on commit c30bd0d

Please sign in to comment.