@@ -14,7 +14,8 @@ public class HttpSimpleObfs extends AbsObfs
14
14
public HttpSimpleObfs (String usrParamStr , String rmtIP , int rmtPort , int tcpMss )
15
15
{
16
16
super (usrParamStr , rmtIP , rmtPort , tcpMss );
17
- obfsParam = usrParamStr == null || usrParamStr .equals ("" ) ? "mvnrepository.com" : usrParamStr ;
17
+ obfsParam = usrParamStr == null || usrParamStr .equals ("" ) ? "mvnrepository.com" :
18
+ usrParamStr ;
18
19
}
19
20
20
21
private boolean headSent = false ;
@@ -30,7 +31,7 @@ public HttpSimpleObfs(String usrParamStr, String rmtIP, int rmtPort, int tcpMss)
30
31
headSent = true ;
31
32
if (data .length > 64 )
32
33
{
33
- int headLen = Utils .randomInt (64 )+ 1 ;
34
+ int headLen = Utils .randomInt (64 ) + 1 ;
34
35
byte [] out = encodeHead (Arrays .copyOfRange (data , 0 , headLen ));
35
36
byte [] end = new byte [out .length + (data .length - headLen )];
36
37
System .arraycopy (out , 0 , end , 0 , out .length );
@@ -64,17 +65,17 @@ private byte[] encodeHead(byte[] data)
64
65
//
65
66
headRecv = true ;
66
67
int pos = -1 ;
67
- int cnt = data .length - 5 ;
68
+ int cnt = data .length - 4 ;
68
69
// //TODO may be can...
69
- for (int i = 214 ; i < cnt ; i ++)
70
+ for (int i = 219 ; i < cnt ; i ++)
70
71
{
71
72
if (data [i ] == '\r' && data [i + 1 ] == '\n' &&
72
73
data [i + 2 ] == '\r' && data [i + 3 ] == '\n' )
73
74
{
74
75
pos = i + 4 ;
75
76
}
76
77
}
77
- if (pos == -1 )
78
+ if (pos == -1 || pos == data . length )
78
79
{
79
80
return new byte [0 ];
80
81
}
0 commit comments