(get-url) doesn't work for me on Solaris 8

Started by gregben, August 17, 2004, 11:00:22 PM

Previous topic - Next topic

gregben

From inside a script or the Newlisp shell, this hangs:



(get-url "http://www.nuevatec.com">http://www.nuevatec.com")



But using curl at the login shell comes back instantly (within 250ms):

 

ca1$ curl http://www.nuevatec.com">http://www.nuevatec.com            

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

  <title>NUEVATEC International Software Counsulting Nuevatec</title>

  <link rel="icon" href="favicon.ico" type="image/x-icon">



So I don't think I have a DNS problem, but perhaps Newlisp

is compiled incorrectly? I'm using v8.1.0

Lutz

#1
Two questions:



(1) Do other networking functions work?



(2) Can you treat a networking socket of type AF_INET as a filehandle with fgets() fprintf etc?



I guess you will say 'yes' for questions (1) and 'no' to question (2). In this case newLISP has functions used in the Win32 flavors of MinGW and BorlandC to simulate those.



Unfortunately the Solaris box I am working on is pretty much closed from the outside, so it is complicated to test the get-url function and it also is x86 Solaris not on Sparc (different compilers, libs etc).



Lutz

Lutz

#2
(3) try -p server mode:



    newlisp -p 12345 &



then telnet to it:



    telnet localhost 12345



you should get a newLISP prompt and should be able to operate newLISP. If this works, we know that fdopen(), fgets() and fprintf() are fine with network sockets on Solaris and that networking works. If this works but (get-url ...) does not, the case is more involved and hard for me to debug, without being on an internet connected solaris machine.



Lutz

newdep

#3
Does a local running newlisp-httpd work?

a local 'get-url can do the trick..
-- (define? (Cornflakes))

Lutz

#4
Yes, I just now tried that on the sourceforge x86 Solaris machine. httpd seems to run fine (tested using telnet), but the client hangs in an fgets() inside (get-url ..), although the fgets() called from the -p mode works fine. After putting debugging printf() it sometimes hangs in fgets() other times it just falls thru it and the fgets() returns an empty string, its really weird. Perhaps some kind of ioctl() which has to be done for this case. Unfortunately I am not a Solaris expert. Never had this kind of problem on Linux or BSD.



I cannot really work comfortable, because the solaris machine doesn't let me use VI. So I have to leave Solaris, edit the file, then go back into Solaris compile etc., which takes time. The machine also seems to be overloaded, sometimes it takes forever to compile.



Lutz

Lutz

#5
I got (get-url ...) working on Solaris it needed a simple fflush() after doing fprintf().



There will be a 8.1.3 with the Solaris fix shortly.



Lutz