#include "user_list.h"
#include "server_command_list.h"
+/** commands including options must be shorter than this */
+#define MAX_COMMAND_LEN 4096
+
static RC4_KEY rc4_recv_key;
static RC4_KEY rc4_send_key;
static unsigned char rc4_buf[2 * RC4_KEY_LEN];
int handle_connect(int fd, struct sockaddr_in *addr)
{
int numbytes, ret, argc, use_rc4 = 0;
- char buf[STRINGSIZE];
+ char buf[4096];
unsigned char crypt_buf[MAXLINE];
struct user u;
struct server_command *cmd = NULL;
while ((numbytes = recv_buffer(fd, buf, sizeof(buf))) > 0) {
// PARA_INFO_LOG("recvd: %s (%d)\n", buf, numbytes);
ret = -E_COMMAND_SYNTAX;
- if (command && numbytes + strlen(command) > STRINGSIZE) /* DOS */
+ if (command && numbytes + strlen(command) > MAX_COMMAND_LEN) /* DOS */
goto err_out;
command = para_strcat(command, buf);
if ((p = strstr(command, EOC_MSG))) {