Ahh ok. Looking at it more closely, I see that the addrinfo struct actually
does specify port 80, so that's not the problem.

The problem is this line:
snprintf(line, sizeof(line),
         "GET %s HTTP/1.0\r\nUser-Agent: Virtual Object System HTTP
binding\r\n\r\n",
         url.getString().c_str());

The url.getString().c_str() contains the :4321 port specifier in it. And my
ISP has a transparent web proxy that does some caching or something... so
even if you try to connect to port :80, the proxy will go ahead and respond
to the GET request literally and try to use port :4321, resulting in
problems. I'm guessing if you sent this request directly to en.wikipedia.org
instead of through a proxy, it works fine, which explains the different
behavior between our systems. It's actually not a windows-vs-linux problem
this time :)

(BTW: the getaddrinfo_wrapper function wasn't working at all on WIN32. It
can't handle the case where "hints" is 0, and it doesn't look at "services."
Luckily, the windows SDK has a getaddrinfo function, so I removed all that
WIN32 specific stuff and it worked fine. Same thing with freeaddrinfo and
getnameinfo. It has a gai_strerror, too, but the documentation says it's not
threadsafe and to use WSAGetLastError instead, so I left that wrapper in
place. The only problem with these is compiling on windows2000 with MINGW -- 
the default MINGW headers only define them for WinXP or later. I found a
workaround for this, though, which I posted here
http://interreality.org/pipermail/vos-d/2006-November/002041.html )

All in all, I think I've got your demo gallery completely working on
windows, built with MSVC :)  -- I'll have to post a summary describing all
the tweaks I had to make to get it working in the next few days, after I've
tested to make sure they still work on mingw, as well.

-Ken

Peter Amstutz wrote:

> Actually, I'm pretty sure the HTTP_GET() function ignores the port on
> the URL object and asks to connect to the "http" port (which should be
> looked up in /etc/services).  Perhaps that should just specify port 80
> explicitly.
>
> But you're right, the VOS "URL" class is highly VOS-specific in
> specifying 4231 as a default, which is kind of silly.
>
> On Wed, Apr 18, 2007 at 10:55:44PM -0700, Ken Taylor wrote:
> > So I tracked down one of the problems I'm having with the wikipedia demo
> > object: It's trying to connect to http://en.wikipedia.org:4231/ -- turns
> out
> > if you give the URL parser a URL without a port, it will add 4321 as the
> > port!  That seems kinda silly to me, since default port is a
> > protocol-specific thing. I'm surprised this has worked for you (assuming
> > you've been using it as is) -- oh well, I'll just force it to :80 in the
> > wikipedia object and see how it goes from there.
> >
> > -Ken
> >


_______________________________________________
vos-d mailing list
[email protected]
http://www.interreality.org/cgi-bin/mailman/listinfo/vos-d

Reply via email to