Task #118

communication.c: work on recv_computer_pools()

Added by Andreas Schröder over 7 years ago.

Status:NewStart date:06/02/2010
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:all
Target version:0.64.5

Description

memset (&limits,0,sizeof(struct computer_limits));
  computer_pool_init (&limits);
  datasize = sizeof(struct pool);
  for (i=0;i<npools;i++) {
    if (!check_recv_datasize(sfd,datasize)) {
      log_auto (L_ERROR,"recv_computer_pools(): different pools (struct pool) size. Local size: %u",datasize);
      return 0;
    }
    memset(&pool,0,sizeof(struct pool));
    if (!dr_read(sfd,(char*)&pool,datasize)) {
      log_auto (L_ERROR,"recv_computer_pools() : could not read pool from file or socket (pool number: %i). Msg: %s",
        i,strerror(drerrno_system));
      // FIXME: if we return, old data is still there.
      return 0;
    }
    log_auto (L_DEBUG3,"recv_computer_pools(): received pool name='%s'. Attempting to add...",pool.name);
    computer_pool_add (&limits,pool.name);
  }

Also available in: Atom PDF