Modify FPRead requests so they don’t return more data than will fit in the reply buffer.

This issue arises because ASP requests and replies are limited to a “quantum size” of 4624 bytes even if the amount requested is larger, and the AppleShare FST relies on this behavior in sizing its buffers. DSI does not have this limitation, so it was returning more data than would fit in the buffer.

Also improve error checking, so an error is reported in cases where the buffer is too small.
This commit is contained in:
Stephen Heumann
2017-04-03 16:36:50 -05:00
parent 17421e0ba5
commit 3f40a3190d
3 changed files with 51 additions and 10 deletions

7
dsi.c
View File

@@ -142,12 +142,11 @@ top:
// Maybe we should do something with them?
FinishASPCommand(sess);
} else {
sess->spCommandRec->result = aspSizeErr;
CompleteASPCommand(sess, aspBufErr);
}
} else {
FinishASPCommand(sess);
}
// TODO correct logic for all cases
FinishASPCommand(sess);
return;
}
//Handle a request from the server