FACT++  1.0
int setIssueTimeout ( IssueStruct *  issueParam)

Definition at line 2662 of file feeserver.c.

References createLogMessage(), and sprintf().

Referenced by command_handler().

2662  {
2663  char msg[70];
2664  unsigned long newTimeout;
2665 
2666  if ((*issueParam).size < sizeof(unsigned long)) {
2667  (*issueParam).size = 0;
2668  createLogMessage(MSG_DEBUG,
2669  "FeeServer command for setting issue timeout contained invalid parameter.",
2670  0);
2671  return FEE_INVALID_PARAM;
2672  }
2673  memcpy(&newTimeout, (*issueParam).command, sizeof(unsigned long));
2674 
2675  // check new timeout for possible buffer overflow (value will be multiplied
2676  // with 1000 later -> has to lower than 4294967 )
2677  if (newTimeout > MAX_ISSUE_TIMEOUT) {
2678  (*issueParam).size = 0;
2679  createLogMessage(MSG_WARNING,
2680  "New timeout for issue watchdog exceeded value limit (4294967).",
2681  0);
2682  return FEE_INVALID_PARAM;
2683  }
2684 
2685  issueTimeout = newTimeout;
2686 # ifdef __DEBUG
2687  printf("set new Issue timeout to %lu\n", issueTimeout);
2688  fflush(stdout);
2689 # endif
2690  msg[sprintf(msg, "Watch dog time out is set to %lu.", issueTimeout)] = 0;
2691  createLogMessage(MSG_INFO, msg, 0);
2692 
2693  (*issueParam).size = 0;
2694  return FEE_OK;
2695 }
void createLogMessage(unsigned int type, char *description, char *origin)
Definition: feeserver.c:1530
static unsigned long issueTimeout
Definition: feeserver.c:203
sprintf(name1,"NewService%d", i)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: