mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-25 03:58:21 +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
|
||||
# for Mac OS X
|
||||
#
|
||||
CC=gcc
|
||||
DEF=-DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN
|
||||
CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fno-common
|
||||
LDFLAGS=-bundle -undefined dynamic_lookup
|
||||
LD=export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc
|
||||
#CC=gcc
|
||||
#DEF=-DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN
|
||||
#CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fno-common
|
||||
#LDFLAGS=-bundle -undefined dynamic_lookup
|
||||
#LD=export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc
|
||||
|
||||
#------
|
||||
# Compiler and linker settings
|
||||
# for Linux
|
||||
#CC=gcc
|
||||
#DEF=-DLUASOCKET_DEBUG
|
||||
#CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fpic
|
||||
#LDFLAGS=-O -shared
|
||||
#LD=gcc
|
||||
CC=gcc
|
||||
DEF=-DLUASOCKET_DEBUG
|
||||
CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fpic
|
||||
LDFLAGS=-O -shared
|
||||
LD=gcc
|
||||
|
||||
#------
|
||||
# End of makefile configuration
|
||||
|
@ -226,9 +226,9 @@ local default = {
|
||||
local function adjustrequest(reqt)
|
||||
-- parse url if provided
|
||||
local nreqt = reqt.url and url.parse(reqt.url, default) or {}
|
||||
local t = url.parse(reqt.url, default)
|
||||
-- explicit components override url
|
||||
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) .. "'")
|
||||
-- compute uri if user hasn't overriden
|
||||
nreqt.uri = reqt.uri or adjusturi(nreqt)
|
||||
|
@ -1,4 +1,4 @@
|
||||
AuthName "Test Realm"
|
||||
AuthType Basic
|
||||
AuthUserFile /Users/diego/tec/luasocket/test/auth/.htpasswd
|
||||
AuthUserFile /home/diego/tec/luasocket/test/auth/.htpasswd
|
||||
require valid-user
|
||||
|
@ -1 +1 @@
|
||||
luasocket:JFMQjUyOPu3yk
|
||||
luasocket:l8n2npozPB.sQ
|
||||
|
@ -22,7 +22,8 @@ http.TIMEOUT = 10
|
||||
|
||||
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"
|
||||
prefix = prefix or "/luasocket-test"
|
||||
cgiprefix = cgiprefix or "/luasocket-test-cgi"
|
||||
@ -125,6 +126,20 @@ assert(r == nil and e == re, tostring(r) ..", " .. tostring(re) ..
|
||||
" vs " .. tostring(e))
|
||||
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: ")
|
||||
-- wanted to test chunked post, but apache doesn't support it...
|
||||
|
@ -83,9 +83,10 @@ r, e = smtp.send{
|
||||
"<diego@princeton.edu>" },
|
||||
from = "<diego@princeton.edu>",
|
||||
source = ltn12.source.chain(source, filter),
|
||||
--server = "mail.cs.princeton.edu"
|
||||
server = "localhost",
|
||||
port = 2525
|
||||
server = "mail.cs.princeton.edu",
|
||||
--server = "localhost",
|
||||
--port = 2525
|
||||
port = 25
|
||||
}
|
||||
|
||||
print(r, e)
|
||||
|
Loading…
Reference in New Issue
Block a user