Forum OpenACS Development: Re: OpenACS 5.9.0 and Oracle 12c

Collapse
Posted by Brian Fenton on
Thank you Maurizio. Actually what is the canonical way to make a HTTP call with Naviserver? In our old AOLserver codebase, we have a mix of calls to ns_httpget, ad_httpget, and more recently calls to ns_http (this is the one that works best for us on Windows 2008).
Collapse
Posted by Maurizio Martignano on
I have fixed the issue.

This is the change in the code:

if (connect(sock, saPtr, Ns_SockaddrGetSockLen(saPtr)) != 0) {
int err = ns_sockerrno;

#ifndef _WIN32
if (!async || (err != EINPROGRESS && err != EWOULDBLOCK)) {
#else
if (!async || (err != WSAEWOULDBLOCK)) {
#endif
ns_sockclose(sock);
Ns_LogSockaddr(Warning, "SockConnect fails", saPtr);
sock = NS_INVALID_SOCKET;

The mod will be available in next version of my distribution.
Over the weekend.

Collapse
Posted by Antonio Pisano on
Regarding this, ns_http is now the preferred low-level interface for http client funcionalities. A higher level interface, that deprecates all the "old school" procs like ad_httpget and such, you can find in [1] and [2].

These are basically wrappers around the api that make easier to issue the requests, also providing backward compatibility with Aolserver by using curl.

Hope this helps

Antonio

[1] http://openacs.org/api-doc/proc-view?proc=util%3a%3ahttp%3a%3aget&source_p=1
[2] http://openacs.org/api-doc/proc-view?proc=util%3a%3ahttp%3a%3apost&source_p=1

Collapse
Posted by Brian Fenton on
Thanks Antonio!