SqueakSource/Seaside question - has anyone seen this problem before?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

SqueakSource/Seaside question - has anyone seen this problem before?

David T. Lewis
Has anyone with experience on Seaside and/or SqueakSource ever seen symptoms
like we are currently experiencing here:

   http://squeaksource.com

Our squeaksource.com server has for some reason gotten itself confused
and has a broken web interface. The repository itself is fine, so this
is not an emergency. However, the web interface is broken and seems to
be emitting chunks of incomplete html. I can restore things to working
order by reloading from a backup image, but I would prefer to understand
what has going wrong first.

The problem is definitely in the image itself, as opposed to Apache or
anything else about the server. When I run the image on my own PC at home,
I get identical symptoms.

I am no expert in Seaside, and working through it in a debugger is making
my head spin so I'm going to take the easy way out and just ask - has
anybody seen this kind of problem before?

TIA,
Dave

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SqueakSource/Seaside question - has anyone seen this problem before?

Bob Arning-2
If you click one of the links on the first page, the next page looks good. If you then go back, the css from page 2 makes page1 look a little better. So, the breakage is limited. Any way to share the image?

Cheers,
Bob

On 12/21/13 6:06 PM, David T. Lewis wrote:
Has anyone with experience on Seaside and/or SqueakSource ever seen symptoms
like we are currently experiencing here:

   http://squeaksource.com

Our squeaksource.com server has for some reason gotten itself confused
and has a broken web interface. The repository itself is fine, so this
is not an emergency. However, the web interface is broken and seems to
be emitting chunks of incomplete html. I can restore things to working
order by reloading from a backup image, but I would prefer to understand
what has going wrong first.

The problem is definitely in the image itself, as opposed to Apache or
anything else about the server. When I run the image on my own PC at home,
I get identical symptoms.

I am no expert in Seaside, and working through it in a debugger is making
my head spin so I'm going to take the easy way out and just ask - has
anybody seen this kind of problem before?

TIA,
Dave

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SqueakSource/Seaside question - has anyone seen this problem before?

David T. Lewis
On Sat, Dec 21, 2013 at 07:41:08PM -0500, Bob Arning wrote:
> If you click one of the links on the first page, the next page looks
> good. If you then go back, the css from page 2 makes page1 look a little
> better. So, the breakage is limited. Any way to share the image?

Thanks Bob,

A copy of the image is at http://box2.squeak.org/ss_image_for_bob.zip

The zip is encripted, I will send the password to you in a separate email.

Dave

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SqueakSource/Seaside question - has anyone seen this problem before?

Bob Arning-2
David,

The short answer is that two users (St鰨ane Munioz St鰨ane Munioz) have wide characters in their name and this does the damage. The method below is a quick hack to filter these 2 out of the list and all seems good.

Cheers,
Bob

'From Squeak3.11alpha of 6 January 2010 [latest update: #8824] on 21 December 2013 at 11:21:03 pm'!

!SSHome methodsFor: 'statistics'!
membersNew
    | t1 |
    t1 := self statistics membersNew.
    ^ t1
        reject: [:t2 | t2 asString
                anySatisfy: [:t3 | t3 asciiValue > 255]]! !




On 12/21/13 9:25 PM, David T. Lewis wrote:
On Sat, Dec 21, 2013 at 07:41:08PM -0500, Bob Arning wrote:
If you click one of the links on the first page, the next page looks 
good. If you then go back, the css from page 2 makes page1 look a little 
better. So, the breakage is limited. Any way to share the image?
Thanks Bob,

A copy of the image is at http://box2.squeak.org/ss_image_for_bob.zip

The zip is encripted, I will send the password to you in a separate email.

Dave




_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SqueakSource/Seaside question - has anyone seen this problem before?

David T. Lewis
Bob,

This is absolutely great, thank you so much for the help. I just loaded
your patch into the running image, and the http://squeaksource.com web
interface is back to normal again.

Dave


On Sat, Dec 21, 2013 at 11:25:59PM -0500, Bob Arning wrote:

> David,
>
> The short answer is that two users (St?ane Munioz St?ane Munioz) have
> wide characters in their name and this does the damage. The method below
> is a quick hack to filter these 2 out of the list and all seems good.
>
> Cheers,
> Bob
>
> 'From Squeak3.11alpha of 6 January 2010 [latest update: #8824] on 21
> December 2013 at 11:21:03 pm'!
>
> !SSHome methodsFor: 'statistics'!
> membersNew
>     | t1 |
>     t1 := self statistics membersNew.
>     ^ t1
>         reject: [:t2 | t2 asString
>                 anySatisfy: [:t3 | t3 asciiValue > 255]]! !
>
>
>
>
> On 12/21/13 9:25 PM, David T. Lewis wrote:
> >On Sat, Dec 21, 2013 at 07:41:08PM -0500, Bob Arning wrote:
> >>If you click one of the links on the first page, the next page looks
> >>good. If you then go back, the css from page 2 makes page1 look a little
> >>better. So, the breakage is limited. Any way to share the image?
> >Thanks Bob,
> >
> >A copy of the image is at http://box2.squeak.org/ss_image_for_bob.zip
> >
> >The zip is encripted, I will send the password to you in a separate email.
> >
> >Dave
> >
> >
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
tty
Reply | Threaded
Open this post in threaded view
|

