Mild Server

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

Mild Server

Postby rpullman on Mon Dec 28, 2009 12:26 am

I have a web app* which works most of the time. The public fields are correctly bound to HTML inputs, but sometimes the values are from the previous cycle.

The app might work 100% for as many as 20 cycles, then the next 4 cycles the exact same HTML is passed to the APL script. I captured the values of the public fields and the HTML returned from the APL script.

The same form that works at one time might fail at another. APL and its threads seem normal. The URL display indicates that the right HTML is being sent.

Any suggestions as to where my problem might be? Anybody know a way I can see the HTML that MildServer receives?




*actually a port from APL2000 with minimal changes. Worked fine in 2004.
rpullman
 
Posts: 12
Joined: Sun Dec 27, 2009 9:29 pm
Location: Chicago

Re: Mild Server

Postby Morten|Dyalog on Mon Dec 28, 2009 10:50 am

Hi Bob, thought I'd replied to that question in an e-mail to you, but perhaps I misunderstood the question... My suggestion for looking at the request is to suspend the "Render" function in your page, and inspect the "req" argument:

Code: Select all
      req.⎕nl -2
 Arguments  Command  Cookies  Data  Headers  Input  Page  PeerCert  Response  Server  Session

      req.Response.Request
POST /reverse.dyalog HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml
Referer: http://localhost:8080/reverse?Name=Beethoven
Accept-Language: da
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6.3; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.
Content-Type: multipart/form-data; boundary=---------------------------7d95c32c1082
Accept-Encoding: gzip, deflate
Host: localhost:8080
Content-Length: 247
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: Session=VvYNJgCI3Y8r+Rs1c8bIZAA1AFlDIsx59KdVp7oRlLQ=
-----------------------------7d95c32c1082
Content-Disposition: form-data; name="Name"
Beethoven
-----------------------------7d95c32c1082
Content-Disposition: form-data; name="Action"
Reverse
-----------------------------7d95c32c1082--


Alternatively, put a stop on line [3] of MildServer.HandleRequest, perhaps there is an error in the logic which handles incoming requests?

Finally, send me your application and I'll take a look: I intend to do some MildServer development in the next couple of days anyway so this is a good time.

Morten
User avatar
Morten|Dyalog
 
Posts: 453
Joined: Tue Sep 09, 2008 3:52 pm

Re: Mild Server

Postby rpullman on Mon Dec 28, 2009 1:53 pm

Hi Morten,

I did try your suggestion but when I stopped Render and looked at req.Response there was no .Request. I will look again. I will send you the script and its requisite component files from my yahoo account.

Bob
rpullman
 
Posts: 12
Joined: Sun Dec 27, 2009 9:29 pm
Location: Chicago

Re: Mild Server

Postby rpullman on Mon Dec 28, 2009 2:27 pm

I just induced the issue and got a value error on req.Response.Request. req.Input has the right stuff. I was on the Reading screen, requested the Mathematics screen, but got the Reading screen back. Copied from the APL session, which I will leave open in case you wish more info.

req.Response.⎕nl-2
File HTML HTMLHead Headers Status StatusText
req.⎕NL-2
Arguments Command Cookies Data Headers Input Page PeerCert Response Server Session



req.Input
GET /classroom2.dyalog?option=Mathematics&gt1=0&gt2=0&gt3=0&gt4=0&gt5=0&grp01=&ac01=0&nac01=0&grp02=&ac02=0&nac02=0&grp03=
&ac03=0&nac03=0&grp04=&ac04=0&nac04=0&grp05=&ac05=0&nac05=0&grp06=&ac06=0&nac06=0&grp07=&ac07=0&nac07=0&grp08=&ac08=
0&nac08=0&grp09=&ac09=0&nac09=0&grp10=&ac10=0&nac10=0&grp11=&ac11=0&nac11=0&grp12=&ac12=0&nac12=0&grp13=&ac13=0&nac1
3=0&grp14=&ac14=0&nac14=0&grp15=&ac15=0&nac15=0&grp16=&ac16=0&nac16=0&grp17=&ac17=0&nac17=0&grp18=&ac18=0&nac18=0&gr
p19=&ac19=0&nac19=0&grp20=&ac20=0&nac20=0&grp21=&ac21=0&nac21=0&grp22=&ac22=0&nac22=0&grp23=&ac23=0&nac23=0&grp24=&a
c24=0&nac24=0&grp25=&ac25=0&nac25=0&sub=1&userid=Bob&screen=input HTTP/1.1
rpullman
 
Posts: 12
Joined: Sun Dec 27, 2009 9:29 pm
Location: Chicago

Re: Mild Server

Postby Morten|Dyalog on Tue Dec 29, 2009 10:54 pm

There is good news and bad news... The good news is that this is not a bug in MildServer. The bad that it is caused by a bug in Dyalog APL (probably in all versions since 11.0). The following issue has been logged and will hopefully be fixed early in the new year:

”0005564: Nameclass of public property can change from -2.2 to 0 if same name is used for local variable in a method”

Once the nameclass of your property becomes zero, the MildServer stops transferring data from the incoming HTTP request to your page instance. Until we get this fixed, you can work around the problem by not using local variables with the same name as properties of the page class (which is probably a good practice anyway, for code clarity).
User avatar
Morten|Dyalog
 
Posts: 453
Joined: Tue Sep 09, 2008 3:52 pm


Return to APL Chat

Who is online

Users browsing this forum: No registered users and 1 guest