size limit with onInput: and jQuery callback:value:

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

size limit with onInput: and jQuery callback:value:

Bob Nemec
Hello,
We're seeing a problem where entering large text into a textArea causes the component to no longer be responsive. In our case, using VW 7.10.1, the problem only happens if we're using a reverse proxy (either HA Proxy or Apache). To debug the problem, I set up a development VW image running Seaside on port 7771 and HA Proxy on another server, redirecting port 80 to 7771. I then connected two sessions: one directly to the Seaside image, and one by way of the HA Proxy server. The directly connected session works fine, no limit on entered text that I can see. HA Proxy session has problems if the text entered is around 3500 (the exact number varies). 

Cincom suggested putting a break into SiouX.NetHttpResponder>>createRequestFrom: which shows that jQuery callback from onInput is not being sent.

So, to isolate the problem (and get some help on this forum), I coded an example in a new Pharo 4.0 image, with Seaside 3.1. This example, however, has the same symptom as my VW + HA Proxy configuration: once the entered text is past around 3500, the onInput ajax callback no longer responds. I'm hoping someone can shed some light on this problem... I have some unhappy users. 

renderContentOn: html

html heading: 'Text Editor'.
html textArea
style: 'width: 820px; height: 200px; '; 
value: self enteredText;
onInput: (
html jQuery ajax 
callback: [:stringValue | self enteredText: stringValue]
value: html jQuery this value);
onBlur: (
(html jQuery id: 'displayedText') load html: [:renderer | 
self renderEnteredTextOn: renderer]).
html horizontalRule.
self renderEnteredTextOn: html.


renderEnteredTextOn: html

html div id: 'displayedText'; with: [ 
html big: 'size: ', self enteredText size printString; break.
html text: self enteredText]


Thanks, 

Bob Nemec
HTS

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

Re: size limit with onInput: and jQuery callback:value:

Johan Brichau-2
Hi Bob,

Have you tried setting the ajax request to type POST instead of the (standard) GET?

onInput: (
html jQuery ajax 
type: ‘POST’;
callback: [:stringValue | self enteredText: stringValue]
value: html jQuery this value);

Web servers (and proxies) often set a maximum url length. Since a GET request encodes both the Seaside callback number and the entered text into the url, it will most probably be truncated by the web server.
In most cases I observed, it was only the entered text that was truncated, but depending on the position of the parameters, it may also truncate the Seaside callback number. As a result, the callback will not be invoked.

I did not try your example, so if this is not the case, ping me back and I will take a closer look.

Also: I often ask myself why people copy/paste entire documents in textareas :))

Hope it helps
Johan

On 12 Mar 2016, at 16:03, [hidden email] wrote:

Hello,
We're seeing a problem where entering large text into a textArea causes the component to no longer be responsive. In our case, using VW 7.10.1, the problem only happens if we're using a reverse proxy (either HA Proxy or Apache). To debug the problem, I set up a development VW image running Seaside on port 7771 and HA Proxy on another server, redirecting port 80 to 7771. I then connected two sessions: one directly to the Seaside image, and one by way of the HA Proxy server. The directly connected session works fine, no limit on entered text that I can see. HA Proxy session has problems if the text entered is around 3500 (the exact number varies). 

Cincom suggested putting a break into SiouX.NetHttpResponder>>createRequestFrom: which shows that jQuery callback from onInput is not being sent.

So, to isolate the problem (and get some help on this forum), I coded an example in a new Pharo 4.0 image, with Seaside 3.1. This example, however, has the same symptom as my VW + HA Proxy configuration: once the entered text is past around 3500, the onInput ajax callback no longer responds. I'm hoping someone can shed some light on this problem... I have some unhappy users. 

renderContentOn: html

html heading: 'Text Editor'.
html textArea
style: 'width: 820px; height: 200px; '; 
value: self enteredText;
onInput: (
html jQuery ajax 
callback: [:stringValue | self enteredText: stringValue]
value: html jQuery this value);
onBlur: (
(html jQuery id: 'displayedText') load html: [:renderer | 
self renderEnteredTextOn: renderer]).
html horizontalRule.
self renderEnteredTextOn: html.


renderEnteredTextOn: html

html div id: 'displayedText'; with: [ 
html big: 'size: ', self enteredText size printString; break.
html text: self enteredText]


Thanks, 

Bob Nemec
HTS
_______________________________________________
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: size limit with onInput: and jQuery callback:value:

Bob Nemec
Adding type: 'POST' did indeed fix the problem, in both the Pharo image, and in VW + HA Proxy. 
Interesting that VW without HA Proxy worked fine (made for some fun diagnostics).

Much thanks,
Bob


On Sunday, March 13, 2016 5:02 AM, Johan Brichau <[hidden email]> wrote:


Hi Bob,

Have you tried setting the ajax request to type POST instead of the (standard) GET?

onInput: (
html jQuery ajax 
type: ‘POST’;
callback: [:stringValue | self enteredText: stringValue]
value: html jQuery this value);

Web servers (and proxies) often set a maximum url length. Since a GET request encodes both the Seaside callback number and the entered text into the url, it will most probably be truncated by the web server.
In most cases I observed, it was only the entered text that was truncated, but depending on the position of the parameters, it may also truncate the Seaside callback number. As a result, the callback will not be invoked.

I did not try your example, so if this is not the case, ping me back and I will take a closer look.

Also: I often ask myself why people copy/paste entire documents in textareas :))

Hope it helps
Johan

On 12 Mar 2016, at 16:03, [hidden email] wrote:

Hello,
We're seeing a problem where entering large text into a textArea causes the component to no longer be responsive. In our case, using VW 7.10.1, the problem only happens if we're using a reverse proxy (either HA Proxy or Apache). To debug the problem, I set up a development VW image running Seaside on port 7771 and HA Proxy on another server, redirecting port 80 to 7771. I then connected two sessions: one directly to the Seaside image, and one by way of the HA Proxy server. The directly connected session works fine, no limit on entered text that I can see. HA Proxy session has problems if the text entered is around 3500 (the exact number varies). 

Cincom suggested putting a break into SiouX.NetHttpResponder>>createRequestFrom: which shows that jQuery callback from onInput is not being sent.

So, to isolate the problem (and get some help on this forum), I coded an example in a new Pharo 4.0 image, with Seaside 3.1. This example, however, has the same symptom as my VW + HA Proxy configuration: once the entered text is past around 3500, the onInput ajax callback no longer responds. I'm hoping someone can shed some light on this problem... I have some unhappy users. 

renderContentOn: html

html heading: 'Text Editor'.
html textArea
style: 'width: 820px; height: 200px; '; 
value: self enteredText;
onInput: (
html jQuery ajax 
callback: [:stringValue | self enteredText: stringValue]
value: html jQuery this value);
onBlur: (
(html jQuery id: 'displayedText') load html: [:renderer | 
self renderEnteredTextOn: renderer]).
html horizontalRule.
self renderEnteredTextOn: html.


renderEnteredTextOn: html

html div id: 'displayedText'; with: [ 
html big: 'size: ', self enteredText size printString; break.
html text: self enteredText]


Thanks, 

Bob Nemec
HTS
_______________________________________________
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
Bob Nemec
Reply | Threaded
Open this post in threaded view
|

Re: size limit with onInput: and jQuery callback:value:

Johan Brichau-2

On 13 Mar 2016, at 16:40, <[hidden email]> <[hidden email]> wrote:

Interesting that VW without HA Proxy worked fine (made for some fun diagnostics).

The web server in VW probably does not limit the size of the url.

Web browsers typically do this too but the limits currently are ridiculously high. 
Both NGINX and Zinc have settings to set the limit.

Anyway, glad you can make your users happy again 

cheers
Johan

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

Re: size limit with onInput: and jQuery callback:value:

Jerry Kott-3
Depending on the VW version, you may have a ‘Web Server’ -> ‘Fortification’ settings page where you can set the limits for Request Status Line (i.e., something like GET /yourPath?yourQuery…. HTTP/1.1 stuff). By default it’s set to 8K, so if you try to do a GET with long enough query, you will hit a limit as well. The reason web servers have this is to protect against certain types of DOS attacks.


Jerry Kott
This message has been digitally signed. 
PGP Fingerprint:
A9181736DD2F1B6CC7CF9E51AC8514F48C0979A5



On 13-03-2016, at 9:28 AM, Johan Brichau <[hidden email]> wrote:


On 13 Mar 2016, at 16:40, <[hidden email]> <[hidden email]> wrote:

Interesting that VW without HA Proxy worked fine (made for some fun diagnostics).

The web server in VW probably does not limit the size of the url.

Web browsers typically do this too but the limits currently are ridiculously high. 
Both NGINX and Zinc have settings to set the limit.

Anyway, glad you can make your users happy again 

cheers
Johan
_______________________________________________
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

signature.asc (859 bytes) Download Attachment