Re: SqueakSource/Seaside question - has anyone seen this problem before?

tty
Three cheers for Bob!



---- On Sat, 21 Dec 2013 21:03:02 -0800 David T. Lewis <[hidden email]> wrote ----

Bob,

This is absolutely great, thank you so much for the help. I just loaded
your patch into the running image, and the http://squeaksource.com web
interface is back to normal again.

Dave


On Sat, Dec 21, 2013 at 11:25:59PM -0500, Bob Arning wrote:

> David,
>
> The short answer is that two users (St?ane Munioz St?ane Munioz) have
> wide characters in their name and this does the damage. The method below
> is a quick hack to filter these 2 out of the list and all seems good.
>
> Cheers,
> Bob
>
> 'From Squeak3.11alpha of 6 January 2010 [latest update: #8824] on 21
> December 2013 at 11:21:03 pm'!
>
> !SSHome methodsFor: 'statistics'!
> membersNew
> | t1 |
> t1 := self statistics membersNew.
> ^ t1
> reject: [:t2 | t2 asString
> anySatisfy: [:t3 | t3 asciiValue > 255]]! !
>
>
>
>
> On 12/21/13 9:25 PM, David T. Lewis wrote:
> >On Sat, Dec 21, 2013 at 07:41:08PM -0500, Bob Arning wrote:
> >>If you click one of the links on the first page, the next page looks
> >>good. If you then go back, the css from page 2 makes page1 look a little
> >>better. So, the breakage is limited. Any way to share the image?
> >Thanks Bob,
> >
> >A copy of the image is at http://box2.squeak.org/ss_image_for_bob.zip
> >
> >The zip is encripted, I will send the password to you in a separate email.
> >
> >Dave
> >
> >
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SqueakSource/Seaside question - has anyone seen this problem before?

Bob Arning-2
In reply to this post by David T. Lewis
David,

Here is an alternative that tries to print the item rather than delete it. You can revert the previous fix, if you like.

Cheers,
Bob


'From Squeak3.11alpha of 6 January 2010 [latest update: #8824] on 22 December 2013 at 10:32:55 am'!

!WideString methodsFor: 'converting' stamp: 'raa 12/22/2013 10:31'!
printHtmlOn: aStream

    self squeakToUtf8 printHtmlOn: aStream! !


On 12/22/13 12:03 AM, David T. Lewis wrote:
Bob,

This is absolutely great, thank you so much for the help. I just loaded
your patch into the running image, and the http://squeaksource.com web
interface is back to normal again.

Dave


On Sat, Dec 21, 2013 at 11:25:59PM -0500, Bob Arning wrote:
David,

The short answer is that two users (St?ane Munioz St?ane Munioz) have 
wide characters in their name and this does the damage. The method below 
is a quick hack to filter these 2 out of the list and all seems good.

Cheers,
Bob

'From Squeak3.11alpha of 6 January 2010 [latest update: #8824] on 21 
December 2013 at 11:21:03 pm'!

!SSHome methodsFor: 'statistics'!
membersNew
    | t1 |
    t1 := self statistics membersNew.
    ^ t1
        reject: [:t2 | t2 asString
                anySatisfy: [:t3 | t3 asciiValue > 255]]! !




On 12/21/13 9:25 PM, David T. Lewis wrote:
On Sat, Dec 21, 2013 at 07:41:08PM -0500, Bob Arning wrote:
If you click one of the links on the first page, the next page looks
good. If you then go back, the css from page 2 makes page1 look a little
better. So, the breakage is limited. Any way to share the image?
Thanks Bob,

A copy of the image is at http://box2.squeak.org/ss_image_for_bob.zip

The zip is encripted, I will send the password to you in a separate email.

Dave



      

    


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SqueakSource/Seaside question - has anyone seen this problem before?

Levente Uzonyi-2
On Sun, 22 Dec 2013, Bob Arning wrote:

> David,
>
> Here is an alternative that tries to print the item rather than delete it. You can revert the previous fix, if you like.

The problem with this solution is that it will print a string using UTF-8
encoding, but Seaside will return a XHTML page with ISO-8859-1 endocing.
There are two ways to solve it:
1: use NCRs[1] to encode the names. This might be a problem, because one
has to make sure that seaside won't encode the & characters.
2: change the default character encoding to UTF-8, which might lead to
other problems.


Levente

[1]https://en.wikipedia.org/wiki/Numeric_character_reference

