|
|
 |
 |
 |
mainresponder.respond
- On a Macintosh server, when a form is submitted through mainresponder it converts the post arguments to native character set. However it was missing the case where the value of the postarg field was a list - which occurs for checkboxes and multiple selections. This patch converts lists too.
- Logic that compares the If_Modified_Since timestamp out of the requestheader against the last_modified timstamp of the generated page was faulty, as addDebugLog always fails because adrdebuglog is always nil. As far as I know, no cache within the shipping mainresponder and manila sets the Last-Modified timestmap correctly anyway, but manilafixers turbocache does. The intent of this code is to send a code 304 response and no page body, which tells the browser use the locally cached copy, and avoids transfer time of a page which the browser already has . It was apparently never functional. I find it works well with my turbocache if the debug logic is commented out.
Suggested amendments follows - changes in red.
| on respond (adrparamtable, fldebug=false) |
| |
«Started 9/26/98; 10:54:02 AM by DW |
| |
try //everything happens in the context of this try |
| |
else //some code threw a scriptError, catch it |
| |
if s [1] == "!" //it's a faked error |
| |
local (command = string.nthfield (s, ' ', 1)) |
| |
local (args = string.delete (s, 1, sizeof (command) + 1)) |
| |
"!return" «Fr, 12. Mai 2006 at 17:48:13 Uhr by DAB |
| |
local (cachedate = date (adrparamtable^.requestHeaders.["If-Modified-Since"])) |
| |
local (localdate = date (adrparamtable^.responseHeaders.["Last-Modified"])) |
| |
if flDebug //JES 9/16/04: debug calls only work if debugging is on, so this code probably never worked properly |
| |
addDebugLog ("cachedate", cachedate) |
| |
addDebugLog ("localdate", localdate) |
| |
if cachedate >= localdate //the cached object is fresh, so don't send it again |
| |
adrParamTable^.code = 304 |
| |
adrparamtable^.responseBody = "" |
| |
else //show the error to the user |
| |
msgForSysop = string.replaceAll(string.replaceAll(string.replaceAll(msgForSysop, "’", "'"), "“", "\""), "”", "\"") «Fr, 12. Mai 2006 at 14:45:55 Uhr by DAB |
| |
local (title = "UserLand Frontier Server Error") |
| |
local (htmltext = "", indentlevel = 0) |
| |
add ("<html>"); indentlevel++ |
| |
add ("<head>"); indentlevel++ |
| |
add ("<title>" + title + "</title>") |
| |
add ("</head>"); indentlevel-- |
| |
add ("<body>"); indentlevel++ |
| |
add ("<blockquote>"); indentlevel++ |
| |
add ("<blockquote>"); indentlevel++ |
| |
add ("<font size=\"+2\" face=\"helvetica,arial\">"); indentlevel++ |
| |
add ("<br><b>" + "<i>Sorry!</i> There was an error: </b>" + msgForSysop) |
| |
add ("</font>"); indentlevel-- |
| |
«add ("<blockquote>"); indentlevel++ |
| |
add ("<font size=\"+0\" face=\"helvetica,arial\">"); indentlevel++ |
| |
«add ("<p>Object: " + nomad + ".") |
| |
add ("<p>The error was detected by "+ "Frontier " + Frontier.version ()) |
| |
add (" in " + "mainResponder.respond" + ".") |
| |
add (" Webmaster: " + user.prefs.mailaddress + ".") |
| |
add (" Time: " + date.netstandardstring (clock.now ()) + ".") |
| |
add ("</font>"); indentlevel-- |
| |
«add ("</blockquote>"); indentlevel-- |
| |
add ("</blockquote>"); indentlevel-- |
| |
add ("</blockquote>"); indentlevel-- |
| |
add ("</body>"); indentlevel-- |
| |
add ("</html>"); indentlevel-- |
| |
bundle //PBS 8/1/99: iso8859 encode the error page. Some error messages may contain characters which should be translated to HTML entities. |
| |
adrparamtable^.responseBody = htmltext |
| |
try //logging code, we want to log everything, including errors |
| |
bundle //JES 11/5/02: handle HTTP 1.1 HEAD requests |
| |
html.deletePageTableAddress () //PBS 8/25/99: don't leave a dangling pta in the temp table |
| |
if dialog.ask ("URL:", @config.mainResponder.prefs.lastPath) |
| |
«local (fltiming = false) |
Relative to Frontier version 9.7b10
|