<div dir="ltr"><div dir="ltr">Hi guys,</div><div dir="ltr"><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
url), but I'd rather change the server (squeaksource image) to accept POST <br>
requests as well. Then the only change needed in the image would be to <br>
replace httpGet: with httpPost:.<br></blockquote><div><br></div><div><div>Yes, me too.</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Then the only change needed in the image would be to <br>replace httpGet: with httpPost:.<br></blockquote><div><br></div><div>SqueakSource was designed since the beginning to treat every PUT request as a file upload (.mcm or .mcz).  This is method which handles them, in SSSession:</div></div></div><div><br></div><div>    putRequest: aProject<br>        | author data version response blessed |<br>        self expire.<br>        (self isAllowed: SSAccessPolicy write in: aProject)<br>            ifFalse: [ self authentificateProject: aProject ].<br>        author := self user ifNil: [ SSMember anonymousMember ].<br>        SSRepository current log: 'PUT ', self request url, ' (', author initials, ')'.<br>        data := self request at: 'PUTData'.<br><br>        (self request url endsWith: '.mcm')<br>            ifTrue: [aProject addConfig: data author: author url: self request url]<br>            ifFalse: [version := aProject addVersion: data author: author].<br><br>        (version notNil and: [self request accessPath second = 'blessed'])<br>            ifTrue: [blessed := true.<br>                    aProject<br>                        blessVersion: version<br>                        ifForbidden: [ blessed := false] ].<br>        "Only filesystems actually need to save here, databases already saved, above, in addConfig:... | addVersion:"<br>        self saveIf: [ : repository | repository isDatabase not ].<br>        response := SSCreatedResponse new.<br>        blessed ifNotNil: [<br>            blessed<br>                ifTrue: [ response nextPutAll: 'Version blessed' ]<br>                ifFalse: [ response nextPutAll: 'Version NOT blessed' ] ].<br>        self returnResponse: response<br></div><div><br></div><div>The challenge is not just reconfiguring the code, of course, but the protocol.  The client is constrained to use of core image code only (e.g., not STON code) and the server needs to remain backward compatible with older client images.  It looks like it checks its url to see if its a '.mcm' suffix, otherwise assumes its an .mcz.  Perhaps it could do something else if it was neither of those...?</div><div><br></div><div><div>The code running our server loads cleanly and easily into a modern image:</div><div><div><br></div><div>    Scanner allowUnderscoreAsAssignment: true.<br>    Installer new merge: #squeaksource.</div></div></div><div><br></div><div>I'd love if someone with HTTP expertise would like to take a crack at it.  While in there, don't forget Levente has another good suggestion to increase the number of semaphores for better performance, too.</div><div><div><br></div></div><div> - Chris</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Levente<br>
<br>
><br>
> Dave<br>
<br>
</blockquote></div></div>