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 1u2Rua-000jPm-Il for pgsql-committers@arkaria.postgresql.org; Wed, 09 Apr 2025 09:40:00 +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 1u2RuX-001h4O-UN for pgsql-committers@arkaria.postgresql.org; Wed, 09 Apr 2025 09:39:58 +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 1u2RuX-001h48-1c for pgsql-committers@lists.postgresql.org; Wed, 09 Apr 2025 09:39:58 +0000 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2RuV-003qgu-0j for pgsql-committers@lists.postgresql.org; Wed, 09 Apr 2025 09:39:56 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 8B7892540278; Wed, 9 Apr 2025 05:39:52 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 09 Apr 2025 05:39:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1744191592; x=1744277992; bh=ywOuieEWUgu5i/lor5wglh7yyFz7HJ1mD9Rgxvj5i0E=; b= MXnqiKO3wO31FeBKfJJZ9iCXJlWleQBymZI0oFQogW39NHgS9ZVGVEr/uqLDt/C3 9rlW9V7ywT9tz/RS+shZ7Jx9askoG5RvINZB8gzKQMWpMiL/dS/iM5svj2Fs5CDh 9Vzp+CVjR91tE2xobzE9y/XiOSbwd3LZr8TIGYIEpEZRGLRLm9JJV/aCkMW/BFTY i3oDXGUzCXPCc+kVsQ1z2sRrN1M2gSIxzghi4nMWZ+ZhzgMpAMwCFfeXLn79XWNz ztFHqSc8Hbaz28vpRdaLEyB99XHKSMcwhBnjLwtzrUqRbsJmUtZkwyE66EFtVdgk KqP0B9u5HkHOJHsMeN0Yqw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1744191592; x=1744277992; bh=y wOuieEWUgu5i/lor5wglh7yyFz7HJ1mD9Rgxvj5i0E=; b=DPB3NXYd+BdIvOOW0 ZRTjPI4ipAQG3MJSGnyz43GbWj3cknK+tv1UbEUTYKSSucaC/6q1x3pl/Ac3f/j2 2kMHWFRkewszsMWR/XNZD72IRRo1SEfvcR1Nu/yKA6VxE5THdmnrO+ynPwF2QEnn Fe+R8qAy3ugxQ+aJNbzCkZ2IQbU3uCMAAa+A7+47fnizBlxvD9bo5kiO89u5HLcU JZ+UYoZV41D4PK50ejInWrYQ+DynciQMGFQka+E/B9o8ZJaaHlPsJnDi7PFbLFgR iQn7+lfZ1Ru2ubUCsyEI3ntmV5RDfkpd/TJBwVqXVy51S1cyJo3uu3WFuwwpOBOU r2Ozw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdehieehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttddv jeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghish gvnhhtrhgruhhtrdhorhhgqeenucggtffrrghtthgvrhhnpedugfejffefleefvdegvdej vdeiheevgffhjefgudfhvedvjeevfeehteelgfevfeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdr ohhrghdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh ephhhlihhnnhgrkhgrsehikhhirdhfihdprhgtphhtthhopehpghhsqhhlqdgtohhmmhhi thhtvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Apr 2025 05:39:51 -0400 (EDT) Message-ID: <2afbd9c6-51b7-450f-9ae1-61e552368963@eisentraut.org> Date: Wed, 9 Apr 2025 11:39:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: Make cancel request keys longer To: Heikki Linnakangas , pgsql-committers@lists.postgresql.org References: <61be9e31-7b7d-49d5-bc11-721800d89d64@eisentraut.org> <09323e6a-4743-4be2-9d7f-74b86e4dac64@iki.fi> <34d5d731-06cc-43af-88cd-b3a4c5c8d9df@iki.fi> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <34d5d731-06cc-43af-88cd-b3a4c5c8d9df@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 09.04.25 10:53, Heikki Linnakangas wrote: > 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. I was having the same second thoughts overnight. I agree with your conclusion.