>
> Cheers,
> Bob
>
>
> 'From Squeak3.11alpha of 6 January 2010 [latest update: #8824] on 22 December 2013 at 10:32:55 am'!
>
> !WideString methodsFor: 'converting' stamp: 'raa 12/22/2013 10:31'!
> printHtmlOn: aStream
>
>     self squeakToUtf8 printHtmlOn: aStream! !
>
>
> On 12/22/13 12:03 AM, David T. Lewis wrote:
>
> Bob,
>
> This is absolutely great, thank you so much for the help. I just loaded
> your patch into the running image, and the http://squeaksource.com web
> interface is back to normal again.
>
> Dave
>
>
> On Sat, Dec 21, 2013 at 11:25:59PM -0500, Bob Arning wrote:
>
> David,
>
> The short answer is that two users (St?ane Munioz St?ane Munioz) have
> wide characters in their name and this does the damage. The method below
> is a quick hack to filter these 2 out of the list and all seems good.
>
> Cheers,
> Bob
>
> 'From Squeak3.11alpha of 6 January 2010 [latest update: #8824] on 21
> December 2013 at 11:21:03 pm'!
>
> !SSHome methodsFor: 'statistics'!
> membersNew
>     | t1 |
>     t1 := self statistics membersNew.
>     ^ t1
>         reject: [:t2 | t2 asString
>                 anySatisfy: [:t3 | t3 asciiValue > 255]]! !
>
>
>
>
> On 12/21/13 9:25 PM, David T. Lewis wrote:
>
> On Sat, Dec 21, 2013 at 07:41:08PM -0500, Bob Arning wrote:
>
> If you click one of the links on the first page, the next page looks
> good. If you then go back, the css from page 2 makes page1 look a little
> better. So, the breakage is limited. Any way to share the image?
>
> Thanks Bob,
>
> A copy of the image is at http://box2.squeak.org/ss_image_for_bob.zip
>
> The zip is encripted, I will send the password to you in a separate email.
>
> Dave
>
>
>
>
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

David T. Lewis
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

Philippe Marschall
On Sun, Dec 22, 2013 at 5:50 PM, David T. Lewis <[hidden email]> wrote:

> I think that we probably have a few issues related to wide strings in the
> SqueakSource code, and these issues certainly will effect source.squeak.org
> in the same way that we have seen on squeaksource.com. The only difference
> being that we do not happen to have any author names with multibyte characters
> registered on source.squeak.org at the moment.
>
> When I was originally loading the old SqueakSource onto our squeak.org servers,
> I found some problems with the image updating its repository from disk, and
> at the time I chose to work around them manually in order to get the system
> up and running. But there seem to be places where the identity of an author
> is saved in the repository (in the image, not on disk), and stored with
> possibly different encoding in the MCZ file names on disk, and may be stored
> with yet another possibly different encoding internally within the MCZ file.
>
> The good news is that the squeaksource.com files and image give us enough
> real life data that we should be able to locate the problem cases and think
> about how to handle them properly. For example, the ss.log file shows evidence
> of continuing problems related to six specific files:
>
> 2013-12-21T18:39:10.089+00:00 RECOVERING FelTimetable/FelTimetable-M·Sa.53.mcz
> 2013-12-21T18:39:11.353+00:00 RECOVERING FelTimetable/FelTimetable-M·Sa.52.mcz
> 2013-12-21T18:39:11.602+00:00 RECOVERING FelTimetable/FelTimetable-M·Sa.55.mcz
> 2013-12-21T18:39:12.884+00:00 RECOVERING FelTimetable/FelTimetable-M·Sa.66.mcz
> 2013-12-21T18:39:14.193+00:00 RECOVERING FelTimetable/FelTimetable-M·Sa.54.mcz
> 2013-12-21T18:39:15.45+00:00 RECOVERING FelTimetable/Seaside2.8a1-M·Sa.49.mcz
>
> So some follow up is needed. But maybe not today, for now I'm just happy
> to have the site running again :-)

Long story short it's messy and your options are kinda limited. The
problems stem from the fact that the Seaside version of SqueakSource
is very old (probably a decade by now). It's unmaintained and missing
all the Unicode fixes that went in over the past years. There are
newer versions of SqueakSource available [1] [2] [3] that work with
newer versions of Seaside. The trouble however is migrating (you'll
likely have to migrate to a newer version of Squeak as well). But I'm
sure all the advocates of images and objects will be eager lend you a
helping hand.

