summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-02-26 08:59:01 +0000
committerChris Wilson <cpwilson@src.gnome.org>2007-02-26 08:59:01 +0000
commit5e6ab181a9942335f2633ef375cd91b25120de1c (patch)
tree3a2e438a3d81d7350ca80d0156767e9ba825d822
parent0ad8279def2a2e6fb3f0b9bf35c39ce82652c64b (diff)
downloadvte-5e6ab181a9942335f2633ef375cd91b25120de1c.tar.gz
And finally clamp the maximum number of bytes transferred in a single
2007-02-26 Chris Wilson <chris@chris-wilson.co.uk> * src/vte-private.h: * src/vte.c: (vte_terminal_io_read): And finally clamp the maximum number of bytes transferred in a single chunk. svn path=/trunk/; revision=1751
-rw-r--r--ChangeLog7
-rw-r--r--src/vte-private.h1
-rw-r--r--src/vte.c1
3 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ee84fc3a..3451605a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-26 Chris Wilson <chris@chris-wilson.co.uk>
+
+ * src/vte-private.h:
+ * src/vte.c: (vte_terminal_io_read):
+ And finally clamp the maximum number of bytes transferred in
+ a single chunk.
+
2007-02-24 Chris Wilson <chris@chris-wilson.co.uk>
* src/vte.c:
diff --git a/src/vte-private.h b/src/vte-private.h
index 47cbb642..9ebb64ba 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -82,6 +82,7 @@ G_BEGIN_DECLS
#define VTE_REGCOMP_FLAGS REG_EXTENDED
#define VTE_REGEXEC_FLAGS 0
#define VTE_INPUT_CHUNK_SIZE 0x2000
+#define VTE_MAX_INPUT_READ 0x1000
#define VTE_INVALID_BYTE '?'
#define VTE_DISPLAY_TIMEOUT 10
#define VTE_UPDATE_TIMEOUT 15
diff --git a/src/vte.c b/src/vte.c
index e0e43ffa..32669a0c 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -3511,6 +3511,7 @@ vte_terminal_io_read(GIOChannel *channel,
chunks = chunk;
}
rem = sizeof (chunk->data) - chunk->len;
+ rem = MIN (rem, VTE_MAX_INPUT_READ);
bp = chunk->data + chunk->len;
do {
int ret = read (fd, bp, rem);