mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-19 14:31:44 -04:00
|
Some checks are pending
Contrib / admin/halog/ (push) Waiting to run
Contrib / dev/flags/ (push) Waiting to run
Contrib / dev/haring/ (push) Waiting to run
Contrib / dev/hpack/ (push) Waiting to run
Contrib / dev/poll/ (push) Waiting to run
FreeBSD / clang (push) Waiting to run
VTest / Generate Build Matrix (push) Waiting to run
VTest / (push) Blocked by required conditions
Windows / Windows, gcc, all features (push) Waiting to run
Refactor the Lua HTTP client to defer initialization. core.httpclient()
no longer initializes the internal HTTP client immediately. Instead,
initialization now occurs within hlua_httpclient_send() when a request
method (e.g., get, put, head) is invoked.
The HTTPClient class now serves as a factory for accessing methods, while
a new class, HTTPClientRequest, has been introduced to represent individual
requests and manage the HTTP client lifecycle.
This change allows multiple requests to be executed using a single
HTTP client instance:
local hc = core.httpclient()
local res1 = hc:get({url = "...", headers = ...})
local res2 = hc:post({url = "...", headers = ...})
local res3 = hc:put({url = "...", headers = ...})
This refactor maintains backward compatibility, as existing scripts that
instantiate a new core.httpclient() for every request will continue to
work as expected.
|
||
|---|---|---|
| .. | ||
| bad_http_clt_req_duration.lua | ||
| bad_http_clt_req_duration.vtc | ||
| certs | ||
| close_wait_lf.lua | ||
| close_wait_lf.vtc | ||
| h_txn_get_priv.lua | ||
| h_txn_get_priv.vtc | ||
| httpclient_action.lua | ||
| httpclient_action.vtc | ||
| lua_httpclient.lua | ||
| lua_httpclient.vtc | ||
| lua_socket.lua | ||
| lua_socket.vtc | ||
| set_var.lua | ||
| set_var.vtc | ||
| txn_get_priv-print_r.lua | ||
| txn_get_priv-thread.vtc | ||
| txn_get_priv.lua | ||
| txn_get_priv.vtc | ||
| wrong_types_usage.lua | ||
| wrong_types_usage.vtc | ||