Now regarding encoding there are two things you need decide. What
should be the internal encoding in the image and what should be the
external encoding on the web page. If they are different some
transcoding has to happen for both input and output. In Seaside 3.x
this is quite easy to do, in Seaside 2.6 not so much. The webpage
currently seems to use iso-8859-1 as indicated in the XML preamble
(there is no HTTP header). I assume (without being sure) that the
internal encoding is Squeak/MacRoman. Which brings us to the question
how Sté°¨ane Munioz ended up in the image. Can you confirm that his name
is a WideString and é°¨ is a single instance of Character?
The obvious choice at this point would be to go for utf-8 external and
Squeak internal. The easiest way to do this would be to use
WAKomEncoded but I don't think this is even present in this version of
Seaside. Remember you'll have to encode all the output in decode all
the input. For example when I search for "Munioz" under "Members"
still only half the page renders. There is one downside to this
approach though and that is that you'll end up having WideStrings in
the image. WideString has a bad reputation of being slow and buggy.
Seaside 3.x helps a bit because the response would be encoded on the
fly and therefore avoid a huge WideString response buffer. To avoid
this you could use utf-8 internally but that breaks all length related
methods and you'll have to pay attention when interacting with
external systems (eg. file system).

General itmes:
One of the optimizations we never had time to implement was installing
mod_xsendfile [4]. Serving all the MCZ files through the image is very
inefficient and puts unnecessary pressure on the image. We can't do it
directly with Apache because we have to do an authentication check
first. mod_xsendfile would allow the image to tell Apache which file
to serve.
>From time to time the image would lock up completely. We applied
several patches that were supposed to make Semaphore thread-safe but
the issue never fully went away. Some people said this was because
SqueakSource was never designed to handle this load. I don't
understand this argument, even if this is the case that should just
make the image slow, not lock it up.

 [1] http://www.squeaksource.com/ss2.html
 [2] http://www.squeaksource.com/squeaksource3.html
 [3] http://ss3.gemstone.com/ss/ss3.html
 [4] https://tn123.org/mod_xsendfile/

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

Bob Arning-2
 It is a WideString and

self asArray collect: [ :e | e asciiValue radix: 16] = #('53' '74' '3FC09C28' '61' '6E' '65' '20' '4D' '75' '6E' '69' '6F' '7A')

FWIW.

Cheers,
Bob


On 12/23/13 6:51 AM, Philippe Marschall wrote:
 Which brings us to the question
how Sté°¨ane Munioz ended up in the image. Can you confirm that his name
is a WideString and é°¨ is a single instance of Character?


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

Philippe Marschall
On Mon, Dec 23, 2013 at 1:43 PM, Bob Arning <[hidden email]> wrote:
>  It is a WideString and
>
> self asArray collect: [ :e | e asciiValue radix: 16] = #('53' '74'
> '3FC09C28' '61' '6E' '65' '20' '4D' '75' '6E' '69' '6F' '7A')

Interesting, so somebody somewhere along the way converted the input
from something (likely utf-8 although the page is iso-8859-1) to
Squeak encoding.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

Bob Arning-2
I see how it happens...

using Mac, Chrome with 8859-1 encoding as default, I typed
   
    S, t, option-e, e, p, h, a, n, e

in the login screen. What arrives back at the server is

    '11=St%E9phane&12=&13=Login'

wherupon HttpRequest tries to parse this
-----
decodeUrlEncodedForm: string multipleValues: boolean
    | dict key value start end eqSignPos more |
    dict _ boolean ifTrue: [HttpFormDictionary new] ifFalse: [Dictionary new].
    string isEmptyOrNil ifTrue: [^dict].
    more _ true.
    start _ 1.
    [end _ string indexOf: $& startingAt: start.
    end == 0
        ifTrue: [end _ string size. more _ false]
        ifFalse: [end _ end - 1].
    eqSignPos _ string indexOf: $= startingAt: start.
    (eqSignPos > end or: [eqSignPos == 0])
        ifTrue: [key _ (key _ string copyFrom: start to: end) unescapePercents.
            value _ '']
        ifFalse: [key _ (key _ string copyFrom: start to: eqSignPos-1) unescapePercents.
            value _ (value _ string copyFrom: eqSignPos+1 to: end) unescapePercents].
    self addKey: key value: value toForm: dict multipleValues: boolean.
    start _ end + 2.
    more] whileTrue.

    ^dict
-----
and #
unescapePercents does

self unescapePercentsWithTextEncoding: 'utf-8'

    'St%E9phane' unescapePercents ==> 'St鰨ane'

whereas, if we knew it was not utf-8, then

    'St%E9phane' unescapePercentsWithTextEncoding: nil ==> 'Stéphane'

gives the expected answer. I tried to coax my browser to return utf-8, but that had no effect, so I'm wondering if this application would be better off using  

        unescapePercentsWithTextEncoding: nil
rather than
   
    unescapePercents

Cheers,
Bob

On 12/23/13 8:15 AM, Philippe Marschall wrote:
On Mon, Dec 23, 2013 at 1:43 PM, Bob Arning [hidden email] wrote:
 It is a WideString and

self asArray collect: [ :e | e asciiValue radix: 16] = #('53' '74'
'3FC09C28' '61' '6E' '65' '20' '4D' '75' '6E' '69' '6F' '7A')
Interesting, so somebody somewhere along the way converted the input
from something (likely utf-8 although the page is iso-8859-1) to
Squeak encoding.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

