| 1324 | } |
| 1325 | |
| 1326 | void readFromBuffer(StringBuffer* result, int* bytes) { |
| 1327 | // extract up to bytes from readBufPage into result |
| 1328 | int len = std::min(readBufPage->payloadSize - readBufPos, *bytes); |
| 1329 | if (len <= 0) |
| 1330 | return; |
| 1331 | |
| 1332 | result->append(StringRef(readBufPage->payload + readBufPos, len)); |
| 1333 | |
| 1334 | readBufPos += len; |
| 1335 | *bytes -= len; |
| 1336 | nextReadLocation += len; |
| 1337 | } |
| 1338 | |
| 1339 | ACTOR static Future<Standalone<StringRef>> readNext(DiskQueue* self, int bytes) { |
| 1340 | state StringBuffer result(self->dbgid); |