- buf_prepend_uint32(buf,LABEL_MSG9);
- st->current_transform->forwards(st->current_transform->st,
- buf, &transform_err);
- buf_prepend_uint32(buf,LABEL_MSG0);
- buf_prepend_uint32(buf,(uint32_t)st);
- buf_prepend_uint32(buf,st->remote_session_id);
- st->comm->sendmsg(st->comm->st,buf,&st->peer);
+ if (buf->size>0) {
+ buf_prepend_uint32(buf,LABEL_MSG9);
+ st->current_transform->forwards(st->current_transform->st,
+ buf, &transform_err);
+ buf_prepend_uint32(buf,LABEL_MSG0);
+ buf_prepend_uint32(buf,(uint32_t)st);
+ buf_prepend_uint32(buf,st->remote_session_id);
+ st->comm->sendmsg(st->comm->st,buf,&st->peer);
+ }