diff options
| author | Charles.Forsyth <devnull@localhost> | 2009-02-22 17:35:59 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2009-02-22 17:35:59 +0000 |
| commit | dfd0a9e218df69a25d416c09bf3bdc9f37b352ca (patch) | |
| tree | 44ba3b7361265466d0ff4c7cfba50c20796b2e4f | |
| parent | c50a7643253d144ca8f7fb77ec3eb25144ab48a0 (diff) | |
20090222-1735
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | appl/cmd/ndb/registry.b | 35 | ||||
| -rw-r--r-- | dis/ndb/registry.dis | bin | 9269 -> 9615 bytes | |||
| -rw-r--r-- | include/version.h | 2 |
4 files changed, 33 insertions, 6 deletions
@@ -1,3 +1,5 @@ +20090222 + appl/cmd/ndb/registry.b and dis/registry.dis - implement flush for event file (issue 162) 20090217 appl/cmd/limbo/stubs.b limbo/stubs.c - include length parameter to builtinmod (could just be 0 in most cases) change f->ret/destroy code in stubs.c/stubs.b to destroy correctly in case of exceptions diff --git a/appl/cmd/ndb/registry.b b/appl/cmd/ndb/registry.b index 540c556b..15e55622 100644 --- a/appl/cmd/ndb/registry.b +++ b/appl/cmd/ndb/registry.b @@ -92,6 +92,7 @@ Event: adt { remove: fn(e: self ref Event); queue: fn(e: self ref Event, m: ref Tmsg.Read): string; post: fn(vers: int); + flush: fn(tag: int); }; filters: list of ref Filter; @@ -214,6 +215,9 @@ Serve: err = remove(fid); if(err == nil) srv.reply(ref Rmsg.Remove(m.tag)); + Flush => + Event.flush(m.oldtag); + srv.default(gm); * => srv.default(gm); } @@ -374,7 +378,8 @@ svcnameok(s: string): string "new" or "event" or "find" or - "index" => + "index" or + "" => return "bad service name"; } for(i = 0; i < nservices; i++) @@ -460,16 +465,25 @@ navigator(navops: chan of ref Navop) d[1] = Qindex; d[2] = Qfind; d[3] = Qevent; + nd := 0; for(i := 0; i < nservices; i++) - if(services[i].name != nil) - d[i + Nstatic] = (services[i].id<<Shift) | Qsvc; + if(services[i].name != nil){ + d[nd + Nstatic] = (services[i].id<<Shift) | Qsvc; + nd++; + } + d = d[0:Nstatic + nd]; } if(d == nil){ n.reply <-= (nil, Enotdir); break; } - for(i := n.offset; i < len d; i++) - n.reply <-= dirgen(d[i]); + for(i := n.offset; i < len d; i++){ + (dir, err) := dirgen(d[i]); + if(dir == nil) + sys->fprint(sys->fildes(2), "registry: bad qid %#ux: %s\n", d[i], err); + else + n.reply <-= (dir, err); + } n.reply <-= (nil, nil); } } @@ -696,6 +710,17 @@ Event.post(vers: int) } } +Event.flush(tag: int) +{ + for(l := events; l != nil; l = tl l){ + e := hd l; + if(e.m != nil && e.m.tag == tag){ + e.m = nil; + break; + } + } +} + dbload(db: ref Db) { ptr: ref Attrdb->Dbptr; diff --git a/dis/ndb/registry.dis b/dis/ndb/registry.dis Binary files differindex 03671018..321450ac 100644 --- a/dis/ndb/registry.dis +++ b/dis/ndb/registry.dis diff --git a/include/version.h b/include/version.h index bbb59e2b..9a3859ec 100644 --- a/include/version.h +++ b/include/version.h @@ -1 +1 @@ -#define VERSION "Fourth Edition (20090219)" +#define VERSION "Fourth Edition (20090222)" |
