break;
#endif
+#if (NGX_HAVE_UNIX_DOMAIN)
+ case AF_UNIX:
+ p = 0;
+ break;
+#endif
+
default: /* AF_INET */
sin = (struct sockaddr_in *) sa;
p = sin->sin_port;
return 1;
}
+ if (second->wildcard) {
+ /* a wildcard must be the last resort, shift it to the end */
+ return -1;
+ }
+
if (first->bind && !second->bind) {
/* shift explicit bind()ed addresses to the start */
return -1;
if (conf->peer == NULL) {
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no \"http_auth\" is defined for server in %s:%ui",
+ "no \"auth_http\" is defined for server in %s:%ui",
conf->file, conf->line);
return NGX_CONF_ERROR;
break;
#endif
+#if (NGX_HAVE_UNIX_DOMAIN)
+ case AF_UNIX:
+ off = offsetof(struct sockaddr_un, sun_path);
+ len = sizeof(((struct sockaddr_un *) sa)->sun_path);
+ port = 0;
+ break;
+#endif
+
default: /* AF_INET */
off = offsetof(struct sockaddr_in, sin_addr);
len = 4;
ls->wildcard = u.wildcard;
ls->ctx = cf->ctx;
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_MAIL_MODULE) {
- continue;
- }
+ if (cscf->protocol == NULL) {
+ for (m = 0; ngx_modules[m]; m++) {
+ if (ngx_modules[m]->type != NGX_MAIL_MODULE) {
+ continue;
+ }
- module = ngx_modules[m]->ctx;
+ module = ngx_modules[m]->ctx;
- if (module->protocol == NULL) {
- continue;
- }
+ if (module->protocol == NULL) {
+ continue;
+ }
- for (i = 0; module->protocol->port[i]; i++) {
- if (module->protocol->port[i] == u.port) {
- cscf->protocol = module->protocol;
- break;
+ for (i = 0; module->protocol->port[i]; i++) {
+ if (module->protocol->port[i] == u.port) {
+ cscf->protocol = module->protocol;
+ break;
+ }
}
}
}