diff options
Diffstat (limited to 'src/libsunrpc/server.c')
-rw-r--r-- | src/libsunrpc/server.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libsunrpc/server.c b/src/libsunrpc/server.c index 8b45b44c..81358587 100644 --- a/src/libsunrpc/server.c +++ b/src/libsunrpc/server.c @@ -1,5 +1,6 @@ #include <u.h> #include <libc.h> +#include <ip.h> #include <thread.h> #include <sunrpc.h> @@ -79,6 +80,7 @@ sunsrvthreadcreate(SunSrv *srv, void (*fn)(void*), void *arg) static void sunrpcrequestthread(void *v) { + int status; uchar *p, *ep; Channel *c; SunSrv *srv = v; @@ -93,6 +95,7 @@ if(srv->chatty) fprint(2, "sun msg %p count %d\n", m, m->count); m->srv = srv; p = m->data; ep = p+m->count; + status = m->rpc.status; if(sunrpcunpack(p, ep, &p, &m->rpc) != SunSuccess){ fprint(2, "in: %.*H unpack failed\n", m->count, m->data); sunmsgdrop(m); @@ -100,7 +103,10 @@ if(srv->chatty) fprint(2, "sun msg %p count %d\n", m, m->count); } if(srv->chatty) fprint(2, "in: %B\n", &m->rpc); - + if(status){ + sunmsgreplyerror(m, status); + continue; + } if(srv->alwaysreject){ if(srv->chatty) fprint(2, "\trejecting\n"); |