Tcl Library Source Code

View Ticket
Login
Ticket UUID: 7e0f5ae0f69146b1d73f450a7c1938210b429820
Title: dns package
Type: Bug Version: 1.3.4
Submitter: anonymous Created on: 2015-03-07 17:00:30
Subsystem: dns Assigned To: aku
Priority: 8 Severity: Severe
Status: Closed Last Modified: 2015-04-15 19:20:01
Resolution: Fixed Closed By: aku
    Closed on: 2015-04-15 19:20:01
Description:
hi , i just tried dns package 1.3.4 with these examples http://noel.feld.cvut.cz/vyu/ocs/ActiveTcl8.4.2.0-html/tcllib/dns.html
but it looks like it doesn't work properly to me.

% package require dns
1.3.4
% set tok [dns::resolve www.tcl.tk]
::dns::1
% dns::status $tok
connect
% dns::address $tok
can't read "state(reply)": no such element in array
% dns::name $tok
can't read "state(reply)": no such element in array
% dns::cleanup $tok
% info pa
8.6.3
User Comments: aku added on 2015-04-15 19:20:01:

I can now confirm that executing a

vwait $tok

just after the dns::resolve command fixes the issue, for dns version 1.3.3. For 1.3.4 adding the vwait is a workaround as well.

So, issue reproduced here.

Looking into the version 1.3.4 code there should be some 'wait'ing happen automatically. But apparently not, or not correctly.

Oh. The chosen protocol is UDP (*), and the auto-wait I see in dns::resolve is limited to TCP.

(Ad *): I have the udp package installed and it got loaded automatically (as per output of [info loaded]). I now suspect that you have the same configuration, with the udp package (or ceptcl) available.

Making that general ... is a fix. Basically, the vwait of the workaround is done internally, and automatically when -commmand is NOT set, regardless of transport. Very unclear why this was limited to tcp ...

Hm ... Jan 30, 2003, commit [7109bd29408a8efb]. This added the udp support, and apparently missed the implication of having the auto-wait not extended to it.

Fixed with revision [ca36641e9f].

Pushed.

Version bumped to 1.3.5.


aku added on 2015-04-14 23:35:52:
Hm.

I suspect that the event-loop has to be running for this to work.

That said, the docs definitely do not mention that, and these are the examples from the docs too.

This needs a check.

Heh. While the package has a testsuite this (IMHO core) functionality of it is not covered :(

Could possibly be done using Google's nameservers.

That begs the question, do you possibly have no nameservers set up ?
(Which platform ?)

The output of the [::dns::nameservers] command could help here to see what the package thinks it has available.