浏览代码

fix:socket的tx同步模式没有正确返回结果

alienwalker 3 年之前
父节点
当前提交
b56816dc9d

+ 0 - 8
components/network/adapter/luat_network_adapter.c

@@ -1954,10 +1954,6 @@ NETWORK_TX_WAIT:
 		{
 		case EV_NW_RESULT_TX:
 			result = (int)event.Param1;
-			if (!result)
-			{
-				result = -1;
-			}
 			finish = 1;
 			break;
 		case EV_NW_TIMEOUT:
@@ -4112,10 +4108,6 @@ NETWORK_TX_WAIT:
 		{
 		case EV_NW_RESULT_TX:
 			result = (int)event.Param1;
-			if (!result)
-			{
-				result = -1;
-			}
 			finish = 1;
 			break;
 		case EV_NW_TIMEOUT:

+ 1 - 1
components/network/adapter/luat_network_adapter.h

@@ -450,7 +450,7 @@ int network_close(network_ctrl_t *ctrl, uint32_t timeout_ms);
  * timeout_ms=0时,为非阻塞接口
  * UDP的时候,remote_ip和remote_port和connect不一致的时候才需要remote_ip和remote_port
  * TCP不看remote_ip和remote_port
- * 则塞模式,*tx_len不需要看,则塞模式需要看*tx_len的实际长度是不是和len一致
+ * 则塞模式,*tx_len不需要看,则塞模式需要看*tx_len的实际长度是不是和len一致
  */
 int network_tx(network_ctrl_t *ctrl, const uint8_t *data, uint32_t len, int flags, luat_ip_addr_t *remote_ip, uint16_t remote_port, uint32_t *tx_len, uint32_t timeout_ms);
 /*