strophe / libstrophe

A simple, lightweight C library for writing XMPP clients
http://strophe.im/libstrophe
Other
401 stars 163 forks source link

DNS lookup failing on Cygwin #95

Closed boothj5 closed 8 years ago

boothj5 commented 8 years ago
$ ./examples/basic.exe chanleemoon@jabber.org <password>
xmpp DEBUG sock_connect() to hermes2jabber.org:5222 returned -1
xmpp DEBUG sock_connect() to hermes2v6jabber.org:5222 returned -1

It seems the . is missing in between the host name and domain. Manually passing the server hermes2.jabber.org connects successfully.

boothj5 commented 8 years ago

Just in case this helps, the same error appears using libmesode which has all of the _WIN32 code removed.

Will attach the output of ./res_query_dump.exe when I get a chance.

pasis commented 8 years ago

Should be fixed in https://github.com/strophe/libstrophe/commit/c6aaa96dcb06cf49646f4c307088332547f07153

boothj5 commented 8 years ago

Can confirm this is fixed, the basic example now connects, as does chat client Profanity when built against latest.

Result of the dump on Cygwin:

$ ./res_query_dump.exe jabber.org
/* res_query("_xmpp-client._tcp.jabber.org", C_IN, T_SRV, ...) */
static const unsigned char data[] = {
    0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00,    // ..........
    0x00, 0x00, 0x0c, 0x5f, 0x78, 0x6d, 0x70, 0x70, 0x2d, 0x63,    // ..._xmpp-c
    0x6c, 0x69, 0x65, 0x6e, 0x74, 0x04, 0x5f, 0x74, 0x63, 0x70,    // lient._tcp
    0x06, 0x6a, 0x61, 0x62, 0x62, 0x65, 0x72, 0x03, 0x6f, 0x72,    // .jabber.or
    0x67, 0x00, 0x00, 0x21, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x21,    // g..!.....!
    0x00, 0x01, 0x00, 0x00, 0x01, 0x9e, 0x00, 0x12, 0x00, 0x1f,    // ..........
    0x00, 0x1e, 0x14, 0x66, 0x09, 0x68, 0x65, 0x72, 0x6d, 0x65,    // ...f.herme
    0x73, 0x32, 0x76, 0x36, 0xc0, 0x1e, 0xc0, 0x0c, 0x00, 0x21,    // s2v6.....!
    0x00, 0x01, 0x00, 0x00, 0x01, 0x9e, 0x00, 0x10, 0x00, 0x1e,    // ..........
    0x00, 0x1e, 0x14, 0x66, 0x07, 0x68, 0x65, 0x72, 0x6d, 0x65,    // ...f.herme
    0x73, 0x32, 0xc0, 0x1e,                                        // s2..
};