mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 04:28:20 +01:00
Final patches...
This commit is contained in:
parent
7121359526
commit
e9d477aba3
20
config
20
config
@ -37,20 +37,20 @@ INSTALL_EXEC=cp
|
|||||||
# Compiler and linker settings
|
# Compiler and linker settings
|
||||||
# for Mac OS X
|
# for Mac OS X
|
||||||
#
|
#
|
||||||
CC=gcc
|
#CC=gcc
|
||||||
DEF=-DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN
|
#DEF=-DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN
|
||||||
CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fno-common
|
#CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fno-common
|
||||||
LDFLAGS=-bundle -undefined dynamic_lookup
|
#LDFLAGS=-bundle -undefined dynamic_lookup
|
||||||
LD=export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc
|
#LD=export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc
|
||||||
|
|
||||||
#------
|
#------
|
||||||
# Compiler and linker settings
|
# Compiler and linker settings
|
||||||
# for Linux
|
# for Linux
|
||||||
#CC=gcc
|
CC=gcc
|
||||||
#DEF=-DLUASOCKET_DEBUG
|
DEF=-DLUASOCKET_DEBUG
|
||||||
#CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fpic
|
CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fpic
|
||||||
#LDFLAGS=-O -shared
|
LDFLAGS=-O -shared
|
||||||
#LD=gcc
|
LD=gcc
|
||||||
|
|
||||||
#------
|
#------
|
||||||
# End of makefile configuration
|
# End of makefile configuration
|
||||||
|
@ -226,9 +226,9 @@ local default = {
|
|||||||
local function adjustrequest(reqt)
|
local function adjustrequest(reqt)
|
||||||
-- parse url if provided
|
-- parse url if provided
|
||||||
local nreqt = reqt.url and url.parse(reqt.url, default) or {}
|
local nreqt = reqt.url and url.parse(reqt.url, default) or {}
|
||||||
local t = url.parse(reqt.url, default)
|
|
||||||
-- explicit components override url
|
-- explicit components override url
|
||||||
for i,v in base.pairs(reqt) do nreqt[i] = v end
|
for i,v in base.pairs(reqt) do nreqt[i] = v end
|
||||||
|
if nreqt.port == "" then nreqt.port = 80 end
|
||||||
socket.try(nreqt.host, "invalid host '" .. base.tostring(nreqt.host) .. "'")
|
socket.try(nreqt.host, "invalid host '" .. base.tostring(nreqt.host) .. "'")
|
||||||
-- compute uri if user hasn't overriden
|
-- compute uri if user hasn't overriden
|
||||||
nreqt.uri = reqt.uri or adjusturi(nreqt)
|
nreqt.uri = reqt.uri or adjusturi(nreqt)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
AuthName "Test Realm"
|
AuthName "Test Realm"
|
||||||
AuthType Basic
|
AuthType Basic
|
||||||
AuthUserFile /Users/diego/tec/luasocket/test/auth/.htpasswd
|
AuthUserFile /home/diego/tec/luasocket/test/auth/.htpasswd
|
||||||
require valid-user
|
require valid-user
|
||||||
|
@ -1 +1 @@
|
|||||||
luasocket:JFMQjUyOPu3yk
|
luasocket:l8n2npozPB.sQ
|
||||||
|
@ -22,7 +22,8 @@ http.TIMEOUT = 10
|
|||||||
|
|
||||||
local t = socket.gettime()
|
local t = socket.gettime()
|
||||||
|
|
||||||
host = host or "diego.student.princeton.edu"
|
--host = host or "diego.student.princeton.edu"
|
||||||
|
host = host or "dell-diego"
|
||||||
proxy = proxy or "http://localhost:3128"
|
proxy = proxy or "http://localhost:3128"
|
||||||
prefix = prefix or "/luasocket-test"
|
prefix = prefix or "/luasocket-test"
|
||||||
cgiprefix = cgiprefix or "/luasocket-test-cgi"
|
cgiprefix = cgiprefix or "/luasocket-test-cgi"
|
||||||
@ -125,6 +126,20 @@ assert(r == nil and e == re, tostring(r) ..", " .. tostring(re) ..
|
|||||||
" vs " .. tostring(e))
|
" vs " .. tostring(e))
|
||||||
print("ok")
|
print("ok")
|
||||||
|
|
||||||
|
io.write("testing invalid empty port: ")
|
||||||
|
request = {
|
||||||
|
url = "http://" .. host .. ":" .. prefix .. "/index.html"
|
||||||
|
}
|
||||||
|
expect = {
|
||||||
|
body = index,
|
||||||
|
code = 200
|
||||||
|
}
|
||||||
|
ignore = {
|
||||||
|
status = 1,
|
||||||
|
headers = 1
|
||||||
|
}
|
||||||
|
check_request(request, expect, ignore)
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
io.write("testing post method: ")
|
io.write("testing post method: ")
|
||||||
-- wanted to test chunked post, but apache doesn't support it...
|
-- wanted to test chunked post, but apache doesn't support it...
|
||||||
|
@ -83,9 +83,10 @@ r, e = smtp.send{
|
|||||||
"<diego@princeton.edu>" },
|
"<diego@princeton.edu>" },
|
||||||
from = "<diego@princeton.edu>",
|
from = "<diego@princeton.edu>",
|
||||||
source = ltn12.source.chain(source, filter),
|
source = ltn12.source.chain(source, filter),
|
||||||
--server = "mail.cs.princeton.edu"
|
server = "mail.cs.princeton.edu",
|
||||||
server = "localhost",
|
--server = "localhost",
|
||||||
port = 2525
|
--port = 2525
|
||||||
|
port = 25
|
||||||
}
|
}
|
||||||
|
|
||||||
print(r, e)
|
print(r, e)
|
||||||
|
Loading…
Reference in New Issue
Block a user