Просмотр исходного кода

update: http的fota模式的body应该返回大小

Wendal Chen 2 лет назад
Родитель
Сommit
307f588614
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      components/network/libhttp/luat_lib_http.c

+ 8 - 1
components/network/libhttp/luat_lib_http.c

@@ -376,7 +376,14 @@ int32_t l_http_callback(lua_State *L, void* ptr){
 		lua_pushinteger(L, -1);
 		luat_cbcwait(L, idp, 3); // code, headers, body
 		goto exit;
-	}else {
+	}
+#ifdef LUAT_USE_FOTA
+	else if(http_ctrl->isfota){
+		lua_pushinteger(L, http_ctrl->body_len);
+		luat_cbcwait(L, idp, 3); // code, headers, body
+	}
+#endif
+	else {
 		// 非下载模式
 		lua_pushlstring(L, http_ctrl->body, http_ctrl->body_len);
 		luat_cbcwait(L, idp, 3); // code, headers, body