[kaffe] DataInputStream related merge

Jukka Santala jsantala@morphine.tml.hut.fi
Fri, 4 Oct 2002 17:14:40 +0300 (EEST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-1804928587-1033740880=:21835
Content-Type: TEXT/PLAIN; charset=US-ASCII

Fairly straightforward merge from PocketLinux version, only problem is
neither version of Kaffe has exact implementation. With Kaffe.org's
version the problem is actually encountered, though - using Xerces XML
parser, the HTTP code will eat out the headers using readLine, but then
Xerces will use something else than DataInputStream to parse the remaining
data. Because that reader doesn't know to eat the extra line-feed, it gets
stuck at the beginning of the parse-input, which then doesn't fullfill the
XML-production condition, and causes all XML documents read over HTTP to
fail. If anybody can come up with an implementation that doesn't need
mark()/reset(), I'd be happy. If not, this corrects few exception issues
and at least works, unlike the old code :)

 -Jukka Santala

---559023410-1804928587-1033740880=:21835
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="kaffe-donwulff-fismerge.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.44.0210041714400.21835@morphine.tml.hut.fi>
Content-Description: 
Content-Disposition: attachment; filename="kaffe-donwulff-fismerge.patch"

SW5kZXg6IGxpYnJhcmllcy9qYXZhbGliL2phdmEvaW8vRGF0YUlucHV0Lmph
dmENCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT0NClJDUyBmaWxlOiAvY3ZzL2th
ZmZlL2thZmZlL2xpYnJhcmllcy9qYXZhbGliL2phdmEvaW8vRGF0YUlucHV0
LmphdmEsdg0KcmV0cmlldmluZyByZXZpc2lvbiAxLjUNCmRpZmYgLXUgLXIx
LjUgRGF0YUlucHV0LmphdmENCi0tLSBsaWJyYXJpZXMvamF2YWxpYi9qYXZh
L2lvL0RhdGFJbnB1dC5qYXZhCTI0IE5vdiAyMDAxIDAxOjUyOjQ5IC0wMDAw
CTEuNQ0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