michael-o commented on a change in pull request #8:
URL: https://github.com/apache/tomcat-native/pull/8#discussion_r532249132



##########
File path: java/org/apache/tomcat/jni/Address.java
##########
@@ -40,8 +40,9 @@
 
     /**
      * Create apr_sockaddr_t from hostname, address family, and port.
-     * @param hostname The hostname or numeric address string to 
resolve/parse, or
-     *               NULL to build an address that corresponds to 0.0.0.0 or ::
+     * @param hostname The hostname or numeric address string to 
resolve/parse, the

Review comment:
       I think the generic name is address which represents `hostname:port`,  
`IPv4:port' , `[IPv6]:port`, '/path`. Should we deprecate this one and replace 
with a new one?

##########
File path: native/src/info.c
##########
@@ -198,6 +198,9 @@ static void fill_ainfo(JNIEnv *e, jobject obj, 
apr_sockaddr_t *info)
     if (info->family == APR_UNSPEC) f = 0;
     else if (info->family == APR_INET) f = 1;
     else if (info->family == APR_INET6) f = 2;
+#ifdef APR_UNIX
+    else if (info->family == APR_UNIX) f = 3;

Review comment:
       Just like here...

##########
File path: native/src/network.c
##########
@@ -79,6 +80,15 @@ static apr_status_t sp_socket_cleanup(void *data)
         (*s->net->cleanup)(s->opaque);
     if (s->sock) {
         apr_socket_t *as = s->sock;
+        apr_sockaddr_t *sa = NULL;
+        apr_socket_addr_get(&sa, APR_LOCAL, as);
+        if (sa && sa->family == APR_UNIX) {

Review comment:
       If you guard all the rest with `#ifdef APR_UNIX` why not this one?

##########
File path: native/include/tcn.h
##########
@@ -281,11 +281,20 @@ typedef struct {
 #define APR_INET6 APR_INET
 #endif
 
+#ifdef APR_UNIX
 #define GET_S_FAMILY(T, F)           \
     if (F == 0) T = APR_UNSPEC;      \
     else if (F == 1) T = APR_INET;   \
     else if (F == 2) T = APR_INET6;  \
+    else if (F == 3) T = APR_UNIX;   \

Review comment:
       Why not make the ifdef around this line?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to