From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 3D4DB1F4B4 for ; Tue, 8 Dec 2020 23:48:28 +0000 (UTC) Received: by mail-qv1-xf32.google.com with SMTP id a13so129738qvv.0 for ; Tue, 08 Dec 2020 15:48:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blakewilliams-me.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc:reply-to :content-transfer-encoding:message-id:references:to; bh=xj72ygRenBqWxd3OlhdMSoE+zxqi9gjdkFFsrJv2lEU=; b=z1mmhtNbCS6HPsR/tdregRABZmE6S2n1JOo2tQy/K3hcr70ftqkLG1ruV8wiHQOZZr HAzLjdvi3ykJDADMXyDyx0UZNJVryEcCayi5aWk4j1kJCLVh8xcnd460UQu2+KaQAIp1 XDdzZ4KAu4CYTO+OGh4KQpdeQSKQB823pGL4Jxfr1WF+8kFze5CEgkiF9NZNefVXzE+a IdX3w7V5HTaOpzo5c3xbFUPjocEo3o+/KnyRQKeS4aff68Y+v/WPFDWRiYeL6T+gFNio Ui4m7qP8HN3WGdp1JLvy4VMjPnvRIGcN674NTfFTqDrzO4gO5eAbsIO1htlMnSeGaj44 8qCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :reply-to:content-transfer-encoding:message-id:references:to; bh=xj72ygRenBqWxd3OlhdMSoE+zxqi9gjdkFFsrJv2lEU=; b=fhLA0N46LnMuFyhw5lNLkDZzXJuZNlSoAtX0BIe0uUdRFOdq3aIr9M/OkbWfD3hbZb P/QriaCqTR5aBVsNbWov20Cno3q4KJ0rlt/CS9yL/BN/K0z2bd8tcnyVStYLX+a1Lj8b BbdF1lDT/2/BzUv7yCssd+G7dXi9OKXk+6U04RIILFJqjOvrqNjpAzDuHjZPNjMyINb6 z1Bc9R25hKvQ5c+It4m9WN78j+nUDWudUBDZR/OJ8MW/286kdmdkQco8wGsEllRGNBo5 YmPfVqQ/MQQm1u7jfjT4G2LwTFEfCkkW7jkgpz8l+V8HTJiwMDZJDevUTAz9uWAayn3y r2rg== X-Gm-Message-State: AOAM530jD9ffb4idq2tNBGS5Si1E8kwKBW8ZFam1D5eUg9UsNsM0UW2X CQndOmddhnyguBe7mzPeRQpSfA== X-Google-Smtp-Source: ABdhPJyNbdnPn3CBOUSAfCGRFnfbnpF4ihjm+OX+Jcie2E8gQfdkvRaVA/e4eVeIDtenJriwrBl5Rw== X-Received: by 2002:ad4:4e47:: with SMTP id eb7mr644048qvb.39.1607471307408; Tue, 08 Dec 2020 15:48:27 -0800 (PST) Received: from [192.168.1.246] (inet-64-112-182-228.bos.netblazr.com. [64.112.182.228]) by smtp.gmail.com with ESMTPSA id a9sm224104qkk.39.2020.12.08.15.48.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2020 15:48:26 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: [PATCH] Add rack.after_reply functionality From: Blake Williams In-Reply-To: <20201208224631.GA13148@dcvr> Date: Tue, 8 Dec 2020 18:48:25 -0500 Cc: unicorn-public@yhbt.net Reply-To: 20201208224631.GA13148@dcvr Content-Transfer-Encoding: quoted-printable Message-Id: References: <9873E53C-04D3-4759-9678-CA17DBAEF7B7@blakewilliams.me> <20201208224631.GA13148@dcvr> To: Eric Wong X-Mailer: Apple Mail (2.3608.120.23.2.4) List-Id: > In the past, I've used response_body.close in middleware for > similar things, and nowadays Rack::BodyProxy exists in rack, too. >=20 > So I'm a little skeptical if this is actually needed, but it's > probably too late to do anything about: The first approach we took uses Rack::Events, which I believe is using Rack::BodyProxy under the hood. We ran into an issue where all but the last line of the response is written and the connection isn=E2=80=99t actually closed yet when the callbacks are called. > Citation(s) needed. Also, are there any proposal(s) to get this > into the Rack specification? Not that I=E2=80=99m aware of. But I agree that it and early_hints could = both be good additions to the spec. > I'll have to squash the following in, since an exception can be > raised if a client truncates the request: Good catch, sounds good to me. > Everything else seems OK. Thanks. Awesome, thanks for the quick reply/feedback.=