[nginx] svn commit: r4820 - trunk/src/mail

ru at nginx.com ru at nginx.com
Fri Aug 17 05:21:28 UTC 2012


Author: ru
Date: 2012-08-17 05:21:28 +0000 (Fri, 17 Aug 2012)
New Revision: 4820
URL: http://trac.nginx.org/nginx/changeset/4820/nginx

Log:
Mail: fixed handling of AF_UNIX addresses in "listen".

This makes AF_UNIX addresses in mail officially supported.


Modified:
   trunk/src/mail/ngx_mail.c
   trunk/src/mail/ngx_mail_core_module.c

Modified: trunk/src/mail/ngx_mail.c
===================================================================
--- trunk/src/mail/ngx_mail.c	2012-08-17 05:14:19 UTC (rev 4819)
+++ trunk/src/mail/ngx_mail.c	2012-08-17 05:21:28 UTC (rev 4820)
@@ -263,6 +263,12 @@
         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;

Modified: trunk/src/mail/ngx_mail_core_module.c
===================================================================
--- trunk/src/mail/ngx_mail_core_module.c	2012-08-17 05:14:19 UTC (rev 4819)
+++ trunk/src/mail/ngx_mail_core_module.c	2012-08-17 05:21:28 UTC (rev 4820)
@@ -340,6 +340,14 @@
             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;



More information about the nginx-devel mailing list