Identifying the real display server

Thiago Macieira thiago at kde.org
Mon Apr 13 16:41:12 PDT 2015


On Monday 13 April 2015 23:31:26 Mattias Andrée wrote:
> > As for x11, it is covered just fine with x11::0.
> 
> But that is not convered by the generic syntax for URL:s.

Yes it is. RFC 3986, Appendix A has the ABNF for URIs.

Decoding (only the relevant parts):
   URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
   scheme        = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )

   hier-part     = "//" authority path-abempty
                 / path-absolute
                 / path-rootless
                 / path-empty

   path-rootless = segment-nz *( "/" segment )

   segment-nz    = 1*pchar
   pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
   unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"

So it decodes to
	scheme 	"x11"
	":"		":"
	hier-part	":0"
	path-rootless	":0"
	segment-nz	":0"

This is the same expansion that allows for mailto:xdg at lists.freedesktop.org.

> It would have to be x11:///0 for :0 and x11:///0/1
> or (less preferable) x11:///0.1 for :0.1.
> And x11://localhost/0.1 or x11://localhost/0/1
> for localhost:0.1
> The generic syntax is
> scheme://[[username[:password]@]host[:port]][/[path][?query][#fragment]]
> And we must assume that libraries will parse <port> as an

Your syntax is incorrect. The authority and the double slash are optional. And 
even when they are present, the expansion for authority → host → reg-name 
allows for it to be empty too:

   reg-name      = *( unreserved / pct-encoded / sub-delims )

If that weren't the case, file:///etc/passwd wouldn't be valid.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358



More information about the xdg mailing list