commit - eb9be70308f0397b13312e2472d7764d481e5a73
commit + 39e5957ace14f1dcff62014fd26f368e87c79c29
blob - c8ca46e5c1482df6fa02829ae956d2e01fab0494
blob + ec02c81f4509a3f359b893888f5aa07c52c072ce
--- src/lib9p/srv.c
+++ src/lib9p/srv.c
srv = r->srv;
assert(srv != nil);
+ if(r->responded){
+ assert(r->pool);
+ goto free;
+ }
+
assert(r->responded == 0);
r->error = error;
sysfatal("lib9p srv: write %d returned %d on fd %d: %r", n, m, srv->outfd);
qunlock(&srv->wlock);
+free:
qlock(&r->lk); /* no one will add flushes now */
r->responded = 1;
- qunlock(&r->lk);
-
+
for(i=0; i<r->nflush; i++)
respond(r->flush[i], nil);
free(r->flush);
+ r->nflush = 0;
+ r->flush = nil;
+ qunlock(&r->lk);
if(r->pool)
closereq(r);
blob - 17588a95e8c6ce231d86b7adf10180eff145da64
blob + 5b76f73adc7e1a647e8abc9b31ed54d60f74580a
--- src/lib9p/util.c
+++ src/lib9p/util.c
void
readstr(Req *r, char *s)
{
- readbuf(r, s, strlen(s));
+ if(s == nil)
+ r->ofcall.count = 0;
+ else
+ readbuf(r, s, strlen(s));
}