[plt-scheme] v20x -> v299 notes

From: Doug Orleans (dougo at place.org)
Date: Fri Dec 31 18:04:04 EST 2004

Now that I've finally gotten all my servlets to work with v299 again,
here's a list of the changes I ran into that seems to be
un(der)documented.  Hopefully this will make it easier for anyone else
who might be planning follow the same path.  I already posted about
some of these but I'm collecting them all here in one place for the record.
However, I'm leaving out a few bugs (which I've reported via help-desk),
on the assumption that they'll be fixed before v300 so you won't have
to think about a workaround.

* `with-semaphore' in `(lib "thread.ss")' has been removed, but the
  new primitive `call-with-sempahore' seems to be the same thing.
  There is a note in HISTORY about useless procedures in "thread.ss"
  being removed, but it still took me a little while to figure out the

* `url-query' in `(lib "url.ss" "net")' returns a list of
  symbol/string pairs instead of a string or #f.  If the query part of
  the URI doesn't include an equals sign, the whole query becomes a
  symbol mapped to the empty string.  `alist->forml-urlencoded' will
  convert the alist back to a string, but appends an equals sign if
  there is none.

* `url-path' in `(lib "url.ss" "net")' returns a list of strings
  instead of string or #f.  This is alluded to in HISTORY due to the
  realization that rfc2396 allows params to be attached to each path
  segment of a URI.

* `(lib "servlet-helpers.ss" "web-server")' is no longer needed,
  because `(lib "servlet-sig.ss" "web-server")' provides all its
  symbols.  In fact, you can't require both or you'll get duplicate
  symbols.  This change was announced on this list but it's not in
  MzScheme_300.txt or HISTORY.

* `request-headers' in `(lib "servlet-sig.ss" "web-server")' is a
  list of symbol/bytes pairs instead of symbol/string pairs.
  `request-bindings' is still a list of symbol/string pairs.

* The `response/full' and `response/incremental' structs have been
  moved from `(lib "servlet-sig.ss" "web-server")' to
  `(lib "response.ss" "web-server")'.  The "mime" field is a bytes
  instead of a string.  The field accessors and mutators are no longer
  provided, i.e. the structs are opaque.

* Errors while handling web-server requests are now reported to
  stderr.  I think the errors are generally innocuous, for example:

    tcp-read: error reading (Connection reset by peer; errno=104)
    tcp-write: error writing (Broken pipe; errno=32)
    tcp-write: error writing (Connection reset by peer; errno=104)
    read-request: http input closed abruptly
    tcp-addresses: could not get peer address (Transport endpoint is not connected; errno=107)

  Arguably some or all of these should just be handled silently.

--dougo at place.org

Posted on the users mailing list.