1 Star 0 Fork 49

zhengjiebing/lwip_222

forked from src-openEuler/lwip 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0105-delete-redundant-logs-in-lwip.patch 3.75 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2024-02-06 10:45 . adapt lwip-2.2.0
From ed49e784233ec0a83eb4f4e37fe9cd112bfed555 Mon Sep 17 00:00:00 2001
From: hantwofish <[email protected]>
Date: Wed, 10 Jan 2024 09:31:23 +0800
Subject: [PATCH] delete redundant logs in lwip
---
src/api/sockets.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/src/api/sockets.c b/src/api/sockets.c
index 250c424..082ae14 100644
--- a/src/api/sockets.c
+++ b/src/api/sockets.c
@@ -487,7 +487,7 @@ tryget_socket_unconn_nouse(int fd)
if ((s < 0) || (s >= NUM_SOCKETS))
#endif /* GAZELLE_ENABLE */
{
- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("tryget_socket_unconn(%d): invalid\n", fd));
+ LWIP_DEBUGF(SOCKETS_DEBUG , ("tryget_socket_unconn(%d): invalid\n", fd));
return NULL;
}
return &sockets[s];
@@ -561,7 +561,7 @@ get_socket(int fd)
struct lwip_sock *sock = tryget_socket(fd);
if (!sock) {
if ((fd < LWIP_SOCKET_OFFSET) || (fd >= (LWIP_SOCKET_OFFSET + NUM_SOCKETS))) {
- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("get_socket(%d): invalid\n", fd));
+ LWIP_DEBUGF(SOCKETS_DEBUG , ("get_socket(%d): invalid\n", fd));
}
set_errno(EBADF);
return NULL;
@@ -628,7 +628,6 @@ alloc_socket(struct netconn *newconn, int accepted, int flags)
SYS_ARCH_PROTECT(lev);
i = posix_api->socket_fn(domain, type, protocol);
if (i == -1) {
- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("posix_api->socket_fn fail socket is -1"));
goto err;
}
@@ -637,7 +636,6 @@ alloc_socket(struct netconn *newconn, int accepted, int flags)
}
if ((i < LWIP_SOCKET_OFFSET) || (i >= sockets_num + LWIP_SOCKET_OFFSET)) {
- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("posix_api->socket_fn socket is %d, illegal\n", i));
goto err;
}
@@ -808,14 +806,13 @@ lwip_accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d)...\n", s));
sock = get_socket(s);
if (!sock) {
- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("get_socket sock is null\n"));
return -1;
}
/* wait for a new connection */
err = netconn_accept(sock->conn, &newconn);
if (err != ERR_OK) {
- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("lwip_accept(%d): netconn_acept failed, err=%d\n", s, err));
+ LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d): netconn_acept failed, err=%d\n", s, err));
if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) {
set_errno(EOPNOTSUPP);
} else if (err == ERR_CLSD) {
@@ -830,7 +827,6 @@ lwip_accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
newsock = alloc_socket(newconn, 1, flags);
if (newsock == -1) {
- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("alloc_socket fail newsock is -1\n"));
netconn_delete(newconn);
set_errno(ENFILE);
done_socket(sock);
@@ -850,7 +846,6 @@ lwip_accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
ret = find_same_node_memzone(pcb, nsock);
}
if (pcb == NULL || ret != 0) {
- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("alloc_socket fail pcb null flag=%u, ret=%d \n", (pcb == NULL), ret));
netconn_delete(newconn);
free_socket(nsock, 1);
sock_set_errno(sock, ENOTCONN);
@@ -886,7 +881,7 @@ lwip_accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
/* get the IP address and port of the remote host */
err = netconn_peer(newconn, &naddr, &port);
if (err != ERR_OK) {
- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("lwip_accept(%d): netconn_peer failed, err=%d\n", s, err));
+ LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d): netconn_peer failed, err=%d\n", s, err));
free_socket(nsock, 1);
set_errno(err_to_errno(err));
done_socket(sock);
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/steganographer/lwip_222.git
[email protected]:steganographer/lwip_222.git
steganographer
lwip_222
lwip_222
master

搜索帮助