Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6F3E9189AD for ; Tue, 8 Mar 2016 18:13:35 +0000 (UTC) Received: (qmail 98550 invoked by uid 500); 8 Mar 2016 18:13:34 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 98480 invoked by uid 500); 8 Mar 2016 18:13:34 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 98470 invoked by uid 99); 8 Mar 2016 18:13:34 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Mar 2016 18:13:34 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 4318418060A for ; Tue, 8 Mar 2016 18:13:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.298 X-Spam-Level: * X-Spam-Status: No, score=1.298 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=rowe-clan-net.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 6lQIZFZvOgCW for ; Tue, 8 Mar 2016 18:13:32 +0000 (UTC) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 9984A5FBCD for ; Tue, 8 Mar 2016 18:13:31 +0000 (UTC) Received: by mail-io0-f176.google.com with SMTP id n190so36377117iof.0 for ; Tue, 08 Mar 2016 10:13:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rowe-clan-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=QaSjMWnoE8B5NbVeMDCY/Xf29AW6VqH3sX3/KhQgZxQ=; b=N0aEng+Two3TcBCMNI/B3GP+aEwnYYhZ7KuicSWMx+YDwJt7btCZbp7AQRuvF/K6Zf wl7lFOKpiOqqmPrgveUPE0OeE228QGKq1IHpzrHotE+arvgpMXgYWDa8c3eEgdzp12Px FEgDO/hPW4121cod7BGP+x22zxhb6KLNjqflURr4DzE8FMCwMRMlNkzDaX1UPVqTnwHo ljIfE4JHJNXprnM1r7CyYQx6djLaN+xpkM6kYsieWEJP6HPP+gg7turLH7pcxBScumrf +ke98duVI+IBEJ/0xniu2+d3s1lz/NeD85Ler9d6VCrF29e/r92buQal0SwqiEwxYfJg i6qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=QaSjMWnoE8B5NbVeMDCY/Xf29AW6VqH3sX3/KhQgZxQ=; b=ZkUUWXEeSbzM+ybbMeplQB+3VmimjHRUWYWF73FFvI1wADp0J1ZFfTtoc6A0koihI7 R3X4yILPOnPqm50xFKVI/n53eUYBti8KgpUXZXBSEJLUQRvelyUCz/oM8nVIzNIRmnj9 0mbiGjUPaUpyfH5NjZw+jqjueV5WLxf1Ylg3JybOFf3SqhL8qF79ObczI6Ps5LPdt27P SwZtnm3cwGc6x6y1QW0Y2sywG85avU0nHo2cBaULmFN2Qj324DXeT9Ee9aLzRGNjjQtt LyL/pXsTQ7dh+JWfqaowt/BNtxBFNA6AI+41u20PgKHEEJxRXnqVQMHK59nMF0T20v/o H4Bg== X-Gm-Message-State: AD7BkJK/4/uQr4jJdBOmyLBtnULJZYiUEKe2h2QZMBeKxhY/EaX7x5HNjDoihRE5oiPrVQrb4DT9IkOFu5PICEju MIME-Version: 1.0 X-Received: by 10.107.27.205 with SMTP id b196mr28830580iob.163.1457460810894; Tue, 08 Mar 2016 10:13:30 -0800 (PST) Received: by 10.107.149.12 with HTTP; Tue, 8 Mar 2016 10:13:30 -0800 (PST) In-Reply-To: <06B0C8CC-8CE9-4617-A213-66D41BBFFF3D@c8h10n4o2.org.uk> References: <56DD68E5.2040309@redhat.com> <3B39341D-5870-4182-B8F3-33A794D38343@jaguNET.com> <56DDDC53.1060103@redhat.com> <56DE8D43.40505@redhat.com> <56DEACC7.3080007@redhat.com> <06B0C8CC-8CE9-4617-A213-66D41BBFFF3D@c8h10n4o2.org.uk> Date: Tue, 8 Mar 2016 12:13:30 -0600 Message-ID: Subject: Re: [PATCH] Add "FreeListen" to support IP_FREEBIND From: William A Rowe Jr To: httpd Content-Type: multipart/alternative; boundary=001a113fecfce86f19052d8d892e --001a113fecfce86f19052d8d892e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Mar 8, 2016 at 11:38 AM, Tim Bannister wrote: > On 8 Mar 2016, at 10:43, Jan Kalu=C5=BEa wrote: > > On 03/08/2016 10:25 AM, Yann Ylavic wrote: > >> On Tue, Mar 8, 2016 at 9:46 AM, Yann Ylavic > wrote: > >>> On Tue, Mar 8, 2016 at 9:28 AM, Jan Kalu=C5=BEa = wrote: > >>>> > >>>> I have chosen FreeListen over the flags > >>> > >>> FWIW, should be take the YAD path, I'd prefer ListenFree (over > >>> FreeListen) to emphasize on the "Listen directive family" with a > >>> prefix... > >> > >> Thinking more about this, I think I second Jim on the wish to have a > >> single Listen directive with some parameter like > >> "options=3Dfreebind,backlog:4095,reuseport,...". > > > > Thinking about right syntax for options... > > > > I would personally like something like "Listen [IP-address:]portnumber > [protocol] [option1] [option2] ...". Do we have list of supported protoco= ls > by Listen directive, or we support whatever protocol is there? > > > > If we have explicit list of protocols, then the protocols itself could > become an options. > > > > If not, can it be acceptable, that you always have to define protocol > when you wan to use options? > > That sounds fine too. > > One proviso comes with the idea of a single socket that can serve several > protocols. Think of WebSocket, because it is awkward: from an HTTP > point-of-view, the protocol is initially HTTP and then upgrades to > WebSocket; however, from a WebSocket point of view, the protocol is > WebSocket throughout with a preamble that also happens to resemble HTTP/1= .1. > > Using the first model, only one protocol need be specified (but it's not > clear which upgrades are valid for this socket). Using the second model, > the Listen directive needs a way for the admin to specify multiple > protocols. Maybe the answer is for that to be set in the Protocols > directive only? > Keep in mind, the protocol at this layer is simply the 'first responder' to react to an incoming connection, which in your case is the http (or h2?) protocol= . The truly critical aspect is what the kernel may do to defer the accept, whether that is looking for a complete http request (or h2c request, someday), or the server must instigate the first response (no incoming bytes from the client= ) in the case of ftp and similar, or whether this may be an ssl handshake. In the case of WebSocket, that module should be reacting to the headers, the initial protocol state is still HTTP/1.1 from httpd's perspective. > What should the Listen directive look like, ideally, for a > freebind-enabled socket that can be either HTTP or WebSocket, and needs t= o > specify options? Like this perhaps: > > Listen [2001:db8::a00:20ff:fea7:ccea]:1234 http/1.1,websocket > options=3Dfreebind Keep in mind this becomes a nightmare entanglement between optional, loadable support modules and the server core. The existing implementation of listen was flexible enough to provide new arbitrary protocols and resolv= e these at runtime. There is no reason to distinguish http/1.1, as we would have already done so (e.g. http/1.0, http/0.9 etc). It isn't necessary. If a websocket implementation is properly stacked on top of the core, there is no need for special-casing this interaction. It will be able to speak over http or https, or conceivably even over a single h2, or h2c stream, and wil= l support httpready or freebind mechanics. Re-implementing the handshake entirely in a WebSocket module seems like overkill, much like re-implementing the h2c handshake would be. --001a113fecfce86f19052d8d892e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On T= ue, Mar 8, 2016 at 11:38 AM, Tim Bannister <isoma@c8h10n4o2.org.uk> wrote:
On 8= Mar 2016, at 10:43, Jan Kalu=C5=BEa <jkaluza@redhat.com> wrote:
> On 03/08/2016 10:25 AM, Yann Ylavic wrote:
>> On Tue, Mar 8, 2016 at 9:46 AM, Yann Ylavic <ylavic.dev@gmail.com> wrote:
>>> On Tue, Mar 8, 2016 at 9:28 AM, Jan Kalu=C5=BEa <jkaluza@redhat.com> wrote:
>>>>
>>>> I have chosen FreeListen over the flags
>>>
>>> FWIW, should be take the YAD path, I'd prefer ListenFree (= over
>>> FreeListen) to emphasize on the "Listen directive family&= quot; with a
>>> prefix...
>>
>> Thinking more about this, I think I second Jim on the wish to have= a
>> single Listen directive with some parameter like
>> "options=3Dfreebind,backlog:4095,reuseport,...".
>
> Thinking about right syntax for options...
>
> I would personally like something like "Listen [IP-address:]portn= umber [protocol] [option1] [option2] ...". Do we have list of supporte= d protocols by Listen directive, or we support whatever protocol is there?<= br> >
> If we have explicit list of protocols, then the protocols itself could= become an options.
>
> If not, can it be acceptable, that you always have to define protocol = when you wan to use options?

