瀏覽代碼

tls: two small code cleanups

Henning Westerholt 14 年之前
父節點
當前提交
e17e7fa307
共有 1 個文件被更改,包括 1 次插入6 次删除
  1. 1 6
      modules/tls/tls_domain.c

+ 1 - 6
modules/tls/tls_domain.c

@@ -68,10 +68,6 @@ tls_domain_t* tls_new_domain(int type, struct ip_addr *ip, unsigned short port)
 	d->verify_depth = -1;
 	d->require_cert = -1;
 	return d;
-/*
- error:
-	shm_free(d);
-	return 0; */
 }
 
 
@@ -831,7 +827,6 @@ static int passwd_cb(char *buf, int size, int rwflag, void *filename)
 }
 
 
-#define NUM_RETRIES 3
 /**
  * @brief Load a private key from a file 
  * @param d TLS domain
@@ -854,7 +849,7 @@ static int load_private_key(tls_domain_t* d)
 		SSL_CTX_set_default_passwd_cb(d->ctx[i], passwd_cb);
 		SSL_CTX_set_default_passwd_cb_userdata(d->ctx[i], d->pkey_file.s);
 		
-		for(idx = 0, ret_pwd = 0; idx < NUM_RETRIES; idx++) {
+		for(idx = 0, ret_pwd = 0; idx < 3; idx++) {
 			ret_pwd = SSL_CTX_use_PrivateKey_file(d->ctx[i], d->pkey_file.s,
 					SSL_FILETYPE_PEM);
 			if (ret_pwd) {