io-endpoint 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/io/endpoint/composite_endpoint.rb +10 -0
- data/lib/io/endpoint/version.rb +1 -1
- data/lib/io/endpoint/wrapper.rb +5 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 80426a4ee162f18eb945d9ce2fd75bde3cf23e9d5bb8333faa2ff627f6b87a23
         | 
| 4 | 
            +
              data.tar.gz: 37d79a722c7371c993476fc3061d5c63e7c10f6051dcdc5215d079bac88d5965
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b89867de53a90531d5b9f1484d529e3f556b6ac75b30b6174c2bfc7f3c0199b80208b7699f6998d8c61b8e0eef666b72f66e10377090b566ae4058b4d229859d
         | 
| 7 | 
            +
              data.tar.gz: a7c98d22e20fd3cdd558b8266b92bfb88fc110c6f0a144769daf58b505447cc0e0fff04a4b07d0bbe490327a3a46d5f7b353f436cb72651040cae8e350523f54
         | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | Binary file | 
| @@ -10,9 +10,19 @@ module IO::Endpoint | |
| 10 10 | 
             
            	class CompositeEndpoint < Generic
         | 
| 11 11 | 
             
            		def initialize(endpoints, **options)
         | 
| 12 12 | 
             
            			super(**options)
         | 
| 13 | 
            +
            			
         | 
| 14 | 
            +
            			# If any options were provided, propagate them to the endpoints:
         | 
| 15 | 
            +
            			if options.any?
         | 
| 16 | 
            +
            				endpoints = endpoints.map{|endpoint| endpoint.with(**options)}
         | 
| 17 | 
            +
            			end
         | 
| 18 | 
            +
            			
         | 
| 13 19 | 
             
            			@endpoints = endpoints
         | 
| 14 20 | 
             
            		end
         | 
| 15 21 |  | 
| 22 | 
            +
            		def with(**options)
         | 
| 23 | 
            +
            			self.class.new(endpoints.map{|endpoint| endpoint.with(**options)}, **@options.merge(options))
         | 
| 24 | 
            +
            		end
         | 
| 25 | 
            +
            		
         | 
| 16 26 | 
             
            		attr :endpoints
         | 
| 17 27 |  | 
| 18 28 | 
             
            		# The number of endpoints in the composite endpoint.
         | 
    
        data/lib/io/endpoint/version.rb
    CHANGED
    
    
    
        data/lib/io/endpoint/wrapper.rb
    CHANGED
    
    | @@ -153,7 +153,8 @@ module IO::Endpoint | |
| 153 153 |  | 
| 154 154 | 
             
            		# Bind to a local address and accept connections in a loop.
         | 
| 155 155 | 
             
            		def accept(server, timeout: nil, linger: nil, **options, &block)
         | 
| 156 | 
            -
            			 | 
| 156 | 
            +
            			# Ensure we use a `loop do ... end` so that state is not leaked between iterations:
         | 
| 157 | 
            +
            			loop do
         | 
| 157 158 | 
             
            				socket, address = server.accept
         | 
| 158 159 |  | 
| 159 160 | 
             
            				if linger
         | 
| @@ -175,6 +176,9 @@ module IO::Endpoint | |
| 175 176 | 
             
            						end
         | 
| 176 177 | 
             
            					end
         | 
| 177 178 |  | 
| 179 | 
            +
            					# It seems like OpenSSL doesn't return the address of the peer when using `accept`, so we need to get it from the socket:
         | 
| 180 | 
            +
            					address ||= socket.remote_address
         | 
| 181 | 
            +
            					
         | 
| 178 182 | 
             
            					yield socket, address
         | 
| 179 183 | 
             
            				end
         | 
| 180 184 | 
             
            			end
         | 
    
        data.tar.gz.sig
    CHANGED
    
    | Binary file | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: io-endpoint
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.13.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Samuel Williams
         | 
| @@ -37,7 +37,7 @@ cert_chain: | |
| 37 37 | 
             
              Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
         | 
| 38 38 | 
             
              voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
         | 
| 39 39 | 
             
              -----END CERTIFICATE-----
         | 
| 40 | 
            -
            date: 2024- | 
| 40 | 
            +
            date: 2024-08-27 00:00:00.000000000 Z
         | 
| 41 41 | 
             
            dependencies: []
         | 
| 42 42 | 
             
            description:
         | 
| 43 43 | 
             
            email:
         | 
    
        metadata.gz.sig
    CHANGED
    
    | Binary file |