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 206831860B for ; Fri, 11 Dec 2015 08:56:16 +0000 (UTC) Received: (qmail 29639 invoked by uid 500); 11 Dec 2015 08:56:15 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 29569 invoked by uid 500); 11 Dec 2015 08:56:15 -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 29559 invoked by uid 99); 11 Dec 2015 08:56:15 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Dec 2015 08:56:15 +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 8DDC8180B5A for ; Fri, 11 Dec 2015 08:56:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.653 X-Spam-Level: X-Spam-Status: No, score=-0.653 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-0.554, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=greenbytes.de Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id f-jZw0nYj8qQ for ; Fri, 11 Dec 2015 08:56:06 +0000 (UTC) Received: from mail.greenbytes.de (mail.greenbytes.de [217.91.35.233]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 526562026F for ; Fri, 11 Dec 2015 08:56:05 +0000 (UTC) Received: from [192.168.1.42] (unknown [217.91.35.233]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail.greenbytes.de (Postfix) with ESMTPSA id 98A5815A047F for ; Fri, 11 Dec 2015 09:56:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=greenbytes.de; s=mail; t=1449824164; bh=VCWks4OSTz2unNu0hIJqtm5w+NDq2v99dSy6rP4YnDg=; h=Subject:From:In-Reply-To:Date:References:To:From; b=eKLxaggtwFJLdmrTd4Rs+SZGVx/67r/528OdTSFyktilbJPrveVqtrYal8TqYTuJ9 1UuG3sEkauQDhjFqkvV4sJaYCz/5v1UDnNs5T/D+oRBjQKDuyiR2oPzfn38p2TS5cT +UtRSTM8XFGGOh+HofEYTGiqI53XLpSwf/wsrQvY= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: Upgrade Summary From: Stefan Eissing In-Reply-To: <5669FA25.3020100@gmail.com> Date: Fri, 11 Dec 2015 09:56:08 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <90C59262-7253-4862-A430-F0510A3D854C@greenbytes.de> References: <56660896.c74fc20a.15f56.0ebd@mx.google.com> <56660B43.2060507@gmail.com> <6B13DF2B-0586-42BB-B62F-59A7638B697D@greenbytes.de> <13FE9E7F-9620-4BF9-8EA4-57A6314D66BF@greenbytes.de> <9CCEFD7E-9ED3-4ED1-8F58-2134DD5310F9@gbiv.com> <566887B5.2080705@gmail.com> <5668CC4F.109@gmail.com> <5668EFDB.1050900@gmail.com> <5669FA25.3020100@gmail.com> To: dev@httpd.apache.org X-Mailer: Apple Mail (2.3112) Jacob, thanks for the code! I will let this and my pseudo code stew over = the weekend and then probably next week start the changes to upgrade = handling. //Stefan > Am 10.12.2015 um 23:18 schrieb Jacob Champion : >=20 > Okay, I finally have actual code to share. This is the original = experimental pre_protocol_switch hook that Stefan and I were talking = about a while ago [1], rebased onto 2.4.18. The two patches are = available at >=20 > https://github.com/jchampio/httpd/commits/dev/websocket-protocols >=20 > It is *not* an implementation of Stefan's most recent pseudocode (a = primary difference is that his proposal does the filter + upgrade in one = hook instead of two), and it doesn't solve many of the use cases that = you've already agreed must be handled: >=20 > - 100-continue is not handled correctly > - the incoming request body is not correctly dealt with > - there is only one switch point, at the handler stage > - etc. >=20 > *But* it is a working implementation from mod_websocket's point of = view, so I offer it up primarily for informational purposes. The module = making use of the new hook is available at >=20 > = https://github.com/jchampio/apache-websocket/blob/dev/hook/mod_websocket.c= >=20 > You might be most interested in the = mod_websocket_pre_protocol_switch() implementation (line 1627), which = contains the pre-upgrade checks I need to do to remain compliant with = RFC 6455. >=20 > =3D=3D Asides =3D=3D >=20 > 1) The current Protocols API does not correctly ignore upgrades from = HTTP/1.0 requests; the latest commit to my experimental branch patched = this. >=20 > 2) As Stefan and I discussed in [1], Upgrade header values are = case-sensitive (correct?), but the RFC 6455 declares that servers should = respond to any protocol that's a case-insensitive match for "websocket". = To make matters worse, the official IANA upgrade token is "WebSocket", = but the RFC uses "websocket" throughout. I have seen both used in the = wild (Autobahn uses WebSocket; Firefox uses websocket), and I'm not sure = what the right way to resolve this is. >=20 > Hope this helps. Again, I don't expect this to actually be part of the = final solution, but sometimes it's nice to see code. >=20 > --Jacob >=20 > [1] = https://mail-archives.apache.org/mod_mbox/httpd-dev/201509.mbox/%3C55FF85F= 0.8040106@gmail.com%3E