From b73504296fe5d8e8f314d3877a31614c79f5830e Mon Sep 17 00:00:00 2001 From: liuhaikang Date: Thu, 20 Feb 2025 21:38:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E9=99=A4=E6=9E=84=E5=BB=BA=E8=AD=A6?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuhaikang --- CHANGELOG.md | 3 +++ entry/oh-package.json5 | 2 +- library/oh-package.json5 | 2 +- library/src/main/ets/commands/registration/retr.ts | 2 +- library/src/main/ets/connection.ts | 2 +- library/src/main/ets/connector/active.ts | 2 +- library/src/main/ets/connector/passive.ts | 2 +- library/src/main/ets/index.ts | 2 +- oh-package.json5 | 2 +- 9 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a888d2a..e4798ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.0.5-rc.0 +1. clear build warn + ## v1.0.4 1. Fix the vulnerability: The stream is closed asynchronously. As a result, the socket server is closed when the file is transferred next time. diff --git a/entry/oh-package.json5 b/entry/oh-package.json5 index f2bf002..d336bf5 100644 --- a/entry/oh-package.json5 +++ b/entry/oh-package.json5 @@ -1,6 +1,6 @@ { "name": "entry", - "version": "1.0.4", + "version": "1.0.5-rc.0", "description": "Please describe the basic information.", "main": "", "author": "", diff --git a/library/oh-package.json5 b/library/oh-package.json5 index dd3d03f..725affd 100644 --- a/library/oh-package.json5 +++ b/library/oh-package.json5 @@ -11,7 +11,7 @@ "main": "Index.ts", "repository": "https://gitee.com/openharmony-sig/ohos_ftp_srv", "type": "module", - "version": "1.0.4", + "version": "1.0.5-rc.0", "tags": [ "Network", "Tool" diff --git a/library/src/main/ets/commands/registration/retr.ts b/library/src/main/ets/commands/registration/retr.ts index 2e89cba..82a930f 100644 --- a/library/src/main/ets/commands/registration/retr.ts +++ b/library/src/main/ets/commands/registration/retr.ts @@ -33,7 +33,7 @@ export const retr = { let textDecoder = util.TextDecoder.create('utf-8', { ignoreBOM: false }); - let resultData = textDecoder.decodeWithStream(new Uint8Array(buf), { stream: false }); + let resultData = textDecoder.decodeToString(new Uint8Array(buf), { stream: false }); tcpSendOptions = resultData; } else { tcpSendOptions = diff --git a/library/src/main/ets/connection.ts b/library/src/main/ets/connection.ts index 068806f..97dd6a9 100644 --- a/library/src/main/ets/connection.ts +++ b/library/src/main/ets/connection.ts @@ -62,7 +62,7 @@ export class FtpConnection extends EventEmitter { } let textDecoder = util.TextDecoder.create(this.encoding, textDecoderOptions); let uint8Array = new Uint8Array(data.message); - let messageView = textDecoder.decodeWithStream(uint8Array, decodeWithStreamOptions); + let messageView = textDecoder.decodeToString(uint8Array, decodeWithStreamOptions); let messages = compact(messageView.split('\r\n')); this.log.trace(messages); return promiseMapSeries(messages, async (message) => this.commands.handle(message)); diff --git a/library/src/main/ets/connector/active.ts b/library/src/main/ets/connector/active.ts index fe19361..3958bc9 100644 --- a/library/src/main/ets/connector/active.ts +++ b/library/src/main/ets/connector/active.ts @@ -1,4 +1,4 @@ -import socket from '@ohos.net.socket'; +import { socket } from '@kit.NetworkKit'; import connection from '@ohos.net.connection'; import { Connector } from "./base"; import { SocketError } from "../errors"; diff --git a/library/src/main/ets/connector/passive.ts b/library/src/main/ets/connector/passive.ts index 09ed0a4..5360546 100644 --- a/library/src/main/ets/connector/passive.ts +++ b/library/src/main/ets/connector/passive.ts @@ -1,4 +1,4 @@ -import socket from '@ohos.net.socket'; +import { socket } from "@kit.NetworkKit"; import { Connector } from "./base"; import { ConnectorError } from "../errors"; import { promiseWithTimeout } from "../helpers/promise-util"; diff --git a/library/src/main/ets/index.ts b/library/src/main/ets/index.ts index a65bcb7..934537d 100644 --- a/library/src/main/ets/index.ts +++ b/library/src/main/ets/index.ts @@ -1,6 +1,6 @@ //@ts-ignore import { concat, get } from "lodash"; -import socket from '@ohos.net.socket'; +import { socket } from '@kit.NetworkKit'; import Url from '@ohos.url'; import { FtpConnection } from "./connection"; import { getNextPortFactory } from "./helpers/find-port"; diff --git a/oh-package.json5 b/oh-package.json5 index ef1fb8c..d0e2a9e 100644 --- a/oh-package.json5 +++ b/oh-package.json5 @@ -1,6 +1,6 @@ { "name": "ohos_ftp_srv", - "version": "1.0.4", + "version": "1.0.5-rc.0", "description": "Please describe the basic information.", "main": "", "author": "", -- Gitee