/[pdpsoft]/trunk/grid-mw-security/ees/src/aos/aos.c
ViewVC logotype

Diff of /trunk/grid-mw-security/ees/src/aos/aos.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1746 by aramv, Wed Jun 9 10:25:07 2010 UTC revision 1747 by aramv, Wed Jun 9 12:33:41 2010 UTC
# Line 128  aos_context_t * createContext(aos_contex Line 128  aos_context_t * createContext(aos_contex
128   */   */
129  EES_RC addContext(aos_context_t* context){  EES_RC addContext(aos_context_t* context){
130    aos_state_t* iterator = aos_get_state();    aos_state_t* iterator = aos_get_state();
131    aos_storage_t* storage = iterator->current_storage;    aos_storage_t* storage = iterator->saved_storage;
132    aos_context_t* tmp_context = NULL;    aos_context_t* tmp_context = NULL;
133    
134    EEF_log(LOG_DEBUG, "Adding context at %p to storage at %p\n", context, iterator->current_storage);    EEF_log(LOG_DEBUG, "Adding context at %p to storage at %p\n", context, iterator->current_storage);
   /*printf("Adding context at %p to storage at %p\n", context, storage);*/  
135    if(!storage){    if(!storage){
136      EEF_log(LOG_ERR, "No storage available at %p", storage);      EEF_log(LOG_ERR, "No storage available at %p", storage);
137      return EES_FAILURE;      return EES_FAILURE;
# Line 204  aos_context_t* aos_get_iterator(void){ Line 203  aos_context_t* aos_get_iterator(void){
203  }  }
204    
205  /**  /**
206   * returns the next aos_context_t pointer with the supplied context_class from the list of contexts in the supplied storage   * returns the next aos_context_t pointer with the supplied context_class from the list of contexts in the supplied storage.
207     * will fall through and try to use global storage in case nothing was found
208   */   */
209  aos_context_t * getNextContext(aos_context_class_t context_class, aos_storage_t* storage){  aos_context_t * getNextContext(aos_context_class_t context_class, aos_storage_t* storage){
210    aos_state_t*    state           = aos_get_state();    aos_state_t*    state           = aos_get_state();
# Line 221  aos_context_t * getNextContext(aos_conte Line 221  aos_context_t * getNextContext(aos_conte
221      }      }
222    }    }
223    
   /* TODO -reliably- reset storage to saved pointer */  
   
   
224    /* save state */    /* save state */
225    if((current_context == NULL) && (storage != _global_state->current_storage) && (state->current_storage != _global_state->current_storage)){    if((current_context == NULL) && (storage != _global_state->current_storage) && (state->current_storage != _global_state->current_storage)){
226      /* Retry with global storage */      /* Retry with global storage */
     /*state->current_storage = _global_state->current_storage;*/  
     /*rewindContexts(_global_state->current_storage);*/  
     /*state->saved_storage = state->current_storage;*/  
227      state->current_storage = _global_state->current_storage;      state->current_storage = _global_state->current_storage;
228      aos_set_iterator(_global_state->current_storage->list_contexts);      aos_set_iterator(_global_state->current_storage->list_contexts);
     /*rewindContexts(_global_state->current_storage);*/  
229      current_context = getNextContext(context_class, _global_state->current_storage);      current_context = getNextContext(context_class, _global_state->current_storage);
     /*printf("Should really return %p haha\n", current_context);*/  
230    }    }
231    
232      /* save iterator */
233    if(current_context){    if(current_context){
234      aos_set_iterator(current_context->next);      aos_set_iterator(current_context->next);
235    } else {    } else {
236      aos_set_iterator(NULL);      aos_set_iterator(NULL);
237    }    }
238    
   /*if(current_context == NULL){*/  
   /*if((storage == _global_state->current_storage) && (state->current_storage == _global_state->current_storage)){*/  
   /*if(state->saved_storage){*/  
   /*printf("Reset state\n");*/  
   /*state->current_storage = state->saved_storage;*/  
   /*state->last_context = NULL;*/  
   /*}*/  
   
   /*}*/  
   /*}*/  
   
   
239    return current_context;    return current_context;
240  }  }
241    

Legend:
Removed from v.1746  
changed lines
  Added in v.1747

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28