girl 0.74.0 → 0.75.0

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: '094ccee84b18d04b1061a8c29663acabd184ac524437b2347b34a30cb14a5880'
4
- data.tar.gz: 37ef3aa95152d92cf36609eb32bb6658780fea3927ea1b30e062029e7ef1de10
3
+ metadata.gz: ac2f8ddb303a57e5c898754c88710847686e84b3ef406c053ef926424da78e2b
4
+ data.tar.gz: 4506688a3176c9effe1804e3d247379a79d96906e4c8417d6f0660ecaa082141
5
5
  SHA512:
6
- metadata.gz: '095868fe1a0d43435db1f8c461f09abd28114cac5f99494a02c5062ede1c476589b623c453e852ca2674727ff9e371c17d5ddc1cce46a408a085ef71c75fcaeb'
7
- data.tar.gz: 7a1190902d3f2ef39965f2154d91ab15cabe63adae1613a3ad745a14cd2f46b3c70a3f06174dbda5929af6dd57970a9ca5085c521fd00dcefeaf9009a6fbad16
6
+ metadata.gz: 34559a0ab1375eb9b07bab0fbea3d762e94ac7282ed8868e3ab672aa816f87f6edc3273b1204c565c189201bd2a49e993477a6da525b472e95c18b804526323e
7
+ data.tar.gz: d7580c92099e6974287fbc8384010d3b5ed34966832ff9c1a0bda42cdeac923768fa431b84c83dee8926c3b4bc8f2b0761bdb9a4a14212870a2dde3abb89f338
@@ -601,6 +601,23 @@ module Girl
601
601
  end
602
602
  end
603
603
 
604
+ ##
605
+ # send data
606
+ #
607
+ def send_data( tun, data, to_addr )
608
+ begin
609
+ tun.sendmsg( data, 0, to_addr )
610
+ rescue IO::WaitWritable, Errno::EINTR
611
+ return false
612
+ rescue Errno::EHOSTUNREACH, Errno::ENETUNREACH, Errno::ENETDOWN => e
613
+ puts "#{ Time.new } #{ e.class }, close tun"
614
+ close_tun( tun )
615
+ return false
616
+ end
617
+
618
+ true
619
+ end
620
+
604
621
  ##
605
622
  # close src
606
623
  #
@@ -837,13 +854,7 @@ module Girl
837
854
  while @tun_info[ :ctlmsgs ].any?
838
855
  to_addr, data = @tun_info[ :ctlmsgs ].first
839
856
 
840
- begin
841
- tun.sendmsg( data, 0, to_addr )
842
- rescue IO::WaitWritable, Errno::EINTR
843
- return
844
- rescue Errno::EHOSTUNREACH, Errno::ENETUNREACH => e
845
- puts "#{ Time.new } #{ e.class }, close tun"
846
- close_tun( tun )
857
+ unless send_data( tun, data, to_addr )
847
858
  return
848
859
  end
849
860
 
@@ -859,13 +870,7 @@ module Girl
859
870
  data = src_ext[ :wmems ][ pack_id ]
860
871
 
861
872
  if data
862
- begin
863
- tun.sendmsg( data, 0, @tun_info[ :tund_addr ] )
864
- rescue IO::WaitWritable, Errno::EINTR
865
- return
866
- rescue Errno::EHOSTUNREACH, Errno::ENETUNREACH => e
867
- puts "#{ Time.new } #{ e.class }, close tun"
868
- close_tun( tun )
873
+ unless send_data( tun, data, @tun_info[ :tund_addr ] )
869
874
  return
870
875
  end
871
876
  end
@@ -931,13 +936,7 @@ module Girl
931
936
 
932
937
  data = [ [ pack_id, src_id ].pack( 'Q>Q>' ), data ].join
933
938
 
934
- begin
935
- tun.sendmsg( data, 0, @tun_info[ :tund_addr ] )
936
- rescue IO::WaitWritable, Errno::EINTR
937
- return
938
- rescue Errno::EHOSTUNREACH, Errno::ENETUNREACH => e
939
- puts "#{ Time.new } #{ e.class }, close tun"
940
- close_tun( tun )
939
+ unless send_data( tun, data, @tun_info[ :tund_addr ] )
941
940
  return
942
941
  end
943
942
 
@@ -415,6 +415,23 @@ module Girl
415
415
  end
416
416
  end
417
417
 
418
+ ##
419
+ # send data
420
+ #
421
+ def send_data( tund, data, to_addr )
422
+ begin
423
+ tund.sendmsg( data, 0, to_addr )
424
+ rescue IO::WaitWritable, Errno::EINTR
425
+ return false
426
+ rescue Errno::EHOSTUNREACH, Errno::ENETUNREACH, Errno::ENETDOWN => e
427
+ puts "#{ Time.new } #{ e.class }, close tund"
428
+ close_tund( tund )
429
+ return false
430
+ end
431
+
432
+ true
433
+ end
434
+
418
435
  ##
419
436
  # close dst
420
437
  #
@@ -603,9 +620,7 @@ module Girl
603
620
  while tund_info[ :ctlmsgs ].any?
604
621
  data = tund_info[ :ctlmsgs ].first
605
622
 
606
- begin
607
- tund.sendmsg( data, 0, tund_info[ :tun_addr ] )
608
- rescue IO::WaitWritable, Errno::EINTR
623
+ unless send_data( tund, data, tund_info[ :tun_addr ] )
609
624
  return
610
625
  end
611
626
 
@@ -621,9 +636,7 @@ module Girl
621
636
  data = dst_ext[ :wmems ][ pack_id ]
622
637
 
623
638
  if data
624
- begin
625
- tund.sendmsg( data, 0, tund_info[ :tun_addr ] )
626
- rescue IO::WaitWritable, Errno::EINTR
639
+ unless send_data( tund, data, tund_info[ :tun_addr ] )
627
640
  return
628
641
  end
629
642
  end
@@ -689,9 +702,7 @@ module Girl
689
702
 
690
703
  data = [ [ pack_id, dst_local_port ].pack( 'Q>n' ), data ].join
691
704
 
692
- begin
693
- tund.sendmsg( data, 0, tund_info[ :tun_addr ] )
694
- rescue IO::WaitWritable, Errno::EINTR
705
+ unless send_data( tund, data, tund_info[ :tun_addr ] )
695
706
  return
696
707
  end
697
708
 
@@ -1,3 +1,3 @@
1
1
  module Girl
2
- VERSION = '0.74.0'.freeze
2
+ VERSION = '0.75.0'.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.74.0
4
+ version: 0.75.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - takafan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-20 00:00:00.000000000 Z
11
+ date: 2020-07-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: while internet is evil, here's a girl.
14
14
  email: