Hi Tim, I found a good and bad solution:
The good is that the following code fixes the issue. There is no hanging and the pages display properly. multiServ(s:SExpression):Void == WriteLine("multiServ begin")$Lisp headers:String := "" char:String -- read in the http headers flag:Integer := 1 length:Integer := 0 while flag > 0 repeat char := STRING(READ_-LINE(s,NILL$Lisp,'eof)$Lisp)$Lisp length := LENGTH(char)$Lisp if length = 1 then flag := 0 else headers := concat [headers,char] --WriteLine$Lisp "Header: "headers The bad, this for some reason breaks the POST requests. The line containing the command is never reached (last line). Maybe you can take a look at my really bad code and fix it :-). > and nothing else when sent from a remote machine. I modified the > read-char-no-hang loop to print out each character and it gets > nothing from the stream. Thus stream creation is broken in GCL. I think you only see the problem if you use: read-char-no-hang with read-char or read-line, you will see that you always get something from the stream. > Or if the remote request is successful we get a normal request > followed by a series of #xFF characters. Apparently there is not an > agreement about the EOF character. This causes Axiom to loop looking > for EOF. I inserted code to check for this condition. Thus EOF > checking is broken in GCL. You are absolutely right. I couldn't figure out what the end line is. So by looking at the output of the last line, it is a string of length one (not sure what it is). So I make the loop stop when I see that. > To make the remote request succeed you simply need to hammer on > the link very fast for a while and the request will get thru. Yes.. :-) sometimes you dont have to hammer it and just press enter long enough (you have to be very precise). > However, that raises another problem that the XMLHttpRequest objects > can hang. I wrote some javascript code to do a timer pop if I get no > response. Once there is an outstanding XMLHttpRequest that does not > get a response then the connection is permanently hung. > All of this code works perfectly if you browse from the local machine. Yes it does. I still blame the the read-char-no-hang. You can see that it works if you use another function. And with the lisp code it works fine. I guess this is a good indication that the sockets in GCL work fine. _______________________________________________ Axiom-developer mailing list Axiom-developer@nongnu.org http://lists.nongnu.org/mailman/listinfo/axiom-developer