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

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
gregben
Posts: 20
Joined: Wed Mar 10, 2004 5:00 pm
Location: San Diego, California, USA

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

Post by gregben »

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

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

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

ca1$ curl 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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

(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
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Does a local running newlisp-httpd work?
a local 'get-url can do the trick..
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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

Locked