lib9p: add Srv.start
This commit is contained in:
parent
d9f65faf71
commit
9c844d90e1
3 changed files with 10 additions and 0 deletions
|
@ -195,6 +195,7 @@ struct Srv {
|
||||||
Tree* tree;
|
Tree* tree;
|
||||||
void (*destroyfid)(Fid*);
|
void (*destroyfid)(Fid*);
|
||||||
void (*destroyreq)(Req*);
|
void (*destroyreq)(Req*);
|
||||||
|
void (*start)(Srv*);
|
||||||
void (*end)(Srv*);
|
void (*end)(Srv*);
|
||||||
void* aux;
|
void* aux;
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ typedef struct Srv {
|
||||||
|
|
||||||
void (*destroyfid)(Fid *fid);
|
void (*destroyfid)(Fid *fid);
|
||||||
void (*destroyreq)(Req *r);
|
void (*destroyreq)(Req *r);
|
||||||
|
void (*start)(Srv *s);
|
||||||
void (*end)(Srv *s);
|
void (*end)(Srv *s);
|
||||||
void* aux;
|
void* aux;
|
||||||
|
|
||||||
|
@ -721,6 +722,7 @@ has been sent.
|
||||||
.PP
|
.PP
|
||||||
.IR Destroyfid ,
|
.IR Destroyfid ,
|
||||||
.IR destroyreq ,
|
.IR destroyreq ,
|
||||||
|
.IR start ,
|
||||||
and
|
and
|
||||||
.I end
|
.I end
|
||||||
are auxiliary functions, not called in direct response to 9P requests.
|
are auxiliary functions, not called in direct response to 9P requests.
|
||||||
|
@ -751,6 +753,10 @@ is called to allow the program to dispose of the
|
||||||
.IB r -> aux
|
.IB r -> aux
|
||||||
pointer.
|
pointer.
|
||||||
.TP
|
.TP
|
||||||
|
.I Start
|
||||||
|
This gets called (from the forked service process)
|
||||||
|
prior entering the 9P service loop.
|
||||||
|
.TP
|
||||||
.I End
|
.I End
|
||||||
Once the 9P service loop has finished
|
Once the 9P service loop has finished
|
||||||
(end of file been reached on the service pipe
|
(end of file been reached on the service pipe
|
||||||
|
|
|
@ -765,6 +765,9 @@ srv(Srv *srv)
|
||||||
srv->fpool->srv = srv;
|
srv->fpool->srv = srv;
|
||||||
srv->rpool->srv = srv;
|
srv->rpool->srv = srv;
|
||||||
|
|
||||||
|
if(srv->start)
|
||||||
|
srv->start(srv);
|
||||||
|
|
||||||
srvwork(srv);
|
srvwork(srv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue