Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u2RBc-000ZJC-4z for pgsql-committers@arkaria.postgresql.org; Wed, 09 Apr 2025 08:53:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u2RBa-001XiA-4K for pgsql-committers@arkaria.postgresql.org; Wed, 09 Apr 2025 08:53:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u2RBZ-001Xi0-TX for pgsql-committers@lists.postgresql.org; Wed, 09 Apr 2025 08:53:30 +0000 Received: from lahtoruutu.iki.fi ([185.185.170.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2RBY-003qEx-0D for pgsql-committers@lists.postgresql.org; Wed, 09 Apr 2025 08:53:29 +0000 Received: from [192.168.1.112] (iptv-hkibng21-58c090-167.dhcp.inet.fi [88.192.144.167]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4ZXcDJ68sgz49Px4; Wed, 9 Apr 2025 11:53:20 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1744188801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IEfYyuenxpeMmNNHXu05jINwu1cHzvQsCTiIP28c1ZE=; b=e0whfRb/TliwkIopaGm91Y8BOWMKaILMC8GbBePo4jY1IYO7PbOUvz2za2jvK09eFvZSFp axfKPLsiajseHqzAyV2InBirwGQjLxaXGvCn3Oh5sYTrpHTVGDycTx1WhEaiugE1BvWPhQ V1T7CQUE678j1fQSSsJT1dyGtEZaf5w1mOILjL/Cg72h1JdgsJZpd6QVGKECJBM/ToGFrQ D3VbaKUlwj0hdo5GFLVaTRW8zZifbk2poukI57qS8vXLwGXhUrQlZTLDBBSoAf9op5AvY5 NsNdye4h9qKJLlNsW4ZH4s1Xrgpz/76Fqv+yzWoq81SmCPJtJcpi5jeALrvEbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1744188801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IEfYyuenxpeMmNNHXu05jINwu1cHzvQsCTiIP28c1ZE=; b=AIuoBFbW5Si254gq56/t0vBcCWYdYWexowubuqi7bE81dsQQDgn66diU2fnoyJxhjqlpXq cdCqnl5HToVG7usSw6BHBbUzbOOir+70H39e7bb73c89vRZFuo2tr72VzKrLfyhODbHb92 tzIETJIfZZsnkWmSXvAt6lxHekzvLFCJMBGgRqURWs0nw12Wn3OEl4euepUeZhejbgo0OX c/wLZ+qF565UtGFtPVZKVjNrjXg5qVfsABGqlDk5nXGyQWs/XaDAjAkkm9XYNsFYOE4GaZ djpunqiqY+z0lJZT3qzZLWIybqOxWFcmYq8Jj0dB9AzBjrZaVEVfCGg5W967xA== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1744188801; a=rsa-sha256; cv=none; b=ICbvEL38GWbJj3ihcHkIEVGCN+NUGG9oTTcV5068BfXaMhW7S5Gj6kEqGPrU3GbpsyZGel i7HpsQY/cB5Lb/aubeZnSYn0PgviufYmhyejcUvXMcQuIVhoa0GlVUqN6GR7m6ToA0iGDP RnP+oxvnTVBq01rCmZBVlHwgbcgZxdmxWYlfR6Vw/vFfddCQFeNlDNIwzrqt7AQ3+HFgWe 5eWV7AiLoxH1CVH0+U/3j7/9ZQ808fvIiiQUibFxlEnToDgf/FzDxYzsXhDIjtFtEUumTd oX4gnxBC2Zh/voUupApwKyKYUx+WUeTcNHEpJgx30GoKB6xiwkClkhykACrKhQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi Message-ID: <34d5d731-06cc-43af-88cd-b3a4c5c8d9df@iki.fi> Date: Wed, 9 Apr 2025 11:53:20 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: Make cancel request keys longer From: Heikki Linnakangas To: Peter Eisentraut , pgsql-committers@lists.postgresql.org References: <61be9e31-7b7d-49d5-bc11-721800d89d64@eisentraut.org> <09323e6a-4743-4be2-9d7f-74b86e4dac64@iki.fi> Content-Language: en-US In-Reply-To: <09323e6a-4743-4be2-9d7f-74b86e4dac64@iki.fi> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 08/04/2025 22:41, Heikki Linnakangas wrote: > On 08/04/2025 20:06, Peter Eisentraut wrote: >> While I was looking at this, I suggest to make the first argument void >> *.  This is consistent for passing binary data. > > Ok, sure. On second thoughts, -1 on that. 'void *' is appropriate for functions like libc's read() or pq_sendbytes(), where the buffer can point to anything. In other words, the caller is expected to have a pointer like 'foobar *', and it gets cast to 'void *' when you call the function. That's not the case with the cancellation key. The cancellation key is just an array of bytes, the caller is expected to pass an array of bytes, not a struct. The right precedent for that are e.g. SCRAM functions in scram-common.h, for example. They use "const uint8 *" for the hashes. I'll switch to "const uint *" everywhere that deals with cancel keys. There are a few more variables elsewhere in the backend and in libpq. > Looks good to me. I can commit these tomorrow, or feel free to do it > yourself too. I'm on this now. -- Heikki Linnakangas Neon (https://neon.tech)