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=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id 58B848079D; Sun, 21 Aug 2022 11:25:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1661081118; bh=kFyi3yHPhegZzKLJz2y1ixMuu/sOFdPLSAeHMtOo2Yg=; h=From:To:Cc:Subject:Date:From; b=gXC5nkSThwIV/iFJtojbFtyL+A/EsPju6/cyTRYh52pCQj3zA7OCtmoZCR7O9zqJa yo7/Iv+FHGw5v8OYHjMeL0NYW1dhHvH6xge4E9fi3jmlTdpI7qXzO6cJqgHPSECJnH gIa4gyP4Cn8YQi+xcQjLNPPEUvgGhTGv53vaIUP0rxWhxfa7V94k7v5/KZdp//rKna iSVXiKjadsZPBpaLSbQ0O+uL18+sve0DYjmtwtfsy1Pt0rN802zfclJU1ddm+Qx7zK GOLV9VVXi2DTfm2Z2nZzP7NjWIjpnGM3cd2T6WKMYeR/L1cKRznKjHZ8CH8i425kbI jCFsoOmVS62ZQ== From: Ammar Faizi To: Alviro Iskandar Setiawan Cc: Ammar Faizi , Muhammad Rizki , Kanna Scarlet , GNU/Weeb Mailing List Subject: [PATCH v1 00/22] ncns updates Date: Sun, 21 Aug 2022 18:24:31 +0700 Message-Id: <20220821112453.3026255-1-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Hi Al, This series contains ncns updates. There are 22 patches in this series. Some interesting things here are: 1) Refactor ring. 2) Refactor NodeJS interface. 3) New features: - Support chunked upload. Make it able to send request body progressively. - Support custom method. By defautlt, the chromium HTTP request will perform an HTTP GET. Make it possible to set the HTTP method from the NodeJS. Also, change the internal string storage to std::string, because if we use a `const char *`, it make the lifetime management harder with respoect to the caller. 4) Increase max ring entry. Make it able to handle bigger ring size. I have tested this with 2G entry and it works fine. Didn't manage to test chnet though, only nop SQEs. 5) Various bug fixes: - Add `-Wno-enum-constexpr-conversion` flag (fix for clang-16). See: https://github.com/nodejs/node-addon-api/issues/1198 - Use busy-waiting for signal waiter. Sometimes the worker stuck on sig.Wait(), it seems the signaling mechanism was implemeted wrongly. Just use a busy-waiting which is easier to implement. There is nothing to worry much about wasting CPU cycle as the waiting period must be very short, if it's not short, then something has gone very wrong! Also, PostTask() may fail, handle this failure. Signed-off-by: Ammar Faizi --- Ammar Faizi (22): chnet: Add initial request body support chnet: node: Add set_user_data support on SQE tests/js/ring: Update the unit test to utilize set_user_data binding.gyp: Add `-ggdb3` flag for better debugging experience binding.gyp: Add `-Wno-enum-constexpr-conversion` flag chnet: node: Add set_method function to set HTTP method chnet: node: Add get_error function to return the error string chnet: node: Add set_payload function to set HTTP req body tests/js/ring: Add simple HTTP POST request example in NodeJS chnet: Split construct URL req creation into a new function chnet: Add set request header support chnet: node: Fix unused variable warning chnet: node: Add set request header function in NodeJS tests/js/ring: Add more set header function test chnet: node: Don't use static counter for data ID tests/js/ring: Add JavaScript class wrapper example chnet: Initial chunked request body support chnet: Rework the chunked request body interface chnet: ring: Refactor the ring completely chnet: Use busy-waiting for signal waiter chnet: ring: Bump max_entry to 2G tests/cpp: Delete basic.cpp as it's no longer relevant binding.gyp | 4 +- chnet/WorkQueue.cc | 17 +- chnet/WorkQueue.h | 5 + chnet/chnet.cc | 321 +++++++++++++++++++++++-- chnet/chnet.h | 88 ++++++- chnet/chnet_node.cc | 564 ++++++++++++++++++++++++++++++++++---------- chnet/chnet_node.h | 6 - chnet/chnet_ring.cc | 466 ++++++++++++++++++------------------ chnet/chnet_ring.h | 200 +++++++++------- chnet/common.h | 20 +- tests/cpp/basic.cc | 97 -------- tests/cpp/ring.cc | 425 +++++++++++++++++++++++++-------- tests/index.php | 14 ++ tests/js/ring.js | 405 ++++++++++++++++++++++++++----- 14 files changed, 1874 insertions(+), 758 deletions(-) delete mode 100644 tests/cpp/basic.cc base-commit: 7914975d89b6cb947de27b17df13b2f4830197a1 -- Ammar Faizi