girl 0.71.0 → 0.71.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of girl might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a29bed71df8f50ac316ebd9819b0e32134324700d01752dd7027ed91e51dc35
4
- data.tar.gz: 63dca91494dd3680caa7364db5b6b22c205fa6cc4a55a23d497ec0489f8c1234
3
+ metadata.gz: 82b6edf01d2b2157f11757d1a39b2f774507f114e0638aed6192ee19b29b03d5
4
+ data.tar.gz: 6253f10b1525763929b083e51a7693516e82ab34d2dfd374beae48e4305cf550
5
5
  SHA512:
6
- metadata.gz: 3ce8f9e01aea05d29e5bd8fb91f027eca72ec3f992da8ad767a9845c52ad9e4727bf70ed1408cef2f2a71cf92ce3265564c7789fc95d76c793d8172d0a0da53a
7
- data.tar.gz: 0f5ee9f741065b75f2de0aa9f2ee68cc4e462a5aaffe1f7e9418028a629cf2dd0b116a07b8b6481898dcd3907e691f9bda0f7a88e4d0a2095fb6ffbbc36b0f09
6
+ metadata.gz: c4d9edc69891b09e920bf27b6ad664f1243b41a182192fe26f1264ef83ebdd733c77e19d833d89f379cd63b98de62ec46a459b5be7a2238372ab0347298c3e6f
7
+ data.tar.gz: f3e6491a9267fb9eeef29457a6be5a74da026f1d7a37a89391eb8dec8b160e1a3d7d2eb5170acefd5aabcc792ac45e5c9bf0b8d49661654b158e5f3012d1d75a
@@ -1,17 +1,17 @@
1
1
  module Girl
2
- PACK_SIZE = 1328 # 包大小 1400(console MTU) - 8(PPPoE header) - 40(IPv6 header) - 8(UDP header) - 8(pack id) - 8(src id) = 1328
3
- CHUNK_SIZE = PACK_SIZE * 1000 # 块大小
4
- WBUFFS_LIMIT = 1000 # 写前上限,超过上限结一个块
5
- WMEMS_LIMIT = 100_000 # 写后上限,达到上限暂停写
6
- RESUME_BELOW = 50_000 # 降到多少以下恢复写
7
- EXPIRE_NEW = 10 # 创建之后多久没有流量进来,过期
8
- EXPIRE_AFTER = 300 # 多久没有新流量,过期
9
- CHECK_EXPIRE_INTERVAL = 30 # 检查过期间隔
10
- STATUS_INTERVAL = 0.5 # 发送状态间隔
11
- SEND_STATUS_UNTIL = 10 # 持续的告之对面状态,直到没有流量往来,持续多少秒
12
- BREAK_SEND_MISS = 10_000 # miss包个数上限,达到上限忽略要后面的段,可控碎片缓存
13
- CONFUSE_UNTIL = 5 # 混淆前几个包
14
- RESOLV_CACHE_EXPIRE = 300 # dns查询结果缓存多久过期
2
+ PACK_SIZE = 1328 # 包大小 1400(console MTU) - 8(PPPoE header) - 40(IPv6 header) - 8(UDP header) - 8(pack id) - 8(src id) = 1328
3
+ CHUNK_SIZE = PACK_SIZE * 1000 # 块大小
4
+ WBUFFS_LIMIT = 1000 # 写前上限,超过上限结一个块
5
+ WMEMS_LIMIT = 100_000 # 写后上限,达到上限暂停写
6
+ RESUME_BELOW = 50_000 # 降到多少以下恢复写
7
+ EXPIRE_NEW = 10 # 创建之后多久没有流量进来,过期
8
+ EXPIRE_AFTER = 300 # 多久没有新流量,过期
9
+ CHECK_EXPIRE_INTERVAL = 30 # 检查过期间隔
10
+ STATUS_INTERVAL = 0.5 # 发送状态间隔
11
+ SEND_STATUS_UNTIL = 10 # 持续的告之对面状态,直到没有流量往来,持续多少秒
12
+ BREAK_SEND_MISS = 10_000 # miss包个数上限,达到上限忽略要后面的段,可控碎片缓存
13
+ CONFUSE_UNTIL = 5 # 混淆前几个包
14
+ RESOLV_CACHE_EXPIRE = 300 # dns查询结果缓存多久过期
15
15
  TUND_PORT = 1
16
16
  HEARTBEAT = 2
17
17
  A_NEW_SOURCE = 3
@@ -23,15 +23,15 @@ require 'socket'
23
23
  #
24
24
  # tun-tund:
25
25
  #
26
- # Q>: 0 ctlmsg -> C: 2 heartbeat -> C: random char
27
- # 3 a new src -> Q>: src id -> encoded destination address
28
- # 4 paired -> Q>: src id -> n: dst port
29
- # 5 dst status -> n: dst port -> Q>: biggest relayed dst pack id -> Q>: continue src pack id
30
- # 6 src status -> Q>: src id -> Q>: biggest relayed src pack id -> Q>: continue dst pack id
31
- # 7 miss -> Q>/n: src id / dst port -> Q>: pack id begin -> Q>: pack id end
32
- # 8 fin1 -> Q>/n: src id / dst port -> Q>: biggest src pack id / biggest dst pack id -> Q>: continue dst pack id / continue src pack id
26
+ # Q>: 0 ctlmsg -> C: 2 heartbeat -> C: random char
27
+ # 3 a new source -> Q>: src id -> encoded destination address
28
+ # 4 paired -> Q>: src id -> n: dst port
29
+ # 5 dest status -> n: dst port -> Q>: biggest relayed dst pack id -> Q>: continue src pack id
30
+ # 6 source status -> Q>: src id -> Q>: biggest relayed src pack id -> Q>: continue dst pack id
31
+ # 7 miss -> Q>/n: src id / dst port -> Q>: pack id begin -> Q>: pack id end
32
+ # 8 fin1 -> Q>/n: src id / dst port -> Q>: biggest src pack id / biggest dst pack id -> Q>: continue dst pack id / continue src pack id
33
33
  # 9 not use
