mirror of
https://github.com/anope/anope.git
synced 2026-07-02 23:03:12 +02:00
Turn BinarySocket::Write() into a no-op when called with l == 0
This commit is contained in:
+1
-1
@@ -347,7 +347,7 @@ class CoreExport BinarySocket : public virtual Socket
|
||||
|
||||
/** Write data to the socket
|
||||
* @param buffer The data to write
|
||||
* @param l The length of the data
|
||||
* @param l The length of the data; if 0 then this function returns without doing anything
|
||||
*/
|
||||
virtual void Write(const char *buffer, size_t l);
|
||||
void Write(const char *message, ...);
|
||||
|
||||
@@ -167,6 +167,8 @@ bool BinarySocket::ProcessWrite()
|
||||
|
||||
void BinarySocket::Write(const char *buffer, size_t l)
|
||||
{
|
||||
if (l == 0)
|
||||
return;
|
||||
this->write_buffer.push_back(new DataBlock(buffer, l));
|
||||
SocketEngine::Change(this, true, SF_WRITABLE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user