A couple of fixes
This commit is contained in:
1 parent
ce0b450ae6
commit
0b06742f45
3 files changed
+6
-3
No files matched your search
@@ -79,8 +79,8 @@ namespace RokuYoutube.Http
|
|||||||
err(m, "couldn't process request or reply, closing @" + m.client)
|
err(m, "couldn't process request or reply, closing @" + m.client)
|
||||||
end if
|
end if
|
||||||
else if m.request.buf.len() > m.settings.MaxRequestLength ' die if it's too long
|
else if m.request.buf.len() > m.settings.MaxRequestLength ' die if it's too long
|
||||||
' TODO default_reply doesn't exist?
|
m.reply = new HttpReply(m.request, m.settings)
|
||||||
m.default_reply(413, "Request Entity Too Large", "Your request was dropped because it was too long.")
|
m.reply.Default(413, "Your request was dropped because it was too long.")
|
||||||
m.SetState(HttpConnectionState.SEND_HEADER)
|
m.SetState(HttpConnectionState.SEND_HEADER)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
|||||||
@@ -144,6 +144,10 @@ namespace RokuYoutube.Http
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function Default(errcode as integer, reason as string)
|
function Default(errcode as integer, reason as string)
|
||||||
|
if m.now = invalid
|
||||||
|
m.now = rfc1123_date(Now())
|
||||||
|
end if
|
||||||
|
|
||||||
errname = HttpTitle(errcode)
|
errname = HttpTitle(errcode)
|
||||||
|
|
||||||
buf = "<html><head><title>" + Stri(errcode).trim() + " " + errname + "</title></head><body>" + UnixNL()
|
buf = "<html><head><title>" + Stri(errcode).trim() + " " + errname + "</title></head><body>" + UnixNL()
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ namespace RokuYoutube.Http
|
|||||||
|
|
||||||
function IsComplete() as boolean
|
function IsComplete() as boolean
|
||||||
buf = m.buf
|
buf = m.buf
|
||||||
' TODO check if Unix2NewLine is right
|
|
||||||
complete = isstr(buf) and (right(buf, 2) = m.Unix2NewLine) or (right(buf, 4) = m.Windows2NewLine)
|
complete = isstr(buf) and (right(buf, 2) = m.Unix2NewLine) or (right(buf, 4) = m.Windows2NewLine)
|
||||||
'if complete then info(m,"header:"+UnixNL()+buf)
|
'if complete then info(m,"header:"+UnixNL()+buf)
|
||||||
return complete
|
return complete
|
||||||
|
|||||||
Reference in new issue
Block a user