Changeset 4608

Show
Ignore:
Timestamp:
11/10/08 17:43:15 (2 months ago)
Author:
martin
Message:

make load_tester more strict to use it along stroke

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/charon/plugins/load_tester/load_tester_config.c

    r4568 r4608  
    6363 * implements backend_t.get_peer_cfg_by_name. 
    6464 */ 
    65 static peer_cfg_t *get_peer_cfg_by_name(private_load_tester_config_t *this, char *name) 
     65static peer_cfg_t *get_peer_cfg_by_name(private_load_tester_config_t *this, 
     66                                        char *name) 
    6667{ 
    67     return this->peer_cfg->get_ref(this->peer_cfg);; 
     68    if (streq(name, "load-test")) 
     69    { 
     70        return this->peer_cfg->get_ref(this->peer_cfg);; 
     71    } 
     72    return NULL; 
    6873} 
    6974 
  • trunk/src/charon/plugins/load_tester/load_tester_creds.c

    r4604 r4608  
    158158                            key_type_t type, identification_t *id) 
    159159{ 
     160    if (this->private == NULL) 
     161    { 
     162        return NULL; 
     163    } 
    160164    if (type != KEY_ANY && type != KEY_RSA) 
    161165    { 
     
    182186                            identification_t *id, bool trusted) 
    183187{ 
     188    if (this->cert == NULL) 
     189    { 
     190        return NULL; 
     191    } 
    184192    if (cert != CERT_ANY && cert != CERT_X509) 
    185193    { 
     
    202210static void destroy(private_load_tester_creds_t *this) 
    203211{ 
    204     this->private->destroy(this->private); 
    205     this->cert->destroy(this->cert); 
     212    DESTROY_IF(this->private); 
     213    DESTROY_IF(this->cert); 
    206214    free(this); 
    207215}