Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ServerQuorumDispatcher.cc

00001 /*
00002  * Copyright 2003 Michael A. Marsh, Cornell University. All rights reserved.
00003  * This software is released under the modified BSD license.
00004  * See the file LICENSE in the top-level directory for details.
00005  */
00006 //
00007 // $Id: ServerQuorumDispatcher.cc,v 1.3 2004/05/19 15:56:58 mmarsh Exp $
00008 //
00009 // $Log: ServerQuorumDispatcher.cc,v $
00010 // Revision 1.3  2004/05/19 15:56:58  mmarsh
00011 // *** empty log message ***
00012 //
00013 // Revision 1.2  2003/11/04 22:31:51  mmarsh
00014 // *** empty log message ***
00015 //
00016 //
00017 
00018 #include "ServerQuorumDispatcher.h"
00019 #include "ServerState.h"
00020 #include "CODEX_Events/Event.h"
00021 
00022 using namespace CODEX_Server;
00023 
00024 void
00025 ServerQuorumDispatcher::operator()( const void* request,
00026                                     CODEX_Quorum::ResponseInfo* ri )
00027 {
00028    unsigned char* seqNum = (unsigned char*) request;
00029 
00030    if ( NULL == ri )
00031    {
00032       if ( NULL != seqNum ) delete [] seqNum;
00033       return;
00034    }
00035 
00036    if ( NULL == request )
00037    {
00038       delete ri;
00039       return;
00040    }
00041 
00042    // Did the request succeed or fail?
00043    unsigned int nFail = ri->failures();
00044 
00045    if ( nFail > ServerState::nFaults )
00046    {
00047       // The request must have been bad.
00048       ri->fail();
00049    }
00050 
00051    // No special actions are required for a successful request, since
00052    // the callback will have handled it.
00053    delete [] seqNum;
00054    delete ri;
00055 }

Generated on Fri May 6 17:41:14 2005 for COrnell Data EXchange (CODEX) by  doxygen 1.4.1