From f054e584e270374829e02e755956d41a8982f64d Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期三, 05 六月 2024 15:50:03 +0800 Subject: [PATCH] 2024年06月05日15:50:01 --- app/src/main/java/com/hdl/photovoltaic/internet/HttpServer/MyNanoHttpServer.java | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/internet/HttpServer/MyNanoHttpServer.java b/app/src/main/java/com/hdl/photovoltaic/internet/HttpServer/MyNanoHttpServer.java index 6f035ef..3cc1df8 100644 --- a/app/src/main/java/com/hdl/photovoltaic/internet/HttpServer/MyNanoHttpServer.java +++ b/app/src/main/java/com/hdl/photovoltaic/internet/HttpServer/MyNanoHttpServer.java @@ -25,7 +25,7 @@ public class MyNanoHttpServer extends NanoHTTPD { //澹版槑鏈嶅姟绔� 绔彛 - public static final Integer HTTP_PORT = 49152; + public static Integer HTTP_PORT = 49152;// 46219; public MyNanoHttpServer(String hostname, int port) { super(hostname, port); @@ -44,6 +44,7 @@ } return myNanoHttpServer; } + @Override public Response serve(IHTTPSession session) { @@ -79,7 +80,7 @@ String fileName = ((HTTPSession) session).getUri(); if (!TextUtils.isEmpty(fileName)) { if (fileName.contains(HdlFileLogic.getInstance().getDriveRootPath()) - ||fileName.contains(HdlFileLogic.getInstance().getFirmwareRootPath())) { + || fileName.contains(HdlFileLogic.getInstance().getFirmwareRootPath())) { String range = session.getHeaders().get("range"); if (TextUtils.isEmpty(range)) { return newFixedLengthResponse("閿欒,澶撮儴娌℃湁range瀛楁(-500)"); @@ -118,7 +119,7 @@ //鍝嶅簲瀹㈡埛绔� Response response = newFixedLengthResponse(newByte); response.addHeader("Content-Range", range + "/" + sourceDataByte.length);//浼熷崡闇�瑕佽繖涓瓧娈� - HdlLogLogic.print("http鍥炲鏁版嵁===璇锋眰澶у皬-->" + range + "=====鏂囦欢澶у皬-->" + sourceDataByte.length, true); + HdlLogLogic.print("http鍥炲鏁版嵁===璇锋眰澶у皬--" + range + "=====鏂囦欢澶у皬--" + sourceDataByte.length, true); return response; } } -- Gitblit v1.8.0