| @@ -28,7 +28,7 @@ exportfs(int fd, int msgsz) · 27 unmodified lines |
| 28 | { | 28 | { |
| 29 | char buf[ERRMAX], ebuf[ERRMAX]; | 29 | char buf[ERRMAX], ebuf[ERRMAX]; |
| 30 | Fsrpc *r; | 30 | Fsrpc *r; |
| 31 | int n; | 31 | int i, n; |
| 32 | char *dbfile, *srv, *file; | 32 | char *dbfile, *srv, *file; |
| 33 | ulong initial; | 33 | ulong initial; |
| 34 | | 34 | |
| @@ -85,11 +85,21 @@ exportfs(int fd, int msgsz) · 50 unmodified lines |
| 85 | DEBUG(DFD, "read9p..."); | 85 | DEBUG(DFD, "read9p..."); |
| 86 | n = read9pmsg(netfd, r->buf, messagesize); | 86 | n = read9pmsg(netfd, r->buf, messagesize); |
| 87 | if(n <= 0) | 87 | if(n <= 0) |
| 88 | fatal(nil); | 88 | fatal("eof: n=%d %r", n); |
| 89 | | 89 | |
| 90 | if(convM2S(r->buf, n, &r->work) == 0) | 90 | if(convM2S(r->buf, n, &r->work) == 0){ |
| | 91 | iprint("convM2S %d byte message\n", n); |
| | 92 | for(i=0; i<n; i++){ |
| | 93 | iprint(" %.2ux", r->buf[i]); |
| | 94 | if(i%16 == 15) |
| | 95 | iprint("\n"); |
| | 96 | } |
| | 97 | if(i%16) |
| | 98 | iprint("\n"); |
| 91 | fatal("convM2S format error"); | 99 | fatal("convM2S format error"); |
| | 100 | } |
| 92 | | 101 | |
| | 102 | //iprint("<- %F\n", &r->work); |
| 93 | DEBUG(DFD, "%F\n", &r->work); | 103 | DEBUG(DFD, "%F\n", &r->work); |
| 94 | (fcalls[r->work.type])(r); | 104 | (fcalls[r->work.type])(r); |
| 95 | } | 105 | } |
| @@ -110,6 +120,7 @@ reply(Fcall *r, Fcall *t, char *err) · 14 unmodified lines |
| 110 | else | 120 | else |
| 111 | t->type = r->type + 1; | 121 | t->type = r->type + 1; |
| 112 | | 122 | |
| | 123 | //iprint("-> %F\n", t); |
| 113 | DEBUG(DFD, "\t%F\n", t); | 124 | DEBUG(DFD, "\t%F\n", t); |
| 114 | | 125 | |
| 115 | data = malloc(messagesize); /* not mallocz; no need to clear */ | 126 | data = malloc(messagesize); /* not mallocz; no need to clear */ |
| @@ -117,7 +128,7 @@ reply(Fcall *r, Fcall *t, char *err) · 1 unmodified line |
| 117 | fatal(Enomem); | 128 | fatal(Enomem); |
| 118 | n = convS2M(t, data, messagesize); | 129 | n = convS2M(t, data, messagesize); |
| 119 | if((m=write(netfd, data, n))!=n){ | 130 | if((m=write(netfd, data, n))!=n){ |
| 120 | fprint(2, "wrote %d got %d (%r)\n", n, m); | 131 | iprint("wrote %d got %d (%r)\n", n, m); |
| 121 | fatal("write"); | 132 | fatal("write"); |
| 122 | } | 133 | } |
| 123 | free(data); | 134 | free(data); |