FACT++  1.0
void leaveCommandHandler ( unsigned int  id,
short  errorCode,
unsigned int  msgType,
char *  message 
)

Definition at line 1344 of file feeserver.c.

References createHeader(), createLogMessage(), dis_update_service, and Memory::free().

Referenced by command_handler().

1345  {
1346  int status = -1;
1347 
1348 # ifdef __DEBUG
1349  printf("%s\n", message);
1350  fflush(stdout);
1351 # endif
1352 
1353  createLogMessage(msgType, message, 0);
1354 
1355  // tell client that command is ignored
1356  if (cmndACK != 0) {
1357  free(cmndACK);
1358  cmndACK = 0;
1359  }
1360  // send error code
1361  cmndACK = createHeader(id, errorCode, false, false, 0);
1362  cmndACKSize = HEADER_SIZE;
1364 
1365  // unlock command mutex to "free" commandHandler
1366  status = pthread_mutex_unlock(&command_mut);
1367  if (status != 0) {
1368 # ifdef __DEBUG
1369  printf("Lock command mutex error: %d\n", status);
1370  fflush(stdout);
1371 # endif
1372  createLogMessage(MSG_WARNING,
1373  "Error while trying to unlock command mutex.", 0);
1374  }
1375 }
static MessageStruct message
Definition: feeserver.c:101
char * createHeader(unsigned int id, short errorCode, bool huffmanFlag, bool checksumFlag, int checksum)
Definition: feeserver.c:2315
static unsigned int serviceACKID
Definition: feeserver.c:153
void createLogMessage(unsigned int type, char *description, char *origin)
Definition: feeserver.c:1530
static pthread_mutex_t command_mut
Definition: feeserver.c:266
#define dis_update_service
Definition: dis.h:18
static char * cmndACK
Definition: feeserver.c:171
void free(void *mem)
static int cmndACKSize
Definition: feeserver.c:177

+ Here is the call graph for this function:

+ Here is the caller graph for this function: