Changeset 222 for Evidence/Evidence.cc


Ignore:
Timestamp:
06/08/10 13:14:10 (14 years ago)
Author:
ogrimm
Message:
History buffer contains also DIM service format
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Evidence/Evidence.cc

    r221 r222  
    388388
    389389  memcpy(Buffer, R.getData(), BufferSize);
     390  DataStart = Buffer + strlen(Buffer) + 1;
    390391  Rewind();
    391392 
     
    399400
    400401  // Check for wrap around
    401   if (memcmp(Pointer, &WrapMark, sizeof(WrapMark)) == 0) Pointer = (struct Item *) (Buffer + 4);
    402  
     402  if (memcmp(Pointer, &WrapMark, sizeof(WrapMark)) == 0) Pointer = (struct Item *) (DataStart + sizeof(int));
    403403  // Check if at end of ring buffer
    404404  if (memcmp(Pointer, &EndMark, sizeof(EndMark)) == 0) return NULL;
    405405
    406406  const struct Item *Ret = Pointer;
    407   Pointer = (struct Item *) ((char *) (Pointer + 1) + Pointer->Size);
     407  Pointer = (struct Item *) ((char *) (Ret + 1) + Ret->Size);
    408408
    409409  return Ret;
     
    413413void EvidenceHistory::Rewind() {
    414414
    415   if (Buffer != NULL) Pointer = (struct Item *) (Buffer + (*(int *) Buffer));
    416 }
     415  if (Buffer != NULL) Pointer = (struct Item *) (DataStart + (*(int *) DataStart));
     416}
     417
     418// Return DIM format string of service (NULL if no data)
     419char *EvidenceHistory::GetFormat() {
     420
     421  return Buffer;
     422}
Note: See TracChangeset for help on using the changeset viewer.