entry->in.done += len;
}
- this->inbound(this->user, entry->id, entry->in.buf);
- chunk_clear(&entry->in.buf);
- entry->in.hdrlen = entry->in.done = 0;
-
return TRUE;
}
CALLBACK(on_read, bool,
entry_t *entry, stream_t *stream)
{
+ chunk_t data = chunk_empty;
bool ret;
entry->mutex->lock(entry->mutex);
{
disconnect(entry->this, entry->id);
}
+ if (entry->in.buf.len == entry->in.done)
+ {
+ data = entry->in.buf;
+ entry->in.buf = chunk_empty;
+ entry->in.hdrlen = entry->in.done = 0;
+ }
entry->mutex->unlock(entry->mutex);
+ if (data.len)
+ {
+ entry->this->inbound(entry->this->user, entry->id, data);
+ chunk_clear(&data);
+ }
+
return ret;
}