<sabor> so if absOff=5000k he reads 2000k, then again the same 2000k adn then the remaining 1000k which is again the same ;)
<T`> hmm no
<T`> so lets say absOff = 5k
<T`> you ar3e a moron and u dont start logging until many hours..
<T`> then u start logging.. read(buf, len=2k, offset=0)
<T`> this is the first read..
* sabor . o O ( so much for exploding brains =)
<T`> damn.. u stil here?? ur supposed to have shot urself by now fdamnit
* T` always screwing up my evil plans.. grr
<T`> well.. so the read goes and asks for 2k bytes from offset 0
<T`> we see offset < 5k - (BUFFER_SIZE=2k)
<T`> so we do offset = (absOff - 2k)
<T`> and read from offset 3k to 5k.. and return
<T`> in the first read, i update an open handle's data structure with the latest offset .. 3k
<T`> so when you do next.. 2k read
<T`> you are trying to read... offset: 2k+3k, length: 2k
<T`> so then it will block until you get enough data
<T`> makes sense?
<T`> ReadHandler(ObjHandle* handleData, char* data, uint32 length, uint32 offset) {
<T`> uint32 absOffset = handleData->startOffset + offset;
<T`> Log_GetBufferBlocking(data, &length, &absOffset, TRUE);
<T`> if (!handleData->offsetInit) {
<T`> handleData->startOffset = absOffset;
<T`> handleData->offsetInit = 1;
<T`> }
<T`> Log_GetBufferBlocking will immediately return if there is any data.. and it will overwrite absOffset with latest starting offset of the log buffer