Skip to content

Commit

Permalink
blah
Browse files Browse the repository at this point in the history
  • Loading branch information
Linux User committed Jun 4, 2020
1 parent 3f3c1cc commit 29f2aaf
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions NinePea.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "NinePea.h"

int MAX_MSG = 8192;
int MAX_IO = 8171;
int MAX_MSG = 4096 + 17;
int MAX_IO = 4096;

struct htable *fs_fids;

Expand Down Expand Up @@ -80,7 +80,7 @@ getstat(unsigned char *buffer, unsigned long index, Stat *stat) {

get2(buffer, index, stat->type);
get4(buffer, index, stat->dev);
buffer[index++] = stat->qid.type;
stat->qid.type = buffer[index++];
get4(buffer, index, stat->qid.version);
get8(buffer, index, stat->qid.path, tmp);
get4(buffer, index, stat->mode);
Expand Down Expand Up @@ -146,8 +146,8 @@ proc9p(unsigned char *msg, unsigned long size, Callbacks *cb) {
get4(msg, i, ifcall.msize);
get2(msg, i, slen);

MAX_MSG = ifcall.msize;
MAX_IO = MAX_MSG - 19;
if (ifcall.msize > MAX_MSG)
ifcall.msize = MAX_MSG;

put4(msg, index, ifcall.msize);
put2(msg, index, slen);
Expand Down Expand Up @@ -377,23 +377,25 @@ proc9p(unsigned char *msg, unsigned long size, Callbacks *cb) {

break;
case TWStat:
#if 0
get4(msg, index, ifcall.fid);
index = getstat(msg, index, &ifcall.stat);
get2(msg, index, slen);
index = getstat(msg, index, &ifcall.st);

ofcall = cb->wstat(&ifcall);

free (ifcall.stat.name);
free (ifcall.stat.uid);
free (ifcall.stat.gid);
free (ifcall.stat.muid);
free (ifcall.st.name);
free (ifcall.st.uid);
free (ifcall.st.gid);
free (ifcall.st.muid);

if (ofcall->type == RError)
if (ofcall->type == RError) {
index = mkerr(msg, ifcall.tag, ofcall->ename);
else
index = puthdr(msg, 0, RWStat, ifcall.tag, 7);

break;
}

index = puthdr(msg, 0, RWStat, ifcall.tag, 7);
break;
#endif
default:
index = mkerr(msg, ifcall.tag, Ebadtype);
break;
Expand Down

0 comments on commit 29f2aaf

Please sign in to comment.