Bob Arning-2
And I see that's exactly what newer versions of this method do...

decodeUrlEncodedForm: string multipleValues: boolean
    | dict key value start end eqSignPos more |
    dict := boolean ifTrue: [HttpFormDictionary new] ifFalse: [Dictionary new].
    string isEmptyOrNil ifTrue: [^dict].
    more := true.
    start := 1.
    [end := string indexOf: $& startingAt: start.
    end == 0
        ifTrue: [end := string size. more := false]
        ifFalse: [end := end - 1].
    eqSignPos := string indexOf: $= startingAt: start.
    (eqSignPos > end or: [eqSignPos == 0])
        ifTrue: [key := (key := string copyFrom: start to: end) unescapePercentsWithTextEncoding: nil.
            value := '']
        ifFalse: [key := (key := string copyFrom: start to: eqSignPos-1) unescapePercentsWithTextEncoding: nil.
            value := (value := string copyFrom: eqSignPos+1 to: end) unescapePercentsWithTextEncoding: nil].
    self addKey: key value: value toForm: dict multipleValues: boolean.
    start := end + 2.
    more] whileTrue.

    ^dict

Cheers,
Bob


On 12/23/13 11:04 AM, Bob Arning wrote:
I see how it happens...

using Mac, Chrome with 8859-1 encoding as default, I typed
   
    S, t, option-e, e, p, h, a, n, e

in the login screen. What arrives back at the server is

    '11=St%E9phane&12=&13=Login'

wherupon HttpRequest tries to parse this
-----
decodeUrlEncodedForm: string multipleValues: boolean
    | dict key value start end eqSignPos more |
    dict _ boolean ifTrue: [HttpFormDictionary new] ifFalse: [Dictionary new].
    string isEmptyOrNil ifTrue: [^dict].
    more _ true.
    start _ 1.
    [end _ string indexOf: $& startingAt: start.
    end == 0
        ifTrue: [end _ string size. more _ false]
        ifFalse: [end _ end - 1].
    eqSignPos _ string indexOf: $= startingAt: start.
    (eqSignPos > end or: [eqSignPos == 0])
        ifTrue: [key _ (key _ string copyFrom: start to: end) unescapePercents.
            value _ '']
        ifFalse: [key _ (key _ string copyFrom: start to: eqSignPos-1) unescapePercents.
            value _ (value _ string copyFrom: eqSignPos+1 to: end) unescapePercents].
    self addKey: key value: value toForm: dict multipleValues: boolean.
    start _ end + 2.
    more] whileTrue.

    ^dict
-----
and #
unescapePercents does

self unescapePercentsWithTextEncoding: 'utf-8'

    'St%E9phane' unescapePercents ==> 'St鰨ane'

whereas, if we knew it was not utf-8, then

    'St%E9phane' unescapePercentsWithTextEncoding: nil ==> 'Stéphane'

gives the expected answer. I tried to coax my browser to return utf-8, but that had no effect, so I'm wondering if this application would be better off using  

        unescapePercentsWithTextEncoding: nil
rather than
   
    unescapePercents

Cheers,
Bob

On 12/23/13 8:15 AM, Philippe Marschall wrote:
On Mon, Dec 23, 2013 at 1:43 PM, Bob Arning [hidden email] wrote:
 It is a WideString and

self asArray collect: [ :e | e asciiValue radix: 16] = #('53' '74'
'3FC09C28' '61' '6E' '65' '20' '4D' '75' '6E' '69' '6F' '7A')
Interesting, so somebody somewhere along the way converted the input
from something (likely utf-8 although the page is iso-8859-1) to
Squeak encoding.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside




_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

Philippe Marschall
In reply to this post by Bob Arning-2
On Mon, Dec 23, 2013 at 5:04 PM, Bob Arning <[hidden email]> wrote:

> I see how it happens...
>
> using Mac, Chrome with 8859-1 encoding as default, I typed
>
>     S, t, option-e, e, p, h, a, n, e
>
> in the login screen. What arrives back at the server is
>
>     '11=St%E9phane&12=&13=Login'
>
> wherupon HttpRequest tries to parse this
> -----
> decodeUrlEncodedForm: string multipleValues: boolean
>     | dict key value start end eqSignPos more |
>     dict _ boolean ifTrue: [HttpFormDictionary new] ifFalse: [Dictionary
> new].
>     string isEmptyOrNil ifTrue: [^dict].
>     more _ true.
>     start _ 1.
>     [end _ string indexOf: $& startingAt: start.
>     end == 0
>         ifTrue: [end _ string size. more _ false]
>         ifFalse: [end _ end - 1].
>     eqSignPos _ string indexOf: $= startingAt: start.
>     (eqSignPos > end or: [eqSignPos == 0])
>         ifTrue: [key _ (key _ string copyFrom: start to: end)
> unescapePercents.
>             value _ '']
>         ifFalse: [key _ (key _ string copyFrom: start to: eqSignPos-1)
> unescapePercents.
>             value _ (value _ string copyFrom: eqSignPos+1 to: end)
> unescapePercents].
>     self addKey: key value: value toForm: dict multipleValues: boolean.
>     start _ end + 2.
>     more] whileTrue.
>
>     ^dict
> -----
> and #unescapePercents does
>
> self unescapePercentsWithTextEncoding: 'utf-8'

