unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Service names on machines with bad service files
@ 2011-09-19  9:30 Lars Magne Ingebrigtsen
  2011-09-19  9:40 ` Lars Magne Ingebrigtsen
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-19  9:30 UTC (permalink / raw)
  To: emacs-devel

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/




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-09-26 19:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-19  9:30 Service names on machines with bad service files Lars Magne Ingebrigtsen
2011-09-19  9:40 ` Lars Magne Ingebrigtsen
2011-09-19 10:07   ` Julien Danjou
2011-09-19 19:07   ` Chong Yidong
2011-09-19 20:25     ` chad
2011-09-19 19:32 ` Andy Wingo
2011-09-25 11:40   ` Ted Zlatanov
2011-09-25 11:38 ` Ted Zlatanov
2011-09-26 17:01   ` Lars Magne Ingebrigtsen
2011-09-26 19:27     ` Ted Zlatanov
2011-09-26 19:33       ` Lars Magne Ingebrigtsen
2011-09-26 19:49         ` Ted Zlatanov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).