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=1753987999; bh=GJ6R0KSvu+6nLIN3SO9ER5VcTEWuE4cxA7d0ieILzx0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To: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=jn9FmexeCQamIyuSz+S853ij5lO72bOe1VLDJDYWnM8bj5O+ZG7JjuAnUc1zLaAYj 5+eyTz85YrxD0fbUrpTF1FMJ734JglMiNfyoGD/mywdRGab5eP5dRToUMqqkeMqZoD fU2hGPkL91kJY8b9Ko5XAGYu8IsGG8QphhoHRa7roPdRwrAy7Ric1uCmrC4rZ9aMn4 iVcPMcANpZamPMMkX39aeQcPPtQZ2aJ690YXIefyU40d/c9+Ndn2ZTPJ+ntvkvn0Rm rTc7kY68wluvTT/dPcnkx4mn94fZ5oYDFzR5WfnTczm+jJl4LAw4tHbmpu4qAEO/qc QiPe8LZk0ssvQ== Received: from linux.gnuweeb.org (unknown [182.253.126.229]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id 5325E3126E9A; Thu, 31 Jul 2025 18:53:18 +0000 (UTC) Date: Fri, 1 Aug 2025 01:53:15 +0700 From: Ammar Faizi To: Alviro Iskandar Setiawan Cc: Ahmad Gani , GNU/Weeb Mailing List Subject: Re: [PATCH gwproxy v1 1/3] dnslookup: split common functionality and struct into net.c Message-ID: References: <20250731030856.366368-1-reyuki@gnuweeb.org> <20250731030856.366368-2-reyuki@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Machine-Hash: hUx9VaHkTWcLO7S8CQCslj6OzqBx2hfLChRz45nPESx5VSB/xuJQVOKOB1zSXE3yc9ntP27bV1M1 List-Id: 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=53. -- Ammar Faizi