Parcourir la source

fix: websocket,send函数总是返回false

luat_websocket_send_frame在发送成功后应该返回0

https://gitee.com/openLuat/LuatOS/issues/ICROBC
Wendal Chen il y a 7 mois
Parent
commit
3f9577f32f
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      components/network/websocket/luat_websocket.c

+ 1 - 1
components/network/websocket/luat_websocket.c

@@ -424,7 +424,7 @@ int luat_websocket_send_frame(luat_websocket_ctrl_t *websocket_ctrl, luat_websoc
 
 	ret = luat_websocket_send_packet(websocket_ctrl, dst, offset + pkg->plen);
 	luat_heap_free(dst);
-	return ret;
+	return ret > 0 ? 0 : -8;
 }
 
 static int websocket_parse(luat_websocket_ctrl_t *websocket_ctrl)