Compare commits

...

3 Commits

Author SHA1 Message Date
Egil Hjelmeland
64a2f699ef
Merge ccef3bc4e2aa6ee5b997a80aabb58f4ff0b0e98f into fa69770e52ba869feb8339d49e7c3c536953fbde 2023-11-30 22:19:47 -07:00
Max1Truc
fa69770e52
fix(http): Use the right protocol for proxies (#386) 2023-11-23 08:01:29 +03:00
Egil Hjelmeland
ccef3bc4e2 Changed return text for ETIMEDOUT/ WSAETIMEDOUT
Changed return text for ETIMEDOUT/ WSAETIMEDOUT to “connection timeout”.

This is needed for the application to be able tell to the difference between timeout of TCP connection (ETIMEDOUT/ WSAETIMEDOUT) and a normal return from a non-blocking socket (error codes EAGAIN/WSAEWOULDBLOCK). Both situations returned the text “timeout”.
2015-09-03 15:24:22 +02:00
2 changed files with 9 additions and 4 deletions

View File

@ -219,9 +219,11 @@ local function adjustproxy(reqt)
local proxy = reqt.proxy or _M.PROXY
if proxy then
proxy = url.parse(proxy)
return proxy.host, proxy.port or 3128
proxy.port = proxy.port or 3128
proxy.create = SCHEMES[proxy.scheme].create(reqt)
return proxy.host, proxy.port, proxy.create
else
return reqt.host, reqt.port
return reqt.host, reqt.port, reqt.create
end
end
@ -291,7 +293,10 @@ local function adjustrequest(reqt)
end
-- ajust host and port if there is a proxy
nreqt.host, nreqt.port = adjustproxy(nreqt)
local proxy_create
nreqt.host, nreqt.port, proxy_create = adjustproxy(nreqt)
if not reqt.create then nreqt.create = proxy_create end
return nreqt
end

View File

@ -12,7 +12,7 @@
#define PIE_CONNREFUSED "connection refused"
#define PIE_CONNABORTED "closed"
#define PIE_CONNRESET "closed"
#define PIE_TIMEDOUT "timeout"
#define PIE_TIMEDOUT "connection timeout"
#define PIE_AGAIN "temporary failure in name resolution"
#define PIE_BADFLAGS "invalid value for ai_flags"
#define PIE_BADHINTS "invalid value for hints"