Open svenXY opened 10 years ago
I believe the attached patch will add the possibility to either set is with a res.packet_size = xxx or in the Resolver() constructor.
Cheers, Sven
--- lib/ruby/gems/1.8/gems/net-dns-0.8.0/lib/net/dns/resolver.rb.orig 2014-04-15 16:14:13.473223887 +0200
+++ lib/ruby/gems/1.8/gems/net-dns-0.8.0/lib/net/dns/resolver.rb 2014-04-15 16:31:08.989885451 +0200
@@ -392,6 +392,20 @@
@config[:packet_size]
end
+ # Set the defined size of packets.
+ def packet_size=(arg)
+ case arg
+ when String
+ @config[:packet_size] = arg.to_i
+ @logger.info "Packet size changed to value #{@config[:packet_size].inspect}"
+ when Fixnum
+ @config[:packet_size] = arg
+ @logger.info "Packet size changed to value #{@config[:packet_size].inspect}"
+ else
+ raise ArgumentError, "Wrong argument format, neither String that converts to Int, not Integer"
+ end
+
# Get the port number to which the resolver sends queries.
#
# puts "Sending queries to port #{res.port}"
I fixed this in my fork here: https://github.com/mordocai/net-dns/issues/1. The fix should be in the v0.8.3 release later this week along with many other fixes
Hi,
I'm using a simple
This fails with
Now, when setting a :packet_size of say 2048 in resolver.rb, all is fine. Unfortunately, :packet_size is not settable. Could this be changed by any chance?
Thanks and cheers, Sven