forked from proxyee-down-org/proxyee-down
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.调整文件写入方式,修复写入文件占用系统内存和写入移动硬盘卡死问题。 2.不再区分32位和64位系统 3.修复手动创建任务时正确识别端口号的问题 4.修复手动创建任务时,重定向带cookie丢失问题 5.修复第一次启动时,证书安装引导界面可能被遮盖的问题
- Loading branch information
Showing
21 changed files
with
191 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
core/src/main/java/lee/study/down/boot/HttpDownBootstrap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package lee.study.down.boot; | ||
|
||
import io.netty.handler.ssl.SslContext; | ||
import java.io.Closeable; | ||
import java.io.IOException; | ||
import java.nio.ByteBuffer; | ||
import java.nio.channels.SeekableByteChannel; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
import java.nio.file.StandardOpenOption; | ||
import lee.study.down.dispatch.HttpDownCallback; | ||
import lee.study.down.model.ChunkInfo; | ||
import lee.study.down.model.HttpDownInfo; | ||
|
||
public class HttpDownBootstrap extends AbstractHttpDownBootstrap { | ||
|
||
|
||
public HttpDownBootstrap(HttpDownInfo httpDownInfo, int retryCount, SslContext clientSslContext, HttpDownCallback callback, TimeoutCheckTask timeoutCheckTask) { | ||
super(httpDownInfo, retryCount, clientSslContext, callback, timeoutCheckTask); | ||
} | ||
|
||
@Override | ||
public int doFileWriter(ChunkInfo chunkInfo, ByteBuffer buffer) throws IOException { | ||
int ret = -1; | ||
Closeable closeable = (Closeable) getAttr(chunkInfo, ATTR_FILE_CLOSEABLE); | ||
if (closeable != null) { | ||
ret = buffer.remaining(); | ||
SeekableByteChannel fileChannel = (SeekableByteChannel) closeable; | ||
fileChannel.write(buffer); | ||
} | ||
return ret; | ||
} | ||
|
||
@Override | ||
public Closeable initFileWriter(ChunkInfo chunkInfo) throws Exception { | ||
SeekableByteChannel fileChannel = Files.newByteChannel(Paths.get(getHttpDownInfo().getTaskInfo().buildTaskFilePath()), StandardOpenOption.WRITE); | ||
fileChannel.position(chunkInfo.getOriStartPosition() + chunkInfo.getDownSize()); | ||
setAttr(chunkInfo, ATTR_FILE_CLOSEABLE, fileChannel); | ||
return fileChannel; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 0 additions & 58 deletions
58
core/src/main/java/lee/study/down/boot/X64HttpDownBootstrap.java
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
core/src/main/java/lee/study/down/boot/X86HttpDownBootstrap.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.