lib/rubydns/resolver.rb in rubydns-0.6.7 vs lib/rubydns/resolver.rb in rubydns-0.7.0
- old
+ new
@@ -17,10 +17,11 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
require 'rubydns/message'
+require 'rubydns/binary_string'
module RubyDNS
class InvalidProtocolError < StandardError
end
@@ -115,10 +116,11 @@
def run!
try_next_server!
end
+ # Once either an exception or message is received, we update the status of this request.
def process_response!(response)
finish_request!
if Exception === response
@logger.warn "[#{@message.id}] Failure while processing response #{exception}!" if @logger
@@ -140,9 +142,10 @@
end
end
private
+ # Closes any connections and cancels any timeout.
def finish_request!
cancel_timeout
# Cancel an existing request if it is in flight:
if @request
\ No newline at end of file