Is that the same image as www.squeaksource.com? If so was the image
ever updated? AFAIK the method did ISO-8859-1 previously.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

Bob Arning-2

On 12/28/13 2:45 PM, Philippe Marschall wrote:
> Is that the same image aswww.squeaksource.com? If so was the image
> ever updated? AFAIK the method did ISO-8859-1 previously.
Well, it's the image David Lewis gave me to look at, but where it came
from, he will need to answer.

What is in *this* image is

     svp 5/13/2003 15:29 HttpRequest class
decodeUrlEncodedForm:multipleValues: {parsing}

which expects UTF-8, while a newer image I use has

     pmm 5/29/2007 07:31 HttpRequest class
decodeUrlEncodedForm:multipleValues: {parsing}

which does 8859-1. The two latest versions of the KomHttpServer in
David's image are:


Name: KomHttpServer-ar.8
Author: ar
Time: 6 September 2009, 11:25:00.032 am
UUID: e67bf476-8358-6d4e-a0a1-f2c23b78a85a
Ancestors: KomHttpServer-pmm.7

Update for BlockClosure support.
=========and===========
Name: KomHttpServer-pmm.7
Author: pmm
Time: 4 March 2006, 2:55:55 pm
UUID: 33842fe3-5b5e-41ad-ad7f-4e761141cae1
Ancestors: KomHttpServer-gk.6

- added support for FastSocketStream

neither of which appear in the ancestry of a newer image KomHttpServer
package. So, it's relatively old code, which I guess is not a surprise.

Cheers,
Bob


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

David T. Lewis
On Sat, Dec 28, 2013 at 03:52:53PM -0500, Bob Arning wrote:
>
> On 12/28/13 2:45 PM, Philippe Marschall wrote:
> >Is that the same image aswww.squeaksource.com? If so was the image
> >ever updated? AFAIK the method did ISO-8859-1 previously.
> Well, it's the image David Lewis gave me to look at, but where it came
> from, he will need to answer.

The image that I gave to Bob was a copy of the www.squeaksource.com image
that is running on our squeak.org server. I saved it from the running
image, zipped it up with a password, and gave it to Bob.

Since that time the only change that I have made to the running image on
www.squeaksource.com was to apply the initial patch that Bob provided to
work around the problematic user ID. For purposes of keeping squeaksource.com
operating, that patch is doing just fine. So aside from that one patch,
the image that Bob is looking at is identical to the one that is running
now on www.squeaksource.com. With respect to source code for Seaside and
SqueakSource, it is also identical to the source.squeak.org image that is
used to support Squeak trunk development.

Dave


>
> What is in *this* image is
>
>     svp 5/13/2003 15:29 HttpRequest class
> decodeUrlEncodedForm:multipleValues: {parsing}
>
> which expects UTF-8, while a newer image I use has
>
>     pmm 5/29/2007 07:31 HttpRequest class
> decodeUrlEncodedForm:multipleValues: {parsing}
>
> which does 8859-1. The two latest versions of the KomHttpServer in
> David's image are:
>
>
> Name: KomHttpServer-ar.8
> Author: ar
> Time: 6 September 2009, 11:25:00.032 am
> UUID: e67bf476-8358-6d4e-a0a1-f2c23b78a85a
> Ancestors: KomHttpServer-pmm.7
>
> Update for BlockClosure support.
> =========and===========
> Name: KomHttpServer-pmm.7
> Author: pmm
> Time: 4 March 2006, 2:55:55 pm
> UUID: 33842fe3-5b5e-41ad-ad7f-4e761141cae1
> Ancestors: KomHttpServer-gk.6
>
> - added support for FastSocketStream
>
> neither of which appear in the ancestry of a newer image KomHttpServer
> package. So, it's relatively old code, which I guess is not a surprise.
>
> Cheers,
> Bob
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

David T. Lewis
In reply to this post by Bob Arning-2
Bob,

Thanks again for debugging this problem on squeaksource.com (and apologies
for not following up on the matter sooner). The updated version of the
decodeUrlEncodedForm:multipleValues: does indeed resolve the problem that
we were seeing. Unfortunately, I found another problem related to WideString
member names, which is that I cannot (in squeaksource.com screens) edit a
project and add a new developer to that existing project.

It seems clear (as previously noted) that we really need to update our
source.squeak.org and squeaksource.com images to use an up to date Seaside.
I'm not going to attempt that effort (I'm mainly concerned with just keeping
squeaksource.com operating), so in the mean time I think I will just work
around the problem by converting the WideString member names to ByteString.

Fortunately there are only two member names that are WideString, and they
both belong to the same person (CC'ed on this message), so I think that the
impact is minor.

Thanks,

Dave

On Mon, Dec 23, 2013 at 12:16:46PM -0500, Bob Arning wrote:

> And I see that's exactly what newer versions of this method do...
>
> decodeUrlEncodedForm: string multipleValues: boolean
>     | dict key value start end eqSignPos more |
>     dict := boolean ifTrue: [HttpFormDictionary new] ifFalse:
> [Dictionary new].
>     string isEmptyOrNil ifTrue: [^dict].
>     more := true.
>     start := 1.
>     [end := string indexOf: $& startingAt: start.
>     end == 0
>         ifTrue: [end := string size. more := false]
>         ifFalse: [end := end - 1].
>     eqSignPos := string indexOf: $= startingAt: start.
>     (eqSignPos > end or: [eqSignPos == 0])
>         ifTrue: [key := (key := string copyFrom: start to: end)
> unescapePercentsWithTextEncoding: nil.
>             value := '']
>         ifFalse: [key := (key := string copyFrom: start to:
> eqSignPos-1) unescapePercentsWithTextEncoding: nil.
>             value := (value := string copyFrom: eqSignPos+1 to: end)
> unescapePercentsWithTextEncoding: nil].
>     self addKey: key value: value toForm: dict multipleValues: boolean.
>     start := end + 2.
>     more] whileTrue.
>
>     ^dict
>
> Cheers,
> Bob
>
>
> On 12/23/13 11:04 AM, Bob Arning wrote:
> >I see how it happens...
> >
> >using Mac, Chrome with 8859-1 encoding as default, I typed
> >
> >    S, t, option-e, e, p, h, a, n, e
> >
> >in the login screen. What arrives back at the server is
> >
> >    '11=St%E9phane&12=&13=Login'
> >
> >wherupon HttpRequest tries to parse this
> >-----
> >decodeUrlEncodedForm: string multipleValues: boolean
> >    | dict key value start end eqSignPos more |
> >    dict _ boolean ifTrue: [HttpFormDictionary new] ifFalse:
> >[Dictionary new].
> >    string isEmptyOrNil ifTrue: [^dict].
> >    more _ true.
> >    start _ 1.
> >    [end _ string indexOf: $& startingAt: start.
> >    end == 0
> >        ifTrue: [end _ string size. more _ false]
> >        ifFalse: [end _ end - 1].
> >    eqSignPos _ string indexOf: $= startingAt: start.
> >    (eqSignPos > end or: [eqSignPos == 0])
> >        ifTrue: [key _ (key _ string copyFrom: start to: end)
> >unescapePercents.
> >            value _ '']
> >        ifFalse: [key _ (key _ string copyFrom: start to: eqSignPos-1)
> >unescapePercents.
> >            value _ (value _ string copyFrom: eqSignPos+1 to: end)
> >*unescapePercents*].
> >    self addKey: key value: value toForm: dict multipleValues: boolean.
> >    start _ end + 2.
> >    more] whileTrue.
> >
> >    ^dict
> >-----
> >and #unescapePercents does
> >
> >self unescapePercentsWithTextEncoding: 'utf-8'
> >
> >    'St%E9phane' unescapePercents ==> 'St???ane'
> >
> >whereas, if we knew it was not utf-8, then
> >
> >    'St%E9phane' unescapePercentsWithTextEncoding: nil ==> 'St??phane'
> >
> >gives the expected answer. I tried to coax my browser to return utf-8,
> >but that had no effect, so I'm wondering if this application would be
> >better off using
> >unescapePercentsWithTextEncoding: nil
> >rather than
> >    unescapePercents
> >
> >Cheers,
> >Bob
> >
> >On 12/23/13 8:15 AM, Philippe Marschall wrote:
> >>On Mon, Dec 23, 2013 at 1:43 PM, Bob Arning<[hidden email]>  wrote:
> >>>  It is a WideString and
> >>>
> >>>self asArray collect: [ :e | e asciiValue radix: 16] = #('53' '74'
> >>>'3FC09C28' '61' '6E' '65' '20' '4D' '75' '6E' '69' '6F' '7A')
> >>Interesting, so somebody somewhere along the way converted the input
> >>from something (likely utf-8 although the page is iso-8859-1) to
> >>Squeak encoding.
> >>
> >>Cheers
> >>Philippe
> >>_______________________________________________
> >>seaside mailing list
> >>[hidden email]
> >>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >>
> >
>

> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

Bob Arning-2
Dave,

No apologies necessary. Let me know if I can be of further assistance.

Cheers,
Bob

On 1/12/14 9:58 AM, David T. Lewis wrote:
Bob,

Thanks again for debugging this problem on squeaksource.com (and apologies
for not following up on the matter sooner). The updated version of the
decodeUrlEncodedForm:multipleValues: does indeed resolve the problem that
we were seeing. Unfortunately, I found another problem related to WideString
member names, which is that I cannot (in squeaksource.com screens) edit a
project and add a new developer to that existing project.

It seems clear (as previously noted) that we really need to update our
source.squeak.org and squeaksource.com images to use an up to date Seaside.
I'm not going to attempt that effort (I'm mainly concerned with just keeping
squeaksource.com operating), so in the mean time I think I will just work
around the problem by converting the WideString member names to ByteString.

Fortunately there are only two member names that are WideString, and they
both belong to the same person (CC'ed on this message), so I think that the
impact is minor.

Thanks,

Dave

On Mon, Dec 23, 2013 at 12:16:46PM -0500, Bob Arning wrote:
And I see that's exactly what newer versions of this method do...

decodeUrlEncodedForm: string multipleValues: boolean
    | dict key value start end eqSignPos more |
    dict := boolean ifTrue: [HttpFormDictionary new] ifFalse: 
[Dictionary new].
    string isEmptyOrNil ifTrue: [^dict].
    more := true.
    start := 1.
    [end := string indexOf: $& startingAt: start.
    end == 0
        ifTrue: [end := string size. more := false]
        ifFalse: [end := end - 1].
    eqSignPos := string indexOf: $= startingAt: start.
    (eqSignPos > end or: [eqSignPos == 0])
        ifTrue: [key := (key := string copyFrom: start to: end) 
unescapePercentsWithTextEncoding: nil.
            value := '']
        ifFalse: [key := (key := string copyFrom: start to: 
eqSignPos-1) unescapePercentsWithTextEncoding: nil.
            value := (value := string copyFrom: eqSignPos+1 to: end) 
unescapePercentsWithTextEncoding: nil].
    self addKey: key value: value toForm: dict multipleValues: boolean.
    start := end + 2.
    more] whileTrue.

    ^dict

Cheers,
Bob


On 12/23/13 11:04 AM, Bob Arning wrote:
I see how it happens...

using Mac, Chrome with 8859-1 encoding as default, I typed

   S, t, option-e, e, p, h, a, n, e

in the login screen. What arrives back at the server is

   '11=St%E9phane&12=&13=Login'

wherupon HttpRequest tries to parse this
-----
decodeUrlEncodedForm: string multipleValues: boolean
   | dict key value start end eqSignPos more |
   dict _ boolean ifTrue: [HttpFormDictionary new] ifFalse: 
[Dictionary new].
   string isEmptyOrNil ifTrue: [^dict].
   more _ true.
   start _ 1.
   [end _ string indexOf: $& startingAt: start.
   end == 0
       ifTrue: [end _ string size. more _ false]
       ifFalse: [end _ end - 1].
   eqSignPos _ string indexOf: $= startingAt: start.
   (eqSignPos > end or: [eqSignPos == 0])
       ifTrue: [key _ (key _ string copyFrom: start to: end) 
unescapePercents.
           value _ '']
       ifFalse: [key _ (key _ string copyFrom: start to: eqSignPos-1) 
unescapePercents.
           value _ (value _ string copyFrom: eqSignPos+1 to: end) 
*unescapePercents*].
   self addKey: key value: value toForm: dict multipleValues: boolean.
   start _ end + 2.
   more] whileTrue.

   ^dict
-----
and #unescapePercents does

self unescapePercentsWithTextEncoding: 'utf-8'

   'St%E9phane' unescapePercents ==> 'St???ane'

whereas, if we knew it was not utf-8, then

   'St%E9phane' unescapePercentsWithTextEncoding: nil ==> 'St??phane'

gives the expected answer. I tried to coax my browser to return utf-8, 
but that had no effect, so I'm wondering if this application would be 
better off using
unescapePercentsWithTextEncoding: nil
rather than
   unescapePercents

Cheers,
Bob

On 12/23/13 8:15 AM, Philippe Marschall wrote:
On Mon, Dec 23, 2013 at 1:43 PM, Bob Arning[hidden email]  wrote:
 It is a WideString and

self asArray collect: [ :e | e asciiValue radix: 16] = #('53' '74'
'3FC09C28' '61' '6E' '65' '20' '4D' '75' '6E' '69' '6F' '7A')
Interesting, so somebody somewhere along the way converted the input
>from something (likely utf-8 although the page is iso-8859-1) to
Squeak encoding.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


        

      

      
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

Chris Muller-3
In reply to this post by David T. Lewis
> It seems clear (as previously noted) that we really need to update our
> source.squeak.org and squeaksource.com images to use an up to date Seaside.

A prerequisite to that is to update our source.squeak.org and
squeaksource.com images to be 4.5 images.

Just FYI -- I've done with the source.squeak.org backup on box4.  It's
running the code which is committed to the "ss" repository of
source.squeak.org (so, self hosting its own code) in a 2-month old
trunk image.

A future step to update Seaside in there would be nice.
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside