summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/client.c b/client.c
index 41cda25..e99ef09 100644
--- a/client.c
+++ b/client.c
@@ -10,8 +10,6 @@
#include <stdio.h>
#include <errno.h>
-#define MAX_SEND_BUFFER 150000
-
static void client_haveIn(epoll_client_t *client);
static BOOL client_haveOut(epoll_client_t *client);
@@ -175,7 +173,7 @@ static BOOL client_haveOut(epoll_client_t *client)
if (client->ssl == NULL && ret != tosend) return TRUE; // Sent less than requested -> buffer full, epoll will trigger us again
}
client->sbPos = client->sbFill = 0;
- if (client->ssl == NULL && client->sbLen > MAX_SEND_BUFFER / 2) {
+ if (client->ssl == NULL && client->sbLen > MAXMSGLEN / 2) {
helper_realloc(&client->sendBuffer, &client->sbLen, 8000, "client_haveOut");
}
return TRUE;
@@ -211,13 +209,13 @@ BOOL client_send(epoll_client_t *client, const char *buffer, size_t len, const B
client->sbPos = 0;
}
// Sanity
- if (client->sbFill + len > MAX_SEND_BUFFER) {
- printf("[Proxy] Dropping client as the send buffer would exceed %d bytes.\n", (int)MAX_SEND_BUFFER);
+ if (client->sbFill + len > MAXMSGLEN) {
+ printf("[Proxy] Dropping client as the send buffer would exceed %d bytes.\n", (int)MAXMSGLEN);
client->kill = TRUE;
return FALSE;
}
if (client->sbLen - client->sbFill < len) { // Still too small after compacting? realloc
- if (helper_realloc(&client->sendBuffer, &client->sbLen, client->sbLen + len + (client->ssl && client->sbLen > 0 ? MAX_SEND_BUFFER : 4000), "client_send") == -1) {
+ if (helper_realloc(&client->sendBuffer, &client->sbLen, client->sbLen + len + (client->ssl && client->sbLen > 0 ? MAXMSGLEN : 4000), "client_send") == -1) {
client->kill = TRUE;
return FALSE;
}