chiark / gitweb /
only autoflush if the message ends with \n
[trains.git] / hostside / obc.c
index 33ab3f26b453ade0203c75020028309e2fd3d865..853489055b36229a7b9a39e88114e1679444f059 100644 (file)
@@ -63,7 +63,8 @@ static void addlink(OutBufferChain *ch, OutBuffer *ob) {
     events->on_fd(events, ch->fd, OOP_WRITE, writeable, ch);
   LIST_LINK_TAIL(ch->obs, ob);
   ch->total += ob->l;
-  obc_tryflush(ch);
+  if (ob->l>0 && ob->m[ob->l-1]=='\n')
+    obc_tryflush(ch);
   if (ch->total > ch->limit) {
     char what[128];
     snprintf(what,sizeof(what)-1,"`%.*s...'", ob->l,ob->m);