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=1754480386; bh=C3qXbPvi+JUBMyJgjYIapnU1SV+75rI54Go/DcbdNrI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding: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=sK8Rc1qVeJ9Dr44xRUXQtqOlM9wZ4cWfOaH/OUgp/kZzF+CovMJnDBVgXPPCxA5ys qjR13wHszfA9YZYlk7nf+2er5w5oCBgUO8LiY11rM1gN8k8mTOotmZbdNnTjrQXPNO DoZ52rQztRC7OpovTx3N1VffHv7FgDDfCluwczE2+NwyqIfPHWa9baBgLGAc57H4B8 6sdD8z69GmgDNNvvxLn3UC/IX7Hc42EzrFNS43u2JrGs9e62M7T7SWaJ84DEUyU2c0 qqLgG03JJW/PanR+tjWkCz7xxAgo1mCXFe2bUSRnsJY9nC+AvQXu5iHUAn2bOF1faS M5qsqRdbg6egg== Received: from linux.gnuweeb.org (unknown [182.253.126.229]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id 4A8133127B86; Wed, 6 Aug 2025 11:39:45 +0000 (UTC) Date: Wed, 6 Aug 2025 18:39:42 +0700 From: Ammar Faizi To: Alviro Iskandar Setiawan Cc: Ahmad Gani , GNU/Weeb Mailing List Subject: Re: [PATCH gwproxy v4 4/6] dnslookup: Initial work for implementation of C-ares-like getaddrinfo function Message-ID: References: <20250806035727.216702-1-reyuki@gnuweeb.org> <20250806035727.216702-5-reyuki@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Machine-Hash: hUx9VaHkTWcLO7S8CQCslj6OzqBx2hfLChRz45nPESx5VSB/xuJQVOKOB1zSXE3yc9ntP27bV1M1 List-Id: On Wed, Aug 06, 2025 at 06:20:10PM +0700, Alviro Iskandar Setiawan wrote: > On Wed, Aug 6, 2025 at 6:09 PM Alviro Iskandar Setiawan wrote: > > On Wed, Aug 6, 2025 at 10:57 AM Ahmad Gani wrote: > > > Introducing glibc's getaddrinfo replacement, the DNS protocol > > > implementation is limited to standard query (OPCODE_QUERY) as for now, > > > but may extended later as necessary. > > > > Thinking about this further, I think this design is wrong. The DNS > > library is expected to only handle bytes processing, leaving the > > networking stack to the caller. > > > > Think, how is it going to be integrated with io_uring? > > > > We should let the caller perform the recv and send. This library > > doesn't need to care about the networking stack at all. Make it the > > caller's responsibility to feed the library with bytes from the > > network. > > Please take a look at src/gwproxy/socks5.c > > That's a perfect example of socks5 bytes processing without > networking. Purely bytes parsing. > > That way you can use io_uring, epoll, or whatever shiny features, even > statically allocated fake bytes work. That's right, it was the last unfinished discussion. Nice that you bring that point again. I think we should not be following c-ares. The io_uring design simply can't work with c-ares' style abstraction. gwproxy DNS library does not need to have the same interface as c-ares. And yes, socks5.c is a perfect example. JFYI, the other day Ahmad also wrote a similar library that accepts only bytes (for socks5). It should not be hard to convert the current design to be like that given the experience. -- Ammar Faizi