微调了min-http数据交互协议

This commit is contained in:
free will
2020-12-28 20:04:32 +08:00
parent 468b36e549
commit 9771dac9cb
2 changed files with 13 additions and 5 deletions
+4 -4
View File
@@ -1,9 +1,9 @@
#\u4FEE\u6539\u914D\u7F6E\u6587\u4EF6
#Tue Dec 22 20:15:22 CST 2020
ServerIPAddress=219.223.196.164
#Mon Dec 28 19:48:19 CST 2020
ServerIPAddress=219.223.192.199
MIS_PORT=13899
DataPackagePrefix=/MIN/Nginx/test2
ServerPortAddress=6363
ThreadNumberForFileTransfer=5
DownloadFileDirectory=.\\filecache\\
ServerPortAddress=6363
MIS_IP=121.15.171.91
DownloadFileDirectory=.\\filecache\\
@@ -114,6 +114,7 @@ public class MINHTTP_RequestHandler {
Integer chunkNums=calcSliceNums(length,chunkSize);
System.out.println("本次请求应答数据理应(服务器告诉我的)的总大小:"+length);
this.responseData=new byte[Math.toIntExact(length)];
int headLens=0; // MIN-HTTP头部字段的长度
for(int i=0;i<chunkNums;i++){
interestNameString=this.serverPrefix+MINHTTP_MINPrefixUtil.SessionString
+"/MIN_HTTP_RESPONSE"+"/"+this.session.getSessionID()
@@ -123,8 +124,15 @@ public class MINHTTP_RequestHandler {
if(isTimeoutOrNack(dataSliceResponse)){
return false;
}
if(i==0){
headLens=dataSliceResponse.length;
}
System.out.println("本次接收到的应答数据块大小[ "+i+" ]"+dataSliceResponse.length);
ByteArrayUtil.insertByteArray(this.responseData,dataSliceResponse,i*chunkSize);
if(i==0) {
ByteArrayUtil.insertByteArray(this.responseData, dataSliceResponse, 0);
}else{
ByteArrayUtil.insertByteArray(this.responseData,dataSliceResponse,(i-1) * chunkSize+headLens);
}
}
// 测试代码段START
// interestNameString=this.serverPrefix+MINHTTP_MINPrefixUtil.SessionString