emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Service names on machines with bad service files


From: Lars Magne Ingebrigtsen
Subject: Service names on machines with bad service files
Date: Mon, 19 Sep 2011 11:30:22 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)

A Windows user has a problem with opening a connection using port
"imaps", which doesn't exist in that user's service file (or wherever
Windows stashes these things).

So I'm wondering whether there's any nice way to determine that that's
the situation and work around it.

(open-network-stream "hello" nil "gmail.com" "hello")
=>
Debugger entered--Lisp error: (error "gmail.com/hello Servname not supported 
for ai_socktype")

Possibilities are:

1) Don't use "imaps", but just say "993".  This would work, and it's
simple.  But is it rude to use port numbers instead of service names?
Are users supposed to be able to edit /etc/services and have "imaps" go
off somewhere else entirely?

2) Somehow determine that the OS doesn't know what "imaps" is, and use
"993" as a fallback.  I have no idea whether that's easy to do.

3) Make `open-network-stream' "know" about these mappings (a variable),
and if we get the right error message (i.e. the one above), we try again
using that mapping.  This would probably mean propagating RET
meaningfully (somehow) from `make-network-process' here:

      ret = getaddrinfo (SSDATA (host), portstring, &hints, &res);
      if (ret)
#ifdef HAVE_GAI_STRERROR
        error ("%s/%s %s", SSDATA (host), portstring, gai_strerror (ret));
#else
        error ("%s/%s getaddrinfo error %d", SSDATA (host), portstring, ret);
#endif
      immediate_quit = 0;

Thoughts?      

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]