From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.88.254] (unknown [125.160.110.187]) by gnuweeb.org (Postfix) with ESMTPSA id A1E1F8093B; Mon, 22 Aug 2022 03:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1661137739; bh=EfPj6oNN/HQYFiHIuwFjLwB5UcEgZpCR8HplstU4fe0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=b+FCNTDjtR6yCQd1SQ5KnGAYsRoGmKiGw9DwbQGHDXZj5tf/vhesl3QcQroYSwEZL HlqMo7+HLxrLzHxGmTH9mFvjW2b5NPyjZ3xgqG7GXACfnHyEmNLrL3IVRndKHWTFHK V5Ie3ee/yEry6xhAbvtcYvSg+Y8s8ukCyiKbWm2Fgi4+OxZB+N/cSzZ4TEDWgQQbnQ YLEO0W6lNrczJ7vjcnRt391Q1MOrL2GJT/Cb3iBwN4B+7Qm6tGnXN5KNSBDw5JfONB dgec+xvc3DQTCnyBKrad3pEJMRpQ620whyS8r1uyxOLEUG4p0IiioZOCNr2IOy9kbi qJVpa3kMnvfIg== Message-ID: Date: Mon, 22 Aug 2022 10:08:54 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v1 17/22] chnet: Initial chunked request body support Content-Language: en-US To: Alviro Iskandar Setiawan Cc: Muhammad Rizki , Kanna Scarlet , GNU/Weeb Mailing List References: <20220821112453.3026255-1-ammarfaizi2@gnuweeb.org> <20220821112453.3026255-18-ammarfaizi2@gnuweeb.org> From: Ammar Faizi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 8/22/22 5:13 AM, Alviro Iskandar Setiawan wrote: > I think you shouldn't returnnet::ERR_IO_PENDING, just sleep on the > condition variable if the buffer is not ready yet, it is legal to > sleep on ReadInternal(), why spend time spinning on -EAGAIN? > > You can end in OnReadCompleted() if you sleep on the condition > variable and wait for it to get signaled: > https://source.chromium.org/chromium/chromium/src/+/main:net/base/upload_data_stream.cc;l=82-87;drc=5eda14f193ef3e0131aad2f31ae172c0001b3f6d?q=upload_data_stream.cc&ss=chromium%2Fchromium%2Fsrc I will redesign this part until I get a better shape. -- Ammar Faizi