aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCaleb Maclennan <caleb@alerque.com>2022-03-24 18:11:07 +0300
committerCaleb Maclennan <caleb@alerque.com>2022-03-24 18:11:07 +0300
commit2de8ddfbb837a75b1cb5f09a656379c1e7cc589c (patch)
tree20b5f7b8a48d1c126763daca3860fcfb7c3b59a7 /src
parentf9e1d03f3c6c9fc59dd3b91716debc23aebf947f (diff)
parent5ed8b66e6d0c295f95fade159ada0f97f482b2ac (diff)
downloadluasocket-2de8ddfbb837a75b1cb5f09a656379c1e7cc589c.tar.gz
luasocket-2de8ddfbb837a75b1cb5f09a656379c1e7cc589c.tar.bz2
luasocket-2de8ddfbb837a75b1cb5f09a656379c1e7cc589c.zip
Merge remote-tracking branch 'upstream/master' into test-builds
Diffstat (limited to 'src')
-rw-r--r--src/http.lua7
-rw-r--r--src/ltn12.lua6
-rwxr-xr-xsrc/makefile12
3 files changed, 16 insertions, 9 deletions
diff --git a/src/http.lua b/src/http.lua
index e3a1742..1330355 100644
--- a/src/http.lua
+++ b/src/http.lua
@@ -283,6 +283,13 @@ local function adjustrequest(reqt)
283 nreqt.uri = reqt.uri or adjusturi(nreqt) 283 nreqt.uri = reqt.uri or adjusturi(nreqt)
284 -- adjust headers in request 284 -- adjust headers in request
285 nreqt.headers = adjustheaders(nreqt) 285 nreqt.headers = adjustheaders(nreqt)
286 if nreqt.source
287 and not nreqt.headers["content-length"]
288 and not nreqt.headers["transfer-encoding"]
289 then
290 nreqt.headers["transfer-encoding"] = "chunked"
291 end
292
286 -- ajust host and port if there is a proxy 293 -- ajust host and port if there is a proxy
287 nreqt.host, nreqt.port = adjustproxy(nreqt) 294 nreqt.host, nreqt.port = adjustproxy(nreqt)
288 return nreqt 295 return nreqt
diff --git a/src/ltn12.lua b/src/ltn12.lua
index f1e05e1..4cb17f5 100644
--- a/src/ltn12.lua
+++ b/src/ltn12.lua
@@ -11,6 +11,8 @@ local string = require("string")
11local table = require("table") 11local table = require("table")
12local unpack = unpack or table.unpack 12local unpack = unpack or table.unpack
13local base = _G 13local base = _G
14local select = select
15
14local _M = {} 16local _M = {}
15if module then -- heuristic for exporting a global package table 17if module then -- heuristic for exporting a global package table
16 ltn12 = _M -- luacheck: ignore 18 ltn12 = _M -- luacheck: ignore
@@ -22,8 +24,6 @@ _M.source = source
22_M.sink = sink 24_M.sink = sink
23_M.pump = pump 25_M.pump = pump
24 26
25local unpack = unpack or table.unpack
26
27-- 2048 seems to be better in windows... 27-- 2048 seems to be better in windows...
28_M.BLOCKSIZE = 2048 28_M.BLOCKSIZE = 2048
29_M._VERSION = "LTN12 1.0.3" 29_M._VERSION = "LTN12 1.0.3"
@@ -45,7 +45,7 @@ end
45-- (thanks to Wim Couwenberg) 45-- (thanks to Wim Couwenberg)
46function filter.chain(...) 46function filter.chain(...)
47 local arg = {...} 47 local arg = {...}
48 local n = base.select('#',...) 48 local n = select('#',...)
49 local top, index = 1, 1 49 local top, index = 1, 1
50 local retry = "" 50 local retry = ""
51 return function(chunk) 51 return function(chunk)
diff --git a/src/makefile b/src/makefile
index 522d378..f95498a 100755
--- a/src/makefile
+++ b/src/makefile
@@ -16,7 +16,7 @@
16# platform to build for 16# platform to build for
17PLAT?=linux 17PLAT?=linux
18 18
19# LUAV: 5.1 5.2 19# LUAV: 5.1 5.2 5.3 5.4
20# lua version to build against 20# lua version to build against
21LUAV?=5.1 21LUAV?=5.1
22 22
@@ -163,7 +163,7 @@ O_macosx=o
163CC_macosx=gcc 163CC_macosx=gcc
164DEF_macosx= -DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN 164DEF_macosx= -DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN
165CFLAGS_macosx=$(LUAINC:%=-I%) $(DEF) -Wall -O2 -fno-common 165CFLAGS_macosx=$(LUAINC:%=-I%) $(DEF) -Wall -O2 -fno-common
166LDFLAGS_macosx= -bundle -undefined dynamic_lookup -o 166LDFLAGS_macosx= -bundle -undefined dynamic_lookup -o
167LD_macosx=gcc 167LD_macosx=gcc
168SOCKET_macosx=usocket.o 168SOCKET_macosx=usocket.o
169 169
@@ -176,7 +176,7 @@ CC_linux=gcc
176DEF_linux=-DLUASOCKET_$(DEBUG) 176DEF_linux=-DLUASOCKET_$(DEBUG)
177CFLAGS_linux=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \ 177CFLAGS_linux=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
178 -Wimplicit -O2 -ggdb3 -fpic 178 -Wimplicit -O2 -ggdb3 -fpic
179LDFLAGS_linux=-O -shared -fpic -o 179LDFLAGS_linux=-O -shared -fpic -o
180LD_linux=gcc 180LD_linux=gcc
181SOCKET_linux=usocket.o 181SOCKET_linux=usocket.o
182 182
@@ -189,7 +189,7 @@ CC_freebsd=gcc
189DEF_freebsd=-DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN 189DEF_freebsd=-DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN
190CFLAGS_freebsd=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \ 190CFLAGS_freebsd=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
191 -Wimplicit -O2 -ggdb3 -fpic 191 -Wimplicit -O2 -ggdb3 -fpic
192LDFLAGS_freebsd=-O -shared -fpic -o 192LDFLAGS_freebsd=-O -shared -fpic -o
193LD_freebsd=gcc 193LD_freebsd=gcc
194SOCKET_freebsd=usocket.o 194SOCKET_freebsd=usocket.o
195 195
@@ -202,7 +202,7 @@ CC_solaris=gcc
202DEF_solaris=-DLUASOCKET_$(DEBUG) 202DEF_solaris=-DLUASOCKET_$(DEBUG)
203CFLAGS_solaris=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \ 203CFLAGS_solaris=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
204 -Wimplicit -O2 -ggdb3 -fpic 204 -Wimplicit -O2 -ggdb3 -fpic
205LDFLAGS_solaris=-lnsl -lsocket -lresolv -O -shared -fpic -o 205LDFLAGS_solaris=-lnsl -lsocket -lresolv -O -shared -fpic -o
206LD_solaris=gcc 206LD_solaris=gcc
207SOCKET_solaris=usocket.o 207SOCKET_solaris=usocket.o
208 208
@@ -215,7 +215,7 @@ CC_mingw=gcc
215DEF_mingw= -DLUASOCKET_$(DEBUG) \ 215DEF_mingw= -DLUASOCKET_$(DEBUG) \
216 -DWINVER=0x0501 216 -DWINVER=0x0501
217CFLAGS_mingw=$(LUAINC:%=-I%) $(DEF) -Wall -O2 -fno-common 217CFLAGS_mingw=$(LUAINC:%=-I%) $(DEF) -Wall -O2 -fno-common
218LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o 218LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o
219LD_mingw=gcc 219LD_mingw=gcc
220SOCKET_mingw=wsocket.o 220SOCKET_mingw=wsocket.o
221 221