34
- # 10 fin2 -> Q>/n: src id / dst port
34
+ # 10 fin2 -> Q>/n: src id / dst port
35
35
  # 11 not use
36
36
  # 12 tund fin
37
37
  # 13 tun fin
@@ -129,21 +129,19 @@ module Girl
129
129
  end
130
130
 
131
131
  src_chunk_dir = File.join( proxy_tmp_dir, 'src.chunk' )
132
- dst_chunk_dir = File.join( proxy_tmp_dir, 'dst.chunk' )
133
- tun_chunk_dir = File.join( proxy_tmp_dir, 'tun.chunk' )
134
-
135
- unless Dir.exist?( proxy_tmp_dir )
136
- Dir.mkdir( proxy_tmp_dir )
137
- end
138
132
 
139
133
  unless Dir.exist?( src_chunk_dir )
140
134
  Dir.mkdir( src_chunk_dir )
141
135
  end
142
136
 
137
+ dst_chunk_dir = File.join( proxy_tmp_dir, 'dst.chunk' )
138
+
143
139
  unless Dir.exist?( dst_chunk_dir )
144
140
  Dir.mkdir( dst_chunk_dir )
145
141
  end
146
142
 
143
+ tun_chunk_dir = File.join( proxy_tmp_dir, 'tun.chunk' )
144
+
147
145
  unless Dir.exist?( tun_chunk_dir )
148
146
  Dir.mkdir( tun_chunk_dir )
149
147
  end
@@ -383,11 +383,9 @@ module Girl
383
383
 
384
384
  if src_info[ :proxy_proto ] == :http
385
385
  if src_info[ :is_connect ]
386
- # CONNECT
387
386
  # puts "debug1 add src wbuff http ok"
388
387
  add_src_wbuff( src, HTTP_OK )
389
388
  else
390
- # not CONNECT
391
389
  # puts "debug1 add src rbuffs to dst wbuff"
392
390
 
393
391
  src_info[ :rbuffs ].each do | _, data |
@@ -1264,11 +1262,9 @@ module Girl
1264
1262
 
1265
1263
  if src_info[ :proxy_proto ] == :http
1266
1264
  if src_info[ :is_connect ]
1267
- # CONNECT
1268
1265
  # puts "debug1 add src wbuff http ok"
1269
1266
  add_src_wbuff( src, HTTP_OK )
1270
1267
  else
1271
- # not CONNECT
1272
1268
  # puts "debug1 add src rbuffs to tun wbuffs"
1273
1269
 
1274
1270
  src_info[ :rbuffs ].each do | pack_id, _data |
@@ -1358,7 +1354,6 @@ module Girl
1358
1354
  src_ext[ :biggest_dst_pack_id ] = biggest_dst_pack_id
1359
1355
  release_wmems( src_ext, continue_src_pack_id )
1360
1356
 
1361
- # 接到对面已关闭,若最后一个包已经进写前,关闭src
1362
1357
  if ( biggest_dst_pack_id == src_ext[ :continue_dst_pack_id ] )
1363
1358
  # puts "debug1 2-1. tun recv fin1 -> all traffic received ? -> close src after write"
1364
1359
  set_is_closing( src_ext[ :src ] )
@@ -37,16 +37,13 @@ module Girl
37
37
  end
38
38
 
39
39
  dst_chunk_dir = File.join( proxyd_tmp_dir, 'dst.chunk' )
40
- tund_chunk_dir = File.join( proxyd_tmp_dir, 'tund.chunk' )
41
-
42
- unless Dir.exist?( proxyd_tmp_dir )
43
- Dir.mkdir( proxyd_tmp_dir )
44
- end
45
40
 
46
41
  unless Dir.exist?( dst_chunk_dir )
47
42
  Dir.mkdir( dst_chunk_dir )
48
43
  end
49
44
 
45
+ tund_chunk_dir = File.join( proxyd_tmp_dir, 'tund.chunk' )
46
+
50
47
  unless Dir.exist?( tund_chunk_dir )
51
48
  Dir.mkdir( tund_chunk_dir )
52
49
  end
@@ -908,7 +908,6 @@ module Girl
908
908
  dst_ext[ :biggest_src_pack_id ] = biggest_src_pack_id
909
909
  release_wmems( dst_ext, continue_dst_pack_id )
910
910
 
911
- # 接到对面已关闭,若最后一个包已经进写前,关闭dst
912
911
  if biggest_src_pack_id == dst_ext[ :continue_src_pack_id ]
913
912
  # puts "debug1 4-1. tund recv fin1 -> all traffic received ? -> close dst after write"
914
913
  set_is_closing( dst_ext[ :dst ] )
@@ -1,3 +1,3 @@
1
1
  module Girl
2
- VERSION = '0.71.0'.freeze
2
+ VERSION = '0.71.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: girl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.71.0
4
+ version: 0.71.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - takafan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-30 00:00:00.000000000 Z
11
+ date: 2020-07-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: while internet is evil, here's a girl.
14
14
  email: