From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id DF0FA652D2 for ; Tue, 1 Feb 2022 13:39:01 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D59712EAD3 for ; Tue, 1 Feb 2022 13:39:01 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 6E81C2EACA for ; Tue, 1 Feb 2022 13:39:01 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 398864617E for ; Tue, 1 Feb 2022 13:39:01 +0100 (CET) Message-ID: Date: Tue, 1 Feb 2022 13:39:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Thunderbird/97.0 Content-Language: en-US To: Dominik Csapak , Proxmox Backup Server development discussion References: <20220117104825.2409598-1-d.csapak@proxmox.com> <20220117104825.2409598-4-d.csapak@proxmox.com> <10964093-6e3e-363c-e2d0-f30b25c20ac2@proxmox.com> From: Thomas Lamprecht In-Reply-To: <10964093-6e3e-363c-e2d0-f30b25c20ac2@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.061 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pbs-devel] [PATCH proxmox v4 3/4] proxmox-async: add connect_to_udp helper X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2022 12:39:01 -0000 On 01.02.22 13:13, Dominik Csapak wrote: > On 2/1/22 13:02, Thomas Lamprecht wrote: >>> +=C2=A0=C2=A0=C2=A0 addr: A, >>> +) -> io::Result { >>> +=C2=A0=C2=A0=C2=A0 let socket =3D match tokio::net::lookup_host(&add= r).await?.next() {> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Some(Sock= etAddr::V4(_)) =3D> UdpSocket::bind("0.0.0.0:0").await?, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Some(SocketAddr::V6(_)) =3D= > UdpSocket::bind("[::]:0").await?, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 None =3D> proxmox_sys::io= _bail!("could not resolve address family {}", addr), >> >> would it have some merit to use {:?} to loose the Display trait bound?= >> Probably not to relevant though. >> >=20 > then we'd need the Debug trait though, so no real gain? >=20 hmm, thought that was implied, meh.. Normally one would want to pass it v= ia the error (type) upwards and let the caller handle it, but those error types can be= stupid too...