remote_pool.c
changeset 13 ee426f453cf5
parent 9 fb6632e6c1bb
child 26 6d615203d963
equal deleted inserted replaced
12:43297144f196 13:ee426f453cf5
    99     for (i = 0; i < REMOTE_POOL_MAX; i++) {
    99     for (i = 0; i < REMOTE_POOL_MAX; i++) {
   100         if (pool_info->nodes[i].valid && (node_info == NULL || pool_info->nodes[i].current_load < node_info->current_load)) {
   100         if (pool_info->nodes[i].valid && (node_info == NULL || pool_info->nodes[i].current_load < node_info->current_load)) {
   101             node_info = &pool_info->nodes[i];
   101             node_info = &pool_info->nodes[i];
   102         }
   102         }
   103     }
   103     }
       
   104     
       
   105     if (node_info) {
       
   106         // add one to its load, because that's probably correct, and works if we pick multiple nodes from the pool at the same time
       
   107         node_info->current_load++;
       
   108     }
   104 
   109 
   105     // either NULL or the right remote_info
   110     // either NULL or the right remote_info
   106     return node_info;
   111     return node_info;
   107 }
   112 }
   108 
   113