diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-15 12:59:45 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-15 12:59:45 +0000 |
commit | bcc3e538236fdccc784f4d37449028315fbbc2f8 (patch) | |
tree | a2f705ad3842cce00a48a3106112bd836606d3fd /src/modules/m_spanningtree.cpp | |
parent | a344c8a50792b385b2cf86c18a484e23433f5c1b (diff) |
Made InspSocket::Read return an empty but non-NULL string when it receives EAGAIN (this method didnt know how to cope with EAGAIN before, may be causing random splits?)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2792 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r-- | src/modules/m_spanningtree.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 8071f8828..292c92756 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1246,7 +1246,8 @@ class TreeSocket : public InspSocket virtual bool OnDataReady() { char* data = this->Read(); - if (data) + /* Check that the data read is a valid pointer and it has some content */ + if (data && *data) { this->in_buffer += data; /* While there is at least one new line in the buffer, @@ -1295,6 +1296,9 @@ class TreeSocket : public InspSocket } } } + /* EAGAIN returns an empty but non-NULL string, so this + * evaluates to TRUE for EAGAIN but to FALSE for EOF. + */ return (data != NULL); } |