1090 |
ASSERT(pp); |
ASSERT(pp); |
1091 |
|
|
1092 |
NEW(p); |
NEW(p); |
|
p->socket= pp->socket; |
|
|
p->hostname= pp->hostname; |
|
1093 |
p->port= pp->port; |
p->port= pp->port; |
1094 |
p->type= pp->type; |
p->type= pp->type; |
1095 |
|
p->socket= pp->socket; |
1096 |
p->family= pp->family; |
p->family= pp->family; |
1097 |
p->request= pp->request; |
p->request= pp->request; |
1098 |
p->protocol= pp->protocol; |
p->protocol= pp->protocol; |
1099 |
p->pathname= pp->pathname; |
p->pathname= pp->pathname; |
1100 |
p->certmd5= pp->certmd5; |
p->hostname= pp->hostname; |
|
|
|
|
if (p->certmd5 != NULL) { |
|
|
|
|
|
cleanup_md5_string(p->certmd5); |
|
|
|
|
|
} |
|
1101 |
|
|
1102 |
if(pp->family == AF_INET) { |
if(pp->family == AF_INET) { |
1103 |
snprintf(address, STRLEN, "INET[%s:%d]", pp->hostname, pp->port); |
snprintf(address, STRLEN, "INET[%s:%d]", pp->hostname, pp->port); |
1106 |
} |
} |
1107 |
|
|
1108 |
if(pp->ssl == TRUE) { |
if(pp->ssl == TRUE) { |
|
|
|
1109 |
if(!have_ssl()) { |
if(!have_ssl()) { |
|
|
|
1110 |
log("%s: The ssl check cannot be activated at line %d, " |
log("%s: The ssl check cannot be activated at line %d, " |
1111 |
"SSL is not support.\n", |
"SSL is not support.\n", |
1112 |
prog,lineno-1); |
prog,lineno-1); |
1113 |
cfg_errflag++; |
cfg_errflag++; |
|
|
|
1114 |
} else { |
} else { |
1115 |
|
if (pp->certmd5 != NULL) { |
1116 |
p->ssl= new_ssl_connection(NULL, pp->sslversion); |
p->SSL.certmd5= pp->certmd5; |
1117 |
|
cleanup_md5_string(p->SSL.certmd5); |
1118 |
|
} |
1119 |
|
p->SSL.use_ssl= TRUE; |
1120 |
|
p->SSL.version= pp->sslversion; |
1121 |
} |
} |
|
|
|
|
} else { |
|
|
|
|
|
p->ssl= NULL; |
|
|
|
|
1122 |
} |
} |
1123 |
|
|
1124 |
p->address= xstrdup(address); |
p->address= xstrdup(address); |
1264 |
/* |
/* |
1265 |
* Return a protocol object for the given protocol |
* Return a protocol object for the given protocol |
1266 |
*/ |
*/ |
1267 |
static void *addprotocol(int proto) { |
static void *addprotocol(int protocol) { |
1268 |
|
|
1269 |
switch (proto) { |
switch (protocol) { |
1270 |
|
case P_HTTP: return create_http(); |
1271 |
case P_HTTP: return create_http(); |
case P_FTP: return create_ftp(); |
1272 |
case P_FTP: return create_ftp(); |
case P_SMTP: return create_smtp(); |
1273 |
case P_SMTP: return create_smtp(); |
case P_POP: return create_pop(); |
1274 |
case P_POP: return create_pop(); |
case P_IMAP: return create_imap(); |
1275 |
case P_IMAP: return create_imap(); |
case P_NNTP: return create_nntp(); |
1276 |
case P_NNTP: return create_nntp(); |
case P_SSH: return create_ssh(); |
1277 |
case P_SSH: return create_ssh(); |
case P_DWP: return create_dwp(); |
1278 |
case P_DWP: return create_dwp(); |
case P_LDAP2: return create_ldap2(); |
1279 |
case P_LDAP2: return create_ldap2(); |
case P_LDAP3: return create_ldap3(); |
1280 |
case P_LDAP3: return create_ldap3(); |
case P_RDATE: return create_rdate(); |
|
case P_RDATE: return create_rdate(); |
|
|
|
|
1281 |
} |
} |
1282 |
|
|
1283 |
return create_default(); |
return create_default(); |