xiaoxiang781216 commented on a change in pull request #561: URL: https://github.com/apache/incubator-nuttx-apps/pull/561#discussion_r557287383
########## File path: netutils/webclient/webclient.c ########## @@ -740,6 +760,40 @@ int webclient_perform(FAR struct webclient_context *ctx) return -errno; } +#if defined(CONFIG_WEBCLIENT_NET_LOCAL) Review comment: like this: ``` #if defined(CONFIG_WEBCLIENT_NET_LOCAL) struct sockaddr_un server_un; #endif struct sockaddr_in server_in; int domain; const struct sockaddr *server_address; socklen_t server_address_len; /* Create a socket */ #if defined(CONFIG_WEBCLIENT_NET_LOCAL) if (ctx->unix_socket != NULL) { domain = PF_LOCAL; memset(&server_un, 0, sizeof(server_un)); server_un.sun_family = AF_LOCAL; strncpy(server_un.sun_path, ctx->unix_socket, sizeof(server_un.sun_path)); #if !defined(__NuttX__) && !defined(__linux__) server_un.sun_len = SUN_LEN(&server_un); #endif server_address = (const struct sockaddr *)&server_un; server_address_len = sizeof(server_un); } else #endif { domain = PF_INET; /* Get the server address from the host name */ server_in.sin_family = AF_INET; server_in.sin_port = htons(ws->port); ret = wget_gethostip(ws->hostname, &server_in.sin_addr); if (ret < 0) { /* Could not resolve host (or malformed IP address) */ nwarn("WARNING: Failed to resolve hostname\n"); ret = -EHOSTUNREACH; goto errout_with_errno; } server_address = (const struct sockaddr *)&server_in; server_address_len = sizeof(struct sockaddr_in); } ``` ---------------------------------------------------------------- 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