FACT++  1.0
int check_browser_changes ( char *  service,
int  conn_id,
int  subscribe,
int  req,
int  browser,
int  force 
)

Definition at line 789 of file webDid.c.

References create_browser(), find_browser(), find_curr_service(), bitem::isSMI, bitem::last_changed, bitem::last_polled, bitem::last_updated, Memory::malloc(), bitem::n_nodes, N_nodes, bitem::n_servers, N_servers, bitem::n_services, N_services, recv_service_info(), sendData(), bitem::servicep, sitem::size, sll_init(), sprintf(), time, and sitem::timestamp.

790 {
791  CURR_SERVICE *servicep;
792  time_t tsecs;
793  void recv_service_info();
794  extern void sendData();
795  BROWSER *browserp;
796  char answer[256];
797  int service_changed = 0;
798 
799  if(req){}
800  if(subscribe){}
801  if(!(browserp = find_browser(browser)))
802  browserp = create_browser(browser);
803  if(!Curr_service_head)
804  {
807  }
808  if(service[0] != '\0')
809  {
810  if((servicep = find_curr_service(service)))
811  {
812  if(servicep->size)
813  {
814  if((servicep->timestamp > browserp->last_updated) || (force))
815  {
816  service_changed = 1;
817  }
818  }
819  }
820  }
821  if(browserp->isSMI)
822  {
823  if((browserp->last_changed >= browserp->last_polled) || (force))
824  {
825  service_changed = 1;
826  }
827  }
828 /*
829  sprintf(answer,"%d %d %d %d\n",
830  browserp->n_services_changed, browserp->n_servers_changed,
831  browserp->n_nodes_changed, service_changed);
832 */
833  sprintf(answer,"%d %d %d %d %d %d %d\n",
834  N_services, N_servers, N_nodes, service_changed,
835  browserp->n_services, browserp->n_servers, browserp->n_nodes);
836  sendData(conn_id, answer, 4);
837  tsecs = time((time_t *)0);
838  browserp->last_polled = tsecs;
839  return 1;
840 }
int N_servers
Definition: webDid.c:105
int n_services
Definition: webDid.c:70
int N_services
Definition: webDid.c:106
Definition: webDid.c:30
time_t last_changed
Definition: webDid.c:68
void * malloc()
Definition: EventBuilder.cc:99
CURR_SERVICE * Curr_service_head
Definition: webDid.c:46
time_t last_updated
Definition: webDid.c:66
Definition: dim.h:536
int n_servers
Definition: webDid.c:71
BROWSER * find_browser(int id)
Definition: webDid.c:253
void sll_init(SLL *head)
Definition: sll.c:14
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
Definition: smartfact.txt:92
time_t last_polled
Definition: webDid.c:67
BROWSER * create_browser(int id)
Definition: webDid.c:663
CURR_SERVICE * find_curr_service(char *service)
Definition: webDid.c:238
int size
Definition: webDid.c:36
int n_nodes
Definition: webDid.c:72
void sendData(int conn_id, char *buffer, int type)
Definition: webServer.c:240
int isSMI
Definition: webDid.c:81
void recv_service_info(void **tag, int *buffer, int *size)
Definition: webDid.c:870
int N_nodes
Definition: webDid.c:104
time_t timestamp
Definition: webDid.c:37
sprintf(name1,"NewService%d", i)
Definition: webDid.c:61

+ Here is the call graph for this function: