swiki, commanche , 3.6, network rewrite, oh my

ar ly4aegw02 at sneakemail.com
Sat Nov 8 01:42:06 UTC 2003


On Thu, 06 Nov 2003 19:00:48 +0100, Chris Burkert wrote:

> Hi ar,
> 
> (du you have a name?)

yes: Alan Reider

> SmallWiki 0.9.20 is still not stable on squeak, it is not even yet
> announced for squeak. The reason I put it on Squeakmap is, to get some
> help by other people.
> 
> If you want to help me, please do so!
> 
> Please keep in mind that I do this work in my rare spare time ... like
> many squeakers :)

I do, and I am very thankful for it. Maybe I can make a small contribution
on this particular bug.

I think the problem is that the form fields in the request are recorded as
multi-value fields. (irrespective of HttpRequest>>#multiValueFormField)
but SmallWiki is expecting single value fields.

In HttpRequest>>#postFields there is the code:

self class decodeUrlEncodedForm: self rawPostFields multipleValues: true.

That calls

HttpRequest class>>addKey: key value: value toForm: dict multipleValues:
boolean
	boolean
		ifTrue: [dict at: key put:
		value]HttpRequest>>addKey:value:toForm:multipleValues. ifFalse: [(dict
		includesKey: key)
			ifFalse: [dict at: key put: value]
			ifTrue: [dict at: key modify: [:oldValue | oldValue, value]]]

The value of the multpleValues argument is true so it does the simple
#at:put instead of making a collection (that seems to be the exact
opposite of the name of the argument).

But in HttpFormDictionary>>at:put:

instead of just storing the value it wraps it in an OrderedCollection. So
now we have a form field which is an OC instead of a String.

Later on SWWikiScanner is expecting to parse a stream on a string and
finds instead an OrderedCollection. It gets an element from the
inputstream and trys to put it into the outstream. But this element is a
string from the OC instead of a character from a String. This causes the
"Strings only store characters" error in WriteStream>>nextPut:

I dont understand what the discrepancy is between the expection by
SmallWiki of Strings as form values and Comanche storing them as OC's





More information about the Squeak-dev mailing list