diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-07-28 19:17:54 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-07-28 19:17:54 +0200 |
commit | b4d2e39d8cfad9fe9585dd6b2382d1261122f22f (patch) | |
tree | a5548e2cc615632c008b358788956abbef071c25 /sys/src/cmd/ndb/dnresolve.c | |
parent | 15c0d4b7c42f973296f372330fefe1c7f08895b4 (diff) |
ndb/cs/dns: make sure never to block the 9p loop when we run out of processes, fail the request instead
Diffstat (limited to 'sys/src/cmd/ndb/dnresolve.c')
-rw-r--r-- | sys/src/cmd/ndb/dnresolve.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/src/cmd/ndb/dnresolve.c b/sys/src/cmd/ndb/dnresolve.c index f5954a992..e99177d7d 100644 --- a/sys/src/cmd/ndb/dnresolve.c +++ b/sys/src/cmd/ndb/dnresolve.c @@ -1603,11 +1603,15 @@ netquery(Query *qp, int depth) return Answnone; slave(qp->req); + /* * slave might have forked. if so, the parent process longjmped to * req->mret; we're usually the child slave, but if there are too - * many children already, we're still the same process. + * many children already, we're still the same process. under no + * circumstances block the 9p loop. */ + if(!qp->req->isslave && strcmp(qp->req->from, "9p") == 0) + return Answnone; /* * don't lock before call to slave so only children can block. @@ -1636,7 +1640,7 @@ netquery(Query *qp, int depth) " dropping this one; no further logging" " of drops", dp->name); } - return 0; + return Answnone; } ++qlp->Ref.ref; qunlock(qlp); |