FACT++  1.0
void recv_service_info ( void **  tag,
int *  buffer,
int *  size 
)

Definition at line 870 of file webDid.c.

References sitem::buffer, sitem::buffer_size, sitem::buffer_str, sitem::buffer_str_size, sitem::conn_id, bitem::conn_id, Curr_service_name, Memory::free(), get_curr_service_format(), sitem::last_updated, Memory::malloc(), sitem::name, print_service_formatted(), sendData(), Service_content_str, bitem::servicep, size, sitem::size, sprintf(), and time.

Referenced by check_browser_changes(), find_services(), and update_service_data().

871 {
872  int conn_id;
874  extern void sendData();
875  CURR_SERVICE *servicep;
876  time_t tsecs;
877 
878  servicep = *tag;
879  conn_id = servicep->conn_id;
880  if (servicep->buffer_size < *size)
881  {
882  if(servicep->buffer_size)
883  free(servicep->buffer);
884  servicep->buffer = malloc((size_t)*size);
885  servicep->buffer_size = *size;
886  }
887  memcpy(servicep->buffer, (char *)buffer, (size_t)*size);
888  servicep->size = *size;
889  if (servicep->buffer_str_size < (1024 + (*size)*16))
890  {
891  if(servicep->buffer_str_size)
892  free(servicep->buffer_str);
893  servicep->buffer_str = malloc((size_t)(1024 + (*size)*16));
894  servicep->buffer_str_size = 1024 + (*size)*16;
895  }
896  Service_content_str = servicep->buffer_str;
897  strcpy(Curr_service_name, servicep->name);
899  if((*size == 4 ) && (*buffer == -1))
900  {
902  "Service %s Not Available", Curr_service_name);
903  }
904  else
905  {
906  print_service_formatted(servicep, buffer, *size);
907  }
908  if(servicep->last_updated == 0)
909  {
910  sendData(conn_id, Service_content_str, 4);
911  tsecs = time((time_t *)0);
912  servicep->last_updated = tsecs;
913  }
914 }
Definition: webDid.c:30
void * buffer_str
Definition: webDid.c:38
void * malloc()
Definition: EventBuilder.cc:99
char Curr_service_name[132]
Definition: webDid.c:101
void get_curr_service_format()
Definition: webDid.c:516
time_t last_updated
Definition: webDid.c:43
char name[MAX_NAME]
Definition: webDid.c:32
void * buffer
Definition: webDid.c:34
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
Definition: smartfact.txt:92
int buffer[BUFFSIZE]
Definition: db_dim_client.c:14
int size
Definition: db_dim_server.c:17
int size
Definition: webDid.c:36
void free(void *mem)
int buffer_str_size
Definition: webDid.c:39
void sendData(int conn_id, char *buffer, int type)
Definition: webServer.c:240
int buffer_size
Definition: webDid.c:35
sprintf(name1,"NewService%d", i)
void print_service_formatted(CURR_SERVICE *servicep, void *buff, int size)
Definition: webDid.c:916
char * Service_content_str
Definition: webDid.c:112
int conn_id
Definition: webDid.c:41

+ Here is the call graph for this function:

+ Here is the caller graph for this function: