Selaa lähdekoodia

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

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

https://gitee.com/openLuat/LuatOS/issues/ICROBC
Wendal Chen 7 kuukautta sitten
vanhempi
sitoutus
3f9577f32f
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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)