space Baylys
Just practicing to pass the Turing test.
space
space
space
space
Developer for Hire!
space
addedValues Plugin
space

Home

What's new

Bayly.Root

Cornershop Plugin

Career

edutools Root

Enhancements

Interests

linguist Plugin

Manila

Patches

space

mainresponder

space
space

adminSite

calendar

controlpanel

discuss

getFileMimeType

members

parseMultipart

respond

subscriptions

space

manilaData

manilamacros

manilaSuite

system

Patches by Group

Papers

Sales

Sign My Guestbook

User(land) Relations.

Contact Address

Search Baylys

urlchains

space
Join Now
Login
space space space

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
 unaltered lines omitted
  on core ()
 unaltered lines omitted
  if fldebug
 unaltered lines omitted
  else
  try //everything happens in the context of this try
 unaltered lines omitted
  else //some code threw a scriptError, catch it
  local (s = tryError)
  if s [1] == "!" //it's a faked error
  local (command = string.nthfield (s, ' ', 1))
  local (args = string.delete (s, 1, sizeof (command) + 1))
  case command
  "!redirect"
 unaltered lines omitted
  "!return" «Fr, 12. Mai 2006 at 17:48:13 Uhr by DAB
  try
  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
  local (msgForSysop = s)
  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)
  on add (s)
 unaltered lines omitted
  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
 unaltered lines omitted
  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
  return (true)
bundle //test code
  if dialog.ask ("URL:", @config.mainResponder.prefs.lastPath)
 unaltered lines omitted
«bundle //old test code
  «local (fltiming = false)
  «if fltiming
 unaltered lines omitted
  «else
 unaltered lines omitted

Relative to Frontier version 9.7b10