[freetds] idea: eliminate port/instance
James K. Lowden
jklowden at freetds.org
Mon Apr 6 22:04:17 EDT 2009
Frediano Ziglio wrote:
> 2009/4/4 James K. Lowden <jklowden at freetds.org>:
> > 1. If port is numeric, it's a port.
> > 2. If port is non-numeric, try looking up the port with
> > getservbyname(3).
> > 3. If getservbyname(3) fails, look up the port using the UDP instance
> > protocol.
> I personally don't like this way cause you can't specify a named
> instance if this instance correspond to a service entry.
Well, I doubt that's a very likely conflict. But I guess you're right.
We'll continue to ignore /etc/services.
> Perhaps it would be useful to always return error if port and instance
> are both specified.
Yeah, but how? tds_read_config_info() returns TDSCONNECTION*. We'd have
to stuff an error code in the structure.
OK, maybe not fprintf(stderr...). Maybe tdserror() instead. At least
tsql would print the message, as would any other properly written
application. We'll have to invent a few new error codes, though.
More information about the FreeTDS