public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH backup 2/2] proxy: fix accept future "rearming"
Date: Wed, 12 May 2021 09:29:31 +0200	[thread overview]
Message-ID: <20210512072931.2882-2-w.bumiller@proxmox.com> (raw)
In-Reply-To: <20210512072931.2882-1-w.bumiller@proxmox.com>

this must happen regardless of whether we got an error

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
---
 src/bin/proxmox-backup-proxy.rs | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs
index e8c31c4d..4bf3fb56 100644
--- a/src/bin/proxmox-backup-proxy.rs
+++ b/src/bin/proxmox-backup-proxy.rs
@@ -237,16 +237,18 @@ async fn accept_connection(
                 }
                 continue;
             }
-            res = &mut accept => match res {
-                Err(err) => {
-                    eprintln!("error accepting tcp connection: {}", err);
-                    continue;
-                }
-                Ok((new_sock, _addr)) => {
-                    // rearm the accept future:
-                    accept = Box::pin(listener.accept());
-
-                    sock = new_sock;
+            res = &mut accept => {
+                // rearm the accept future:
+                accept = Box::pin(listener.accept());
+
+                match res {
+                    Err(err) => {
+                        eprintln!("error accepting tcp connection: {}", err);
+                        continue;
+                    }
+                    Ok((new_sock, _addr)) => {
+                        sock = new_sock;
+                    }
                 }
             }
         };
-- 
2.20.1





      reply	other threads:[~2021-05-12  7:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12  7:29 [pbs-devel] [PATCH backup 1/2] proxy: get rid of some unsafe pins Wolfgang Bumiller
2021-05-12  7:29 ` Wolfgang Bumiller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210512072931.2882-2-w.bumiller@proxmox.com \
    --to=w.bumiller@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal