Do not write empty rock I/O buffer to disk.
Added more comments and polished.
const SlotId sidNext = reserveSlotForWriting(); // throws
assert(sidNext >= 0);
writeToDisk(sidNext);
+ } else if (Config.onoff.collapsed_forwarding) {
+ // write partial buffer for all collapsed hit readers to see
+ // XXX: can we check that this is needed w/o stalling readers
+ // that appear right after our check?
+ writeBufToDisk(false);
}
}
- // XXX: check that there are workers waiting for data, i.e. readers > 0
- writeBufToDisk();
}
/// Buffers incoming data for the current slot.
sidCurrent = sidNext;
}
+/// Write header-less (XXX) or complete buffer to disk.
void
Rock::IoState::writeBufToDisk(const bool last)
{
void tryWrite(char const *buf, size_t size, off_t offset);
size_t writeToBuffer(char const *buf, size_t size);
void writeToDisk(const SlotId nextSlot);
- void writeBufToDisk(const bool last = false);
+ void writeBufToDisk(const bool last);
SlotId reserveSlotForWriting();
void callBack(int errflag);
return;
}
- // XXX: check that there are workers waiting for data, i.e. readers > 0
- CollapsedForwarding::NewData(sio);
+ // XXX: can we check that this is needed w/o stalling readers
+ // that appear right after our check?
+ if (Config.onoff.collapsed_forwarding)
+ CollapsedForwarding::NewData(sio);
if (errflag == DISK_OK) {
// do not increment sio.offset_ because we do it in sio->write()
typedef enum { mtNone = 0, mtRegistration,
mtStrandSearchRequest, mtStrandSearchResponse,
mtSharedListenRequest, mtSharedListenResponse,
- mtIpcIoNotification, mtCollapsedForwardingNotification,
+ mtIpcIoNotification,
+ mtCollapsedForwardingNotification,
mtCacheMgrRequest, mtCacheMgrResponse
#if SQUID_SNMP
,