1 Star 0 Fork 49

shafeipaozi/lwip

forked from src-openEuler/lwip 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0105-delete-redundant-logs-in-lwip.patch 3.72 KB
一键复制 编辑 原始数据 按行查看 历史
hantwofish 提交于 2024-01-10 10:34 . delete redundant logs in lwip
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 15053b3..ce79bb3 100644
--- a/src/api/sockets.c
+++ b/src/api/sockets.c
@@ -447,7 +447,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];
@@ -521,7 +521,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;
@@ -588,7 +588,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;
}
@@ -597,7 +596,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;
}
@@ -769,14 +767,13 @@ lwip_accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
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) {
sock_set_errno(sock, EOPNOTSUPP);
} else if (err == ERR_CLSD) {
@@ -791,7 +788,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);
sock_set_errno(sock, ENFILE);
done_socket(sock);
@@ -811,7 +807,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);
@@ -847,7 +842,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);
sock_set_errno(sock, err_to_errno(err));
done_socket(sock);
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shafeipaozi/lwip.git
[email protected]:shafeipaozi/lwip.git
shafeipaozi
lwip
lwip
master

搜索帮助