From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server-vie001.gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_DBL_BLOCKED_OPENDNS, URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=new2025; t=1753988607; bh=7/cLpaLFiI3wiWDOe5cAccBCAMGiA/IYbP5IDWwgi2w=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type:Content-Transfer-Encoding:Message-ID:Date:From: Reply-To:Subject:To:Cc:In-Reply-To:References:Resent-Date: Resent-From:Resent-To:Resent-Cc:User-Agent:Content-Type: Content-Transfer-Encoding; b=akLa4olIH6BsfX3q6ya+Qwj+7opus8/mNyXOeotEGi3QNZq7uZdJWWoA5Yq2i1JxJ XoYsf1mFulsQay5KPPRJbzerB/grqgjWrmFwAef6/tIVTv2Hx/EX4fAoF5Wbqp6kBt o0dtJMjNHzZROBPxyRjihz1WMd3stAsL8NyNGm/6q05fXvfxsy7B6M2gCjFg35zyoN B8y+LvkTvyAUXt0lgAIqNyshGDBLtZIycs4/Nohg7vPoUEF3gqabkffr3ySLztEPEs i/mqvnrfZXi4hRMmimPmD9H0gmgyfUa62OdVn8sn+ie2gLG2cn3qaYRWD6xLOCN6Ay AwQwzxVBJxGxg== Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id 69AD53126E9A for ; Thu, 31 Jul 2025 19:03:27 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-31ca042d3b8so1116805a91.0 for ; Thu, 31 Jul 2025 12:03:27 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVOuTG8rsCUNJdUko1Ayamv09FA8wJDQuNEJdPoKyZHESAOecnrxYyIyqvA2v7oVf32vrRk@vger.gnuweeb.org X-Gm-Message-State: AOJu0YwEE6jiGgAz4knR5seE0PnmTb+9Qly18IIaHQtHbg2uiHl5wY7q RsXXZhB4afB23aLM5HKBGtOkhPwn329TXot/QQnEZSRXhTTtQlZJHht92G98m5xFlhsx9d2wtfD 75B2f/7Az6xJoQSJ2Ls9hP/jdp9GTeqM= X-Google-Smtp-Source: AGHT+IHxRSxZ5FCHRYFvEBqwZbx/Bxug2uKoEmzoyrScYaHDAL70WOQepSzTqTgT2w3qOLNGg1b0/hSjR6HHFNqjyuQ= X-Received: by 2002:a17:90b:2cc6:b0:311:d670:a0e9 with SMTP id 98e67ed59e1d1-31f5de34fedmr11251476a91.21.1753988605756; Thu, 31 Jul 2025 12:03:25 -0700 (PDT) MIME-Version: 1.0 References: <20250731030856.366368-1-reyuki@gnuweeb.org> <20250731030856.366368-2-reyuki@gnuweeb.org> In-Reply-To: From: Alviro Iskandar Setiawan Date: Fri, 1 Aug 2025 02:03:14 +0700 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXyV66r02iErEJrA9U2hdYRQyZbPJ_27jgYlDMtnd58GZ-ODy_FL6TfMc2U Message-ID: Subject: Re: [PATCH gwproxy v1 1/3] dnslookup: split common functionality and struct into net.c To: Ammar Faizi Cc: Ahmad Gani , "GNU/Weeb Mailing List" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: On Fri, Aug 1, 2025 at 1:53=E2=80=AFAM Ammar Faizi wrote: > On Fri, Aug 01, 2025 at 01:42:41AM +0700, Alviro Iskandar Setiawan wrote: > > Ah, ic ic. I didn't know that. So it's fine to keep using glibc's > > getaddrinfo() to initialize ares? > > Yes, it's fine at initialization. Cold paths are NOT something we > should further optimize. The point of this pollable DNS resolver plan > is to optimize hot paths. That's the event loop. > > But since that initialization needs a default port. The function > convert_str_to_ssaddr() may be modified to handle IP addr with no port. > > Maybe something like: > > static int convert_str_to_ssaddr(const char *str, struct gwp_sockaddr *= gs, uint16_t default_port); > > After that, gw_ares_init() can use convert_str_to_ssaddr() with > default_port=3D53. Sounds good to me. -- Viro