瀏覽代碼

core: use advertised proto to build advertised sock string

Daniel-Constantin Mierla 1 年之前
父節點
當前提交
54d8cce28a
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/core/socket_info.c

+ 5 - 1
src/core/socket_info.c

@@ -456,7 +456,11 @@ int socketinfo2str(char *s, int *len, struct socket_info *si, int mode)
 	str proto;
 	int l;
 
-	proto.s = get_valid_proto_name(si->proto);
+	if(si->useinfo.proto != PROTO_NONE) {
+		proto.s = get_valid_proto_name(si->useinfo.proto);
+	} else {
+		proto.s = get_valid_proto_name(si->proto);
+	}
 	proto.len = strlen(proto.s);
 
 	if(mode == 1)