That sounds fine too.

One proviso comes with the idea of a single socket that can serve several p= rotocols. Think of WebSocket, because it is awkward: from an HTTP point-of-= view, the protocol is initially HTTP and then upgrades to WebSocket; howeve= r, from a WebSocket point of view, the protocol is WebSocket throughout wit= h a preamble that also happens to resemble HTTP/1.1.

Using the first model, only one protocol need be specified (but it's no= t clear which upgrades are valid for this socket). Using the second model, = the Listen directive needs a way for the admin to specify multiple protocol= s. Maybe the answer is for that to be set in the Protocols directive only?<= br>

Keep in mind, the protocol at this laye= r is simply the 'first responder' to react
to an incoming= connection, which in your case is the http (or h2?) protocol.
Th= e truly critical aspect is what the kernel may do to defer the accept, whet= her
that is looking for a complete http request (or h2c request, = someday), or the
server must instigate the first response (no inc= oming bytes from the client)
in the case of ftp and similar, or w= hether this may be an ssl handshake.

In the case o= f WebSocket, that module should be reacting to the headers,
the i= nitial protocol state is still HTTP/1.1 from httpd's perspective.
=
=C2=A0
What should the Listen directive look like, ideally, for a freebind-enabled= socket that can be either HTTP or WebSocket, and needs to specify options?= Like this perhaps:

Listen [2001:db8::a00:20ff:fea7:ccea]:1234 http/1.1,websocket options=3Dfre= ebind

Keep in mind this becomes a nightmare= entanglement between optional,
loadable support modules and the = server core.=C2=A0 The existing implementation
of listen was flex= ible enough to provide new arbitrary protocols and resolve
these = at runtime.=C2=A0 There is no reason to distinguish http/1.1, as we would
have already done so (e.g. http/1.0, http/0.9 etc).=C2=A0 It isn&#= 39;t necessary.

If a websocket implementation is p= roperly stacked on top of the core, there
is no need for special-= casing this interaction.=C2=A0 It will be able to speak over
http= or https, or conceivably even over a single h2, or h2c stream, and will
support httpready or freebind mechanics.

R= e-implementing the handshake entirely in a WebSocket module seems
like overkill, much like re-implementing the h2c handshake would be.
=

=C2=A0
--001a113fecfce86f19052d8d892e--