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 1uD9jP-0076px-TK for pgsql-hackers@arkaria.postgresql.org; Thu, 08 May 2025 22:28:44 +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 1uD9jO-006ctQ-Lm for pgsql-hackers@arkaria.postgresql.org; Thu, 08 May 2025 22:28:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uD9jO-006csF-AL for pgsql-hackers@lists.postgresql.org; Thu, 08 May 2025 22:28:42 +0000 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uD9jI-000unN-0j for pgsql-hackers@postgresql.org; Thu, 08 May 2025 22:28:38 +0000 Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-6f0c30a1cf8so26794146d6.2 for ; Thu, 08 May 2025 15:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1746743314; x=1747348114; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=IEEGKB/+YlYiu8rxfnGtxDXq1RxBwrZ+a13RX3I5Amw=; b=LvhHJZrMpQodZ1paDS+26CDCK22gLnarsIvoCYqh4UZh4fnwwbuFIah2w3COawx5K3 Nd0tNOHpWtI2ZyjWUSD04EDC7woq9MSip5g3gvnykbzszDilqWM4O0xZ5SeN8PdBXeVb RHKSlQbjO22A43Yg7JgLe5+rq7VZJf8sRcDsp0+zK+LsytG87gqCry0iZqXNl5OZcQSi aMX8XArHufpt5z3T4TYbmtWZZEUktWXMsij0OKmZ44dGJBeitEmuSHeZFGreLydduUfp snVJM+Jw6+xcoOwBDdjLo7Q0tgwiKA4SqcDPHadhqGy35O699J3wX+vvx9t8NwjSIURh a1gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746743314; x=1747348114; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IEEGKB/+YlYiu8rxfnGtxDXq1RxBwrZ+a13RX3I5Amw=; b=DU7UH++xsE9eR3gG33dZbkf8b1nLpvBrc63BfPKRpmUA6oHrozMDrwN2vUgZbS9Q1p j4x/Rl4G3jLhYMcn/45Wv96Spk3B/ZP+n1EP7pejrKxPCLXZrv6fMSPNdtxc4eZkdW1Q 0S6xjxleWrj6l7Ys5TJtYYiOKCbqM1LzM6JuDTQ8TKVxy+a36RVchfCGW732ZeGHE5pD FxOOdR259S+sEs/b3PuipxcCaO6MkzEMKfHmJa8UOfm9ibAMyAk7MlpWM/9W5x2zA531 LOLASzB+W/b36GH8er4NEefmLDB1YrivNLpT1ceNKSKCGu9WDBMPpvXkEQzcshim2ELB +8mA== X-Forwarded-Encrypted: i=1; AJvYcCV2/Bx8hu3dr7qvzCRFkScWLPSaLna88NDDdMOcr0AurWokXp+ysMHS/oBC1P3P9yTu7KrmedwXggI8uWQS@postgresql.org X-Gm-Message-State: AOJu0YzBf0LnPQVRSQWakIWP0ddD0yTXeEmgS0ylvPJ2FDzH1IqonSri 0WTKLJ9SR9raiN5IRtPvIdLs2FYsZwMmWI4f9lq+2FC+k0Dth8dEPjMtRyAaMelBpw1WqLQwOnd Qo6B+vWq0Bo87F9drNhgDWmkL96P1YD3mPCb4 X-Gm-Gg: ASbGncuvQSJul0TtVKlAW2xI0S/cIGwjzbYlOo+ZtAxzdXDwU8EazYieVHrKz28bQwI va3w7aF0PKEAZ0j2ULuXzdGpwO+kkGKJ9A6qIjY+F+Kq3s5GRXaueQfH4E4DG3ASZheDzJx87hZ PjKAAiv3rJ9F5yWSq0azSw X-Google-Smtp-Source: AGHT+IEsnrdBNuQpUWYNIt10nuyC9+mqM2X6T/nzQv+i/CeSyBVQjTzWVN472yRl6bMIAV+uq3NQQ7T8i2MLCqBqRas= X-Received: by 2002:a05:6214:c46:b0:6f5:11a9:51fe with SMTP id 6a1803df08f44-6f6e482f0bamr17251856d6.36.1746743314652; Thu, 08 May 2025 15:28:34 -0700 (PDT) MIME-Version: 1.0 References: <61be9e31-7b7d-49d5-bc11-721800d89d64@eisentraut.org> <09323e6a-4743-4be2-9d7f-74b86e4dac64@iki.fi> <34d5d731-06cc-43af-88cd-b3a4c5c8d9df@iki.fi> <2afbd9c6-51b7-450f-9ae1-61e552368963@eisentraut.org> <4bd8421a-50ad-4169-a096-99247c2f563c@iki.fi> <9399dc5d-5575-483e-8e23-af6be79385c8@iki.fi> <52d648b1-9aca-43d1-a9e4-a6a556410f41@iki.fi> In-Reply-To: <52d648b1-9aca-43d1-a9e4-a6a556410f41@iki.fi> From: Jacob Champion Date: Thu, 8 May 2025 15:28:24 -0700 X-Gm-Features: AX0GCFtdPuqquwc1KGeLD2nldQ456yI2vXUTHR4N7L2lduqNorWwx33133m7l2o Message-ID: Subject: Re: pgsql: Make cancel request keys longer To: Heikki Linnakangas Cc: Peter Eisentraut , "pgsql-hackers@postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, May 8, 2025 at 12:11=E2=80=AFPM Heikki Linnakangas wrote: > Polished this up a tiny bit, and committed. Thanks! I think the uint8->int change for cancel_key_len is more than just cosmetic; it most likely fixes a bug where a key size of 256 wrapped around to 0. I'll double-check that this fixes that later; I've gotten side-tracked from the protocol stuff a bit. While I have you, though, is the following just a really complicated way to say `msgLength - 4`, or is there some other reason to do the pointer math? cancel_key_len =3D 5 + msgLength - (conn->inCursor - conn->inStart); --Jacob