Changeset 212 for Evidence/Evidence.cc


Ignore:
Timestamp:
05/25/10 07:38:03 (14 years ago)
Author:
ogrimm
Message:
Histories from DColl remain available if service is unavailable
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Evidence/Evidence.cc

    r209 r212  
    370370}
    371371
    372 // Requests service history
     372// Requests service history (returns true if data received OK)
    373373bool EvidenceHistory::GetHistory() {
    374374
    375375  DimRpcInfo R((char *) "ServiceHistory", NO_LINK);
    376376  R.setData((char *) Name.c_str());
     377
     378  // Check if data OK
    377379  if (!EvidenceServer::ServiceOK(&R)) return false;
    378 
     380  if (R.getSize() == 0) return false;
     381 
     382  // Copy data to buffer
    379383  delete[] Buffer;
    380384  BufferSize = R.getSize();
     
    382386
    383387  memcpy(Buffer, R.getData(), BufferSize);
    384   Offset = *(int *) Buffer;
     388  Rewind();
    385389 
    386390  return true;
     
    406410  return true;
    407411}
     412
     413// Reset to start of buffer
     414void EvidenceHistory::Rewind() {
     415
     416  if (Buffer != NULL) Offset = *(int *) Buffer;
     417}
Note: See TracChangeset for help on using the changeset viewer.