diff --git a/lib_acl/samples/connect/main.cpp b/lib_acl/samples/connect/main.cpp index d02b02550..ad3fcbc94 100644 --- a/lib_acl/samples/connect/main.cpp +++ b/lib_acl/samples/connect/main.cpp @@ -88,7 +88,7 @@ int main(int argc, char *argv[]) } printf(">>>>>>connect all ok\r\n"); - sleep(100); + sleep(1); acl_vstream_fprintf(client, "%s", "line1\nline2\nline3\nline4\nline5\nline6\nline7\n"); while (1) { diff --git a/lib_acl/src/net/connect/acl_inet_connect.c b/lib_acl/src/net/connect/acl_inet_connect.c index 5c2bd37bc..513af10c9 100644 --- a/lib_acl/src/net/connect/acl_inet_connect.c +++ b/lib_acl/src/net/connect/acl_inet_connect.c @@ -186,7 +186,7 @@ ACL_SOCKET acl_inet_connect_ex(const char *addr, int blocking, } else if (acl_valid_ipv4_hostaddr(buf, 0)) { ptr = strrchr(buf, ACL_ADDR_SEP); if (ptr == NULL) - ptr = strrchr(buf, '.'); + ptr = strrchr(buf, ':'); } if (ptr == NULL) { @@ -261,9 +261,8 @@ ACL_SOCKET acl_inet_connect_ex(const char *addr, int blocking, } if (sock == ACL_SOCKET_INVALID) - acl_msg_error("%s(%d) %s: connect error %s, addr=%s:%s", - __FILE__, __LINE__, myname, - acl_last_serror(), peer, port); + acl_msg_error("%s(%d) %s: connect error %s, addr=%s", + __FILE__, __LINE__, myname, acl_last_serror(), addr); if (peer_res0) freeaddrinfo(peer_res0);