I've encountered a problem using Com46Swiki11. Everything was working fine when the 
server and client were on the same machine, but when I moved the server to a different 
machine, things started getting a bit flaky. I tracked the problem to 
SocketStream>>getSubHeader (which is used in MultipartPostModule and in some custom 
code I derived from same). What happens is that if this method is reached before the 
requisite data has been received, the method returns an indication that no subheader 
was found, which effectively ends processing of the POST. I made the change below to 
keep looking as long as the socket remained connected and the problem went away.

Cheers,
Bob

'From Squeak2.9alpha of 13 June 2000 [latest update: #2710] on 15 October 2000 at 
2:55:12 pm'!

!SocketStream methodsFor: 'http' stamp: 'RAA 10/15/2000 14:54'!
getSubHeader
        " return a MIME section header "
        | i result string dict |
        string _ inStream contents.
        self resetInStream.
        [(i _ string findString: String crlf, String crlf) > 0
                ifTrue: [result _ string copyFrom: 1 to: i-1.
                        inStream nextPutAll: (string copyFrom: i to: string size).
                        self next: 4. " ignore CRLFCRLF "
                        ^HttpRequest parseHeader: result].
        socket isConnected "and: [socket dataAvailable]"]
                whileTrue:
        [string _ string, socket getData].
        result _ string.
        dict _ HttpRequest parseHeader: result.
        dict isEmptyOrNil ifFalse: [self next: 4]. " ignore CRLFCRLF "
        ^dict! !

Reply via email to