summaryrefslogtreecommitdiffstats
path: root/qarshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'qarshd.c')
-rw-r--r--qarshd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/qarshd.c b/qarshd.c
index 7f0f944..8d1a798 100644
--- a/qarshd.c
+++ b/qarshd.c
@@ -41,7 +41,7 @@
#include "sockutil.h"
#include "qarsh_packet.h"
-#define QARSHD_BUFSIZE 4096
+#define QARSHD_BUFSIZE QARSH_MAX_PACKET_SIZE/2
/*
* QA Remote Shell Daemon
*/
@@ -283,8 +283,8 @@ handle_qarsh()
int child_status;
struct qa_packet *qp = NULL, *rp = NULL;
int allowed_out = 0, allowed_err = 0; /* number of bytes we can send to client */
- char buf[4096]; /* short term buffer for stdout and stderr */
- char buf_in[4096]; /* long term buffer for stdin */
+ char buf[QARSHD_BUFSIZE]; /* short term buffer for stdout and stderr */
+ char buf_in[QARSHD_BUFSIZE]; /* long term buffer for stdin */
int z_in = 0; /* Number of bytes in stdin buffer */
int eof_in = 0; /* Have we seen EOF on stdin yet? */
int nbytes;
@@ -297,7 +297,7 @@ handle_qarsh()
sa.sa_flags = SA_RESTART;
sigaction(SIGCHLD, &sa, NULL);
- qp = make_qp_data_allow(0, 4096);
+ qp = make_qp_data_allow(0, QARSHD_BUFSIZE);
send_packet(qoutfd, qp);
qpfree(qp);