aboutsummaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-08-12 23:20:46 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-08-12 23:20:46 +0200
commitce83f8244c6094e62d18946f80b4ad9f3ea93c02 (patch)
tree81852b530baa5f3357d0a8b358cecf422a52cd3a /degesch.c
parent8a8ff11887e37349397ec1851e2483b60083c58d (diff)
downloadxK-ce83f8244c6094e62d18946f80b4ad9f3ea93c02.tar.gz
xK-ce83f8244c6094e62d18946f80b4ad9f3ea93c02.tar.xz
xK-ce83f8244c6094e62d18946f80b4ad9f3ea93c02.zip
degesch: don't ignore data right before an EOF
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/degesch.c b/degesch.c
index 442659b..69e15bd 100644
--- a/degesch.c
+++ b/degesch.c
@@ -3966,18 +3966,15 @@ static enum transport_io_result
irc_try_read (struct server *s)
{
enum transport_io_result result = s->transport->try_read (s);
- if (result == TRANSPORT_IO_OK)
+ if (s->read_buffer.len >= (1 << 20))
{
- if (s->read_buffer.len >= (1 << 20))
- {
- // XXX: this is stupid; if anything, count it in dependence of time
- log_server_error (s, s->buffer,
- "The IRC server seems to spew out data frantically");
- return TRANSPORT_IO_ERROR;
- }
- if (s->read_buffer.len)
- irc_process_buffer (&s->read_buffer, irc_process_message, s);
+ // XXX: this is stupid; if anything, count it in dependence of time
+ log_server_error (s, s->buffer,
+ "The IRC server seems to spew out data frantically");
+ return TRANSPORT_IO_ERROR;
}
+ if (s->read_buffer.len)
+ irc_process_buffer (&s->read_buffer, irc_process_message, s);
return result;
}