diff options
author | rsc <devnull@localhost> | 2006-02-03 04:36:50 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-02-03 04:36:50 +0000 |
commit | 9777187bc7259526e1edcdaa1cc5d593616a32a4 (patch) | |
tree | 44e9ac68eeef687fbc317c241250921c9fa83449 /src/cmd/9pserve.c | |
parent | 9cfbc441e736b579cc6d9c4369895a9b5c34a7c0 (diff) | |
download | plan9port-9777187bc7259526e1edcdaa1cc5d593616a32a4.tar.gz plan9port-9777187bc7259526e1edcdaa1cc5d593616a32a4.tar.bz2 plan9port-9777187bc7259526e1edcdaa1cc5d593616a32a4.zip |
fix offsets
Diffstat (limited to 'src/cmd/9pserve.c')
-rw-r--r-- | src/cmd/9pserve.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/cmd/9pserve.c b/src/cmd/9pserve.c index 81e4a653..01a9f86d 100644 --- a/src/cmd/9pserve.c +++ b/src/cmd/9pserve.c @@ -30,6 +30,8 @@ struct Fid int ref; int cfid; int openfd; + int offset; + int coffset; int isdir; Fid *next; }; @@ -475,6 +477,12 @@ connthread(void *arg) continue; } } + if(m->tx.type==Tread && m->fid->isdir && dotu && !c->dotu){ + if(m->tx.offset = m->fid->coffset) + m->tx.offset = m->fid->offset; + else + m->fid->offset = m->fid->coffset; + } break; } @@ -791,8 +799,11 @@ connoutthread(void *arg) fidput(m->newfid); break; case Tread: - if(!err && m->fid->isdir && dotu && !m->c->dotu) + if(!err && m->fid->isdir && dotu && !m->c->dotu){ + m->fid->offset += m->rx.count; stripudirread(m); + m->fid->coffset += m->rx.count; + } break; case Tstat: if(!err && dotu && !m->c->dotu) @@ -961,6 +972,8 @@ fidnew(int cfid) freefid = f->next; f->cfid = cfid; f->ref = 1; + f->offset = 0; + f->coffset = 0; f->isdir = -1; return f; } @@ -1329,13 +1342,16 @@ rewritehdr(Fcall *f, uchar *pkt) restring(pkt, n, f->name); /* fall through */ case Topen: - case Tread: - case Twrite: case Tclunk: case Tremove: case Tstat: case Twstat: + case Twrite: + PBIT32(pkt+7, f->fid); + break; + case Tread: PBIT32(pkt+7, f->fid); + PBIT64(pkt+11, f->offset); break; case Rerror: restring(pkt, n, f->ename); |