Skip to content

Commit

Permalink
更新至2.43
Browse files Browse the repository at this point in the history
修复插件更新的问题
修复百度云获取不到选择文件的问题
修复无法暂停的问题
  • Loading branch information
monkeyWie committed Mar 29, 2018
1 parent 9e36bd9 commit 9f64245
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>proxyee-down</artifactId>
<groupId>lee.study</groupId>
<version>2.42</version>
<version>2.43</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>proxyee-down</artifactId>
<groupId>lee.study</groupId>
<version>2.42</version>
<version>2.43</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public void startDown() throws Exception {
if (callback != null) {
callback.onStart(httpDownInfo);
}
afterStart();
}

protected void startChunkDown(ChunkInfo chunkInfo, int updateStatus) throws Exception {
Expand Down Expand Up @@ -219,7 +218,6 @@ public void continueDown()
taskInfo.setPauseTime(
taskInfo.getPauseTime() + (curTime - taskInfo.getLastTime()));
taskInfo.setLastTime(curTime);
afterStart();
for (ChunkInfo chunkInfo : taskInfo.getChunkInfoList()) {
synchronized (chunkInfo) {
if (chunkInfo.getStatus() == HttpDownStatus.PAUSE
Expand All @@ -238,13 +236,13 @@ public void continueDown()
}

public void close(ChunkInfo chunkInfo) {
close(chunkInfo, false);
close(chunkInfo, -1);
}

public void close(ChunkInfo chunkInfo, boolean isDone) {
public void close(ChunkInfo chunkInfo, int status) {
try {
if (!isDone) {
chunkInfo.setStatus(HttpDownStatus.WAIT);
if (status != -1) {
chunkInfo.setStatus(status);
}
if (!attr.containsKey(chunkInfo.getIndex())) {
return;
Expand All @@ -263,29 +261,29 @@ public void close(ChunkInfo chunkInfo, boolean isDone) {
}
}

public void close(boolean isDone) {
public void close(int status) {
TaskInfo taskInfo = httpDownInfo.getTaskInfo();
synchronized (taskInfo) {
if (!isDone) {
taskInfo.setStatus(HttpDownStatus.WAIT);
if (status != -1) {
taskInfo.setStatus(status);
}
for (ChunkInfo chunkInfo : httpDownInfo.getTaskInfo().getChunkInfoList()) {
synchronized (chunkInfo) {
close(chunkInfo, isDone);
close(chunkInfo, status);
}
}
}
}

public void close() {
close(false);
close(-1);
}

public void delete(boolean delFile) throws Exception {
TaskInfo taskInfo = httpDownInfo.getTaskInfo();
//删除任务进度记录文件
synchronized (taskInfo) {
close();
close(HttpDownStatus.WAIT);
timeoutCheckTask.delBoot(httpDownInfo.getTaskInfo().getId());
FileUtil.deleteIfExists(taskInfo.buildTaskRecordFilePath());
FileUtil.deleteIfExists(taskInfo.buildTaskRecordBakFilePath());
Expand Down Expand Up @@ -324,9 +322,6 @@ public Channel getChannel(ChunkInfo chunkInfo) {
return (Channel) getAttr(chunkInfo, ATTR_CHANNEL);
}

protected void afterStart() throws Exception {
}

public abstract int doFileWriter(ChunkInfo chunkInfo, ByteBuffer buffer)
throws IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
}
if (isDone(chunkInfo.getDownSize(), httpContent)) {
LOGGER.debug("分段下载完成:channelId[" + ctx.channel().id() + "]\t" + chunkInfo);
bootstrap.close(chunkInfo, true);
bootstrap.close(chunkInfo);
//分段下载完成回调
chunkInfo.setStatus(HttpDownStatus.DONE);
taskInfo.refresh(chunkInfo);
Expand All @@ -108,7 +108,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
//文件下载完成回调
taskInfo.setStatus(HttpDownStatus.DONE);
LOGGER.debug("下载完成:channelId[" + ctx.channel().id() + "]\t" + chunkInfo);
bootstrap.close(true);
bootstrap.close();
if (callback != null) {
callback.onDone(bootstrap.getHttpDownInfo());
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>lee.study</groupId>
<artifactId>proxyee-down</artifactId>
<version>2.42</version>
<version>2.43</version>
<packaging>pom</packaging>

<modules>
Expand Down
2 changes: 1 addition & 1 deletion sniff/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>proxyee-down</artifactId>
<groupId>lee.study</groupId>
<version>2.42</version>
<version>2.43</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
10 changes: 8 additions & 2 deletions sniff/src/main/resources/hookjs/bdyHook.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//1.2
//1.3
var initHookInterval = setInterval(function () {
if (!window.$) {
return;
Expand Down Expand Up @@ -66,6 +66,11 @@ var initHookInterval = setInterval(function () {
};
var wordMap = location.protocol == 'http:' ? wordMapHttp : wordMapHttps;

function getDefaultStyle(obj, attribute) {
return obj.currentStyle ? obj.currentStyle[attribute]
: document.defaultView.getComputedStyle(obj, false)[attribute];
}

$(function () {
switch (detectPage()) {
case 'disk':
Expand Down Expand Up @@ -324,7 +329,8 @@ var initHookInterval = setInterval(function () {
});
} else {
$('span.' + wordMap['checkbox']).parent().each(function () {
if ($(this).hasClass('mixjMpAl')) {
if (getDefaultStyle($(this).find(">span>span").get(0), 'display')
== 'block') {
var fileName = $(this).find('div.file-name div.text>a').text();
$.each(fileList, function (i, file) {
if (file.server_filename == fileName) {
Expand Down
2 changes: 1 addition & 1 deletion ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>proxyee-down</artifactId>
<groupId>lee.study</groupId>
<version>2.42</version>
<version>2.43</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public void run() {
.eachText()) {
URL url = new URL(HOST + name);
URLConnection connection = url.openConnection();
connection.setUseCaches(false);
PluginBean pluginBean = PluginUtil
.checkAndUpdateLocalPlugin(name, connection.getInputStream());
PluginBean current = PluginContent.get(name);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
app.version=2.42
app.version=2.43
spring.profiles.active=prd
view.server.port = 8999
tomcat.server.port = 26339
Expand Down
2 changes: 1 addition & 1 deletion update/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>lee.study</groupId>
<artifactId>proxyee-down-update</artifactId>
<packaging>jar</packaging>
<version>2.42</version>
<version>2.43</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down

0 comments on commit 9f64245

Please sign in to comment.