Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZd4z-00040I-Ml for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Nov 2020 16:53:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kZd4x-0001Cu-Qm for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Nov 2020 16:53:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZcl1-0007Mp-3p for pgsql-hackers@lists.postgresql.org; Mon, 02 Nov 2020 16:32:35 +0000 Received: from forwardcorp1o.mail.yandex.net ([95.108.205.193]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZcky-00052o-Ia for pgsql-hackers@lists.postgresql.org; Mon, 02 Nov 2020 16:32:34 +0000 Received: from iva8-d077482f1536.qloud-c.yandex.net (iva8-d077482f1536.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:2f26:0:640:d077:482f]) by forwardcorp1o.mail.yandex.net (Yandex) with ESMTP id 83B8B2E14D5; Mon, 2 Nov 2020 19:32:30 +0300 (MSK) Received: from localhost (localhost [::1]) by iva8-d077482f1536.qloud-c.yandex.net (mxbackcorp/Yandex) with ESMTP id pLQMphoZpJ-WUwuSpaE; Mon, 02 Nov 2020 19:32:30 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1604334750; bh=AqdNlm2Mi1VbDcEjeErdVGmGZGSoWF3v16t7IYS0qH0=; h=Cc:Subject:Date:References:To:From:Message-Id; b=evpyz4U+aLhMDoxkq+CmEVEdgkui6TqPKM07gFU3FLgdv1s7n5OslhSnf3YBxG0vo X/+obND74OgVnqPDvzb7gGILqyu3o8uG9jl4WtjCZNv6Vcvo6H5Erz8Kg1yGX2Y31J gLCPjULQ6ZUw45hwha4ctCdVnZnqd2cFOLg9EGGk= Authentication-Results: iva8-d077482f1536.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru X-Yandex-Sender-Uid: 1120000000271597 X-Yandex-Avir: 1 Received: from iva8-d077482f1536.qloud-c.yandex.net (iva8-d077482f1536.qloud-c.yandex.net [2a02:6b8:c0c:2f26:0:640:d077:482f]) by iva4-81f2a0d63507.qloud-c.yandex.net with LMTP id mO0tNPadWb-ijhDOUts for ; Mon, 02 Nov 2020 19:32:20 +0300 Received: by iva8-edafde7c849c.qloud-c.yandex.net with HTTP; Mon, 02 Nov 2020 19:32:20 +0300 From: Daniil Zakhlystov To: Konstantin Knizhnik Cc: Andres Freund , PostgreSQL Hackers , Andrey M. Borodin , "o.bartunov@postgrespro.ru" References: <74F0A385-6ED4-4EA7-9498-1A8527F16472@yandex-team.ru> <22446ba0-058d-624a-a679-edc0215a56c8@postgrespro.ru> <20201028192712.xj2qneyb3fvmjm6c@alap3.anarazel.de> <3b1d2752-b7b5-db39-84c9-4ff024041fff@postgrespro.ru> <20201030210308.54jjmnvhspk6p7cb@alap3.anarazel.de> <0ae2162b-818f-6a6d-cca6-ee4e73733e8e@postgrespro.ru> <67498D86-006D-4D56-85E2-88ABA07B2715@yandex-team.ru> <34328cc0-9669-f30d-50f6-46e9f3f21cde@postgrespro.ru> <9d33e21e-54b2-fcf3-b90f-ced286df00c5@postgrespro.ru> Subject: Re: libpq compression MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Mon, 02 Nov 2020 21:32:30 +0500 Message-Id: <2751271604329658@mail.yandex-team.ru> Content-Transfer-Encoding: 8bit Content-Type: text/html; charset=utf-8 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk
Hi,
 
Currently, zpq_stream contains a check only for the tx buffered data - zpq_buffered().
 
I think that there should be the same functionality for rx buffered data. For example, the zpq_buffered_rx().
 
zpq_buffered_rx() returns a value greater than zero if there is any data that was fetched by rx_func() but haven't been decompressed yet, in any other case zpq_buffered_rx() returns zero.
 
In this case, I think that we may also rename the existing zpq_buffered() to zpq_buffered_tx() for clarity.

--
Daniil Zakhlystov