Skip to content

Commit

Permalink
changed zfor_gethostbyname2/getaddrinfo2 to zfor_gethostbynamei/getad…
Browse files Browse the repository at this point in the history
…drinfoi to make room for gethostbyname2 system function intercept
  • Loading branch information
chaoslawful committed Dec 25, 2009
1 parent a7a1fa2 commit ee7057f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/libzfor/zfor.c
Expand Up @@ -84,7 +84,7 @@ int getaddrinfo(const char *node, const char *service,

//////////////////////// Exported API //////////////////////////

struct hostent *zfor_gethostbyname2(const char *name, int failback)
struct hostent *zfor_gethostbynamei(const char *name, int failback)
/* {{{ */
{
struct hostent *h;
Expand All @@ -104,7 +104,7 @@ struct hostent *zfor_gethostbyname2(const char *name, int failback)

/* }}} */

int zfor_getaddrinfo2(const char *node, const char *service,
int zfor_getaddrinfoi(const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res,
int failback)
/* {{{ */
Expand Down Expand Up @@ -207,15 +207,15 @@ int zfor_getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res)
/* {{{ */
{
return zfor_getaddrinfo2(node, service, hints, res, 1);
return zfor_getaddrinfoi(node, service, hints, res, 1);
}

/* }}} */

struct hostent *zfor_gethostbyname(const char *name)
/* {{{ */
{
return zfor_gethostbyname2(name, 1);
return zfor_gethostbynamei(name, 1);
}

/* }}} */
Expand Down Expand Up @@ -611,7 +611,7 @@ static int zfor_sync_call(struct sockaddr_in *host_and_port, int timeout,
static struct hostent *zfor_hook_gethostbyname(const char *name)
/* {{{ */
{
return zfor_gethostbyname2(name, zfor_hook_failback);
return zfor_gethostbynamei(name, zfor_hook_failback);
}

/* }}} */
Expand All @@ -621,7 +621,7 @@ static int zfor_hook_getaddrinfo(const char *node, const char *service,
struct addrinfo **res)
/* {{{ */
{
return zfor_getaddrinfo2(node, service, hints, res,
return zfor_getaddrinfoi(node, service, hints, res,
zfor_hook_failback);
}

Expand Down
4 changes: 2 additions & 2 deletions src/libzfor/zfor.h
Expand Up @@ -18,7 +18,7 @@ extern "C" {
/**
* ZFOR gethostbyname(), permit to choose whether fail back.
* */
struct hostent *zfor_gethostbyname2(const char *name, int failback);
struct hostent *zfor_gethostbynamei(const char *name, int failback);

/**
* ZFOR getaddrinfo(), with failing back to system-wide getaddrinfo().
Expand All @@ -30,7 +30,7 @@ extern "C" {
/**
* ZFOR getaddrinfo(), permit to choose whether fail back.
* */
int zfor_getaddrinfo2(const char *node, const char *service,
int zfor_getaddrinfoi(const char *node, const char *service,
const struct addrinfo *hints,
struct addrinfo **res, int failback);

Expand Down
4 changes: 2 additions & 2 deletions src/php_zfor/php_zfor.c
Expand Up @@ -165,7 +165,7 @@ PHP_FUNCTION(zfor_gethostbyname)
return;
}

hp = zfor_gethostbyname2(hostname, (int) failback);
hp = zfor_gethostbynamei(hostname, (int) failback);

if (!hp || !hp->h_addr_list || !*(hp->h_addr_list)) {
RETURN_FALSE;
Expand Down Expand Up @@ -194,7 +194,7 @@ PHP_FUNCTION(zfor_gethostbynamel)
return;
}

hp = zfor_gethostbyname2(hostname, failback);
hp = zfor_gethostbynamei(hostname, failback);
if (!hp || !hp->h_addr_list) {
RETURN_FALSE;
}
Expand Down
4 changes: 2 additions & 2 deletions src/python_zfor/src/zfor.c
Expand Up @@ -19,7 +19,7 @@ zgethostbyname(PyObject *self, PyObject *args) {
return NULL;
}

hp=zfor_gethostbyname2(hostname, failback);
hp=zfor_gethostbynamei(hostname, failback);

if(!hp || !hp->h_addr_list || !*(hp->h_addr_list)) {
PyErr_SetString(zforError, "Name or service not known");
Expand All @@ -44,7 +44,7 @@ zgethostbynamel(PyObject *self, PyObject *args) {
return NULL;
}

hp=zfor_gethostbyname2(hostname, failback);
hp=zfor_gethostbynamei(hostname, failback);

if(!hp || !hp->h_addr_list || !*(hp->h_addr_list)) {
PyErr_SetString(zforError, "Name or service not known");
Expand Down

0 comments on commit ee7057f

Please sign in to comment.