Opened 12 years ago
Closed 12 years ago
#4690 closed Bugs (fixed)
boost::asio::ip::tcp::resolver fails to resolve query if service_name is empty
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | To Be Determined | Component: | asio |
Version: | Boost 1.44.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Documentation: http://www.boost.org/doc/libs/1_44_0/doc/html/boost_asio/reference/ip__basic_resolver_query/basic_resolver_query/overload3.html
service_name
A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.
If empty service_name is specified, resolver returns error. According to documentation, it should resolve to endpoint which will have port number of 0.
Test program attached.
My system: 2.6-RELEASE DragonFly v2.6.3.43.gb67e7-RELEASE Boost 1.44 from pkgsrc. I think all systems are affected.
Attachments (2)
Change History (9)
by , 12 years ago
comment:1 by , 12 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
gdb output of my program attached This is FreeBSD 9-CURRENT The same result under DragonFlyBSD, and some Linuxes
If it is not obvious to you from gdb output, what's the problem, I can try to look at boost sources when I have time. If you have suggestions how I can get more useful info, please let me know.
comment:3 by , 12 years ago
As you see from debug, empty servname is propagated down to getaddrinfo, which causes error. I think boost should replace empty string with something like "0" somewhere on the path to getaddrinfo.
I assume this is some sort of linux system? I cannot reproduce any such error on mine.
Using the following slightly modified version of your testcase:
I get the following output:
The problem may be specific to your target platform, in which case you will probably need to do some debugging to find out what is going on. Please reopen the bug if you find more information.