- /* Call stream callback */
- if (s->stream && s->stream->notifier)
- s->stream->notifier(s->stream, SILC_STREAM_CAN_READ,
- s->stream->notifier_context);
+ if (inbuf_len) {
+ inbuf_ptr = inbuf.Ptr();
+ while (inbuf_ptr) {
+ /* Call stream callback until all has been read */
+ if (s->stream && s->stream->notifier)
+ s->stream->notifier(s->stream, SILC_STREAM_CAN_READ,
+ s->stream->notifier_context);
+ }
+ }