aboutsummaryrefslogtreecommitdiff
path: root/src/http_client_async.zig (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-06-21upgrade zig to `v0.11.0-dev.3737+9eb008717` (#3374)Gravatar Dylan Conway 1-20/+21
* progress * finish `@memset/@memcpy` update * Update build.zig * change `@enumToInt` to `@intFromEnum` and friends * update zig versions * it was 1 * add link to issue * add `compileError` reminder * fix merge * format * upgrade to llvm 16 * Revert "upgrade to llvm 16" This reverts commit cc930ceb1c5b4db9614a7638596948f704544ab8. --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-31Make uploading files with `fetch()`fast (#3125)Gravatar Jarred Sumner 1-22/+152
* Make file uploads fast * Add benchmark * Update README.md * defaults * print * prettier * smaller * fix(path) fix parse behavior (#3134) * Add macro docs (#3139) * Add macro doc * Updates * Tweaks * Update doc * Update macro serialization doc * Update macro doc * `--no-macros` flag, disable macros in node_modules * invert base/filename internally (#3141) * always false * Fix broken test * Add a test sendfile() test with large file --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com> Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-05-21[internal] Add more debug logs for uwsGravatar Jarred Sumner 1-2/+2
2023-05-21[internal] Make AbortSIgnal usage slightly saferGravatar Jarred Sumner 1-1/+1
2023-05-12fix proxy status return (#2860)Gravatar Ciro Spaciari 1-5/+5
2023-05-11fix redirect: \'manual\' and setTimeout on node:http request (#2848)Gravatar Ciro Spaciari 1-4/+3
2023-05-10feat(fetch) add redirect: 'error' support (#2845)Gravatar Ciro Spaciari 1-97/+114
* add redirect: 'error' support * fix typo * fix typo * refactor FetchRedirect enum * fix FetchRedirect * updated
2023-04-19Fix broken autocompleteGravatar Jarred Sumner 1-1/+1
2023-04-14Upgrade Zig (#2656)Gravatar Jarred Sumner 1-1/+2
* Upgrade Zig * Don't add `d` files in github actions * Revert "Don't add `d` files in github actions" This reverts commit 446e2dd6743da08ec4136233fdc9179dbbf58fca. --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-07feat(tls.Server) basic support (cert, key, rejectUnauthorized, requestCert, ↵Gravatar Ciro Spaciari 1-7/+9
ca) #2412 (#2552) * cherry picked * add StringOrBuffer parameter * Format and adds types * update uws * fix tests * more types * fix typing * add timeouts, clean some stuff * move tests to describe * fixes SSL hostname when Host is provided * cleanup on tests * change 127.0.0.1 to 0.0.0.0 * try another listening parameter * test timings and update uws * remove unnecessary comment * move listening event around * always await Bun.connect * do not fail if the tests already passed when using Bun.connect * regenerate classes * undo generated classes * generate classes * fix merge --------- Co-authored-by: cirospaciari <cirospaciari@MiWiFi-RA82-srv.cirospaciari>
2023-04-05fix(fetch.proxy) fix proxy authentication (#2554)Gravatar Ciro Spaciari 1-12/+100
* fix proxy authentication * add auth tests * remove unused
2023-04-02[install] reduce parallel HTTP requests under heavy load (#2536)Gravatar Alex Lam S.L 1-13/+41
* [install] reduce parallel HTTP requests under heavy load * make `max_simultaneous_requests` atomic
2023-03-05[install] fix connection error detection (#2307)Gravatar Alex Lam S.L 1-1/+2
2023-03-02Add a zig fmt action (#2277)Gravatar Jarred Sumner 1-7/+7
* Add a zig fmt action * add failing file * Setup prettier better * Update prettier-fmt.yml * Fail on error * Update prettier-fmt.yml * boop * boop2 * tar.gz * Update zig-fmt.yml * Update zig-fmt.yml * Update zig-fmt.yml * Update zig-fmt.yml * Update zig-fmt.yml * boop * Update prettier-fmt.yml * tag * newlines * multiline * fixup * Update zig-fmt.yml * update it * fixup * both * w * Update prettier-fmt.yml * prettier all the things * Update package.json * zig fmt * ❌ ✅ * bump * . * quotes * fix prettier ignore * once more * Update prettier-fmt.yml * Update fallback.ts * consistentcy --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-02-27fix(fetch.signal) capture socket and shutdown on abort signal (#2143)Gravatar Ciro Spaciari 1-40/+67
* capture socket and shutdown on abort signal * queue shutdown tasks * little cleanup * change shutdown strategy * use fetchSwapRemove on fetch shutdown * use fetchSwapRemove on fetch shutdown * fix formatting, remove unused property
2023-02-24fix `compiler_rt` linking failure on `x86_64` (#2163)Gravatar Alex Lam S.L 1-1/+1
- minor code tweaks
2023-02-24prefer `bun.copy()` over `std.mem.copy()` (#2152)Gravatar Alex Lam S.L 1-39/+43
2023-02-23Upgrade Zig (#2151)Gravatar Dylan Conway 1-9/+9
* fixup * Upgrade Zig * Remove bad assertion * strings * bump * mode -> optimize * optimize * Linux build * Update bindgen.zig
2023-02-22Fix flaky request.signal implementationGravatar Jarred Sumner 1-125/+73
2023-02-22feat(Request.signal) Initial support for signal in Request + fetch and ↵Gravatar Ciro Spaciari 1-51/+89
Request + Bun.serve (#2097) * add fetch abort signal * get aborted (still segfaults) * bidings.zig u0 error * still GC/memory error * fix start crash * fix AbortSignal fromJS * change fromJS to obj.as * addAbortSignalEventListenner * handle abort types, and add tests * fix tests * add custom reason test * merge 2 substring methods, use MAKE_STATIC_STRING_IMPL * fix create AbortError and TimeoutError, move globalThis and exception creation to main thread * fix tests and rebuild headers * no need to check with substring reason is already an exception * no need to check with substring reason is already an exception * fix dumb error inverting conditions for check reason * fix custom reason behavior * Request signal * remove package-lock.json * Remove JSC.Strong from Request signal * fix globals for fetch abort signal * more tests, clone signal crashs * fix AbortSignal.toJS * fix toJS bidings for AbortSignal * add streaming tests * fix abortion before connecting * fix tests and segfault * add fetch testing abort after finish * fix signal handler cleanup * support signal event Bun.serve * pull tests (failing) * remove unsupported test * formating * fix server Request.signal, fix cleanNativeBindings * add direct tests * more pull tests * fix stream tests * fix fetch, pending onAborted fix in HTTPServerWritable --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-02-15feat(fetch) AbortSignal (#2019)Gravatar Ciro Spaciari 1-40/+116
* add fetch abort signal * get aborted (still segfaults) * bidings.zig u0 error * still GC/memory error * fix start crash * fix AbortSignal fromJS * change fromJS to obj.as * addAbortSignalEventListenner * handle abort types, and add tests * fix tests * add custom reason test * merge 2 substring methods, use MAKE_STATIC_STRING_IMPL * fix create AbortError and TimeoutError, move globalThis and exception creation to main thread * fix tests and rebuild headers * no need to check with substring reason is already an exception * no need to check with substring reason is already an exception * fix dumb error inverting conditions for check reason * fix custom reason behavior
2023-01-21Support query string parameters in module resolutionGravatar Jarred Sumner 1-1/+12
2023-01-17feat(cli): Support `HTTPS_PROXY`, `HTTP_PROXY`, and `NO_PROXY` #1440 (#1814)Gravatar Ciro Spaciari 1-79/+595
* WIP: http_proxy implemented, first steps for https_proxy #1440 * add HTTP_PROXY support to upgrade_command and WIP: tunneling * WIP async handshake, stuck on WANT_READ, try to defer + check * create and upgrade with proxy working, TLS and non-TLS to proxy TLS working * bun install/upgrade/create working with http(s)_proxy #1440 * add NO_PROXY support #1440 * remove commented code and add TODO * fix getHttpProxy no_proxy * fix formatting * refactor catch and getHttpProxy, fix empty strngs in env for proxy * allow optimization for handleResponseBody
2023-01-13Fix debug mode crashGravatar Jarred SUmner 1-2/+5
2023-01-03Remove usages of std.xGravatar Jarred Sumner 1-5/+0
2022-12-28Upgrade to latest Zig (#1610)Gravatar Jarred Sumner 1-16/+25
* @min and @max * builtins and some trivial ones * Most of them * more * more! * More Progress * wip * Update tagged_pointer.zig * Update http_client_async.zig * Most of the iterable dir changes * alright * Remove usages of deprecated formatters * :camera: * fmt * Update shimmer.zig * wip * wip * wip * progress * more * Latest * stuck on error * latest * workaround stage2 * wip * Update string_immutable.zig * wip * Migrate `Dirent` and `require("fs')` to use JSC<>Zig bindings * Fix build errors * Fixup most of the test failures * Fix `make headers` * Fix "outside package path" error * Fixup aligned alloc * Add missing file * linux * More linux fixes * use latest peechy * Fix transpiler test failure * Forgot about these * Fixup test failure * Update node-timers.test.ts * [node:htt] Fix `undefined is not an object` error Fixes https://github.com/oven-sh/bun/issues/1618 * Update http.exports.js * Make this test less flaky * fix hashes * Fix hex formatting and zls issues * Download zig version * Update Dockerfile * Update Dockerfile * Update uws * Update Dockerfile * Set llvm version * Update README.md * Update uws * Update Dockerfile * Update io_linux.zig * Update bun.zig * Log output * workaround strange @cInclude error * Make ffi tests better * Don't use cImport * Update c.zig * Update c-bindings.cpp * call setOutputDir * Update Dockerfile * Use a longer name * latest * Update serve.test.ts Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-12-04[internal] Make string comparisons fasterGravatar Jarred Sumner 1-174/+0
2022-12-01[fetch] Treat 302 like 303Gravatar Jarred Sumner 1-2/+17
2022-12-01[fetch] Implement `redirect: "manual"`Gravatar Jarred Sumner 1-1/+8
2022-11-29import everything from "bun" where possibleGravatar Jarred Sumner 1-6/+6
2022-11-20fix protocol relative urls againGravatar Jarred Sumner 1-0/+24
2022-11-20TypoGravatar Jarred Sumner 1-1/+1
2022-11-20[fetch] Add optimization for chunked encodingGravatar Jarred Sumner 1-7/+91
2022-11-19[fetch] Fix sporadic data corruption bug in HTTP client and add fast pathGravatar Jarred Sumner 1-124/+133
- This removes memory pooling from the HTTP client which sometimes caused invalid memory to be written to the response body. - This adds a fast path for small HTTP/HTTPS responses that makes it a single memory allocation for the response body, instead of copying & allocating a temporary buffer cc @Electroid
2022-11-19[fetch] Fix bug with redirecting to a protocol-relative URLGravatar Jarred Sumner 1-5/+21
2022-11-19[fetch] Fix bug with redirects losing the port numberGravatar Jarred Sumner 1-7/+15
2022-11-14switch default encoding order (#1510)Gravatar Dylan Conway 1-1/+1
2022-11-12Fix memory leak in gzip pool + add test for gzip'd dataGravatar Jarred SUmner 1-10/+5
2022-11-12Redo how we poll pipes (#1496)Gravatar Jarred Sumner 1-0/+5
* Fix pipe * Handle unregistered * Fix failing test
2022-11-09Fix #1354Gravatar Jarred Sumner 1-1/+1
2022-11-09Re-enable workaround for 127.0.0.01Gravatar Jarred Sumner 1-5/+5
2022-10-25TCP & TLS Socket API (#1374)Gravatar Jarred Sumner 1-0/+1
* TCP Socket API * Wip * Add snippet for StringDecoder * Rename `close` to `stop`, replace `close` with `end` * Add a tcp echo server test * Some docs * Update README.md * Fix build * Update README.md Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-10-15Simplify the code that reads HTTP client request bodiesGravatar Jarred Sumner 1-23/+22
2022-10-08Fix https://github.com/oven-sh/bun/issues/1263Gravatar Jarred Sumner 1-2/+23
What happened: when moving to uSockets for the http client, I forgot to call `SSL_set_tlsext_host_name` and uSockets apparently doesn't do that
2022-10-02Reduce memory usage of HTTP requests by 8 KBGravatar Jarred Sumner 1-20/+49
2022-09-30Verbose flagGravatar Jarred Sumner 1-1/+17
2022-09-20meant to include this in the previous commitGravatar Jarred Sumner 1-1/+1
2022-09-19Fix larger bodiesGravatar Jarred Sumner 1-0/+6
2022-09-18Fix broken sending http bodyGravatar Jarred Sumner 1-1/+3
2022-09-18Update http_client_async.zigGravatar Jarred Sumner 1-6/+12