mirror of
https://github.com/osmarks/ngircd.git
synced 2025-07-05 11:22:49 +00:00
removed Resolve_SUCCESS() Macro and Res_Stat->sucess boolean (no longer used/needed)
This commit is contained in:
parent
a17745d6d7
commit
0701afedee
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "portab.h"
|
#include "portab.h"
|
||||||
|
|
||||||
static char UNUSED id[] = "$Id: resolve.c,v 1.22 2006/02/08 15:20:21 fw Exp $";
|
static char UNUSED id[] = "$Id: resolve.c,v 1.23 2006/02/08 15:24:10 fw Exp $";
|
||||||
|
|
||||||
#include "imp.h"
|
#include "imp.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -83,7 +83,6 @@ Resolve_Addr( RES_STAT *s, struct sockaddr_in *Addr, int identsock, void (*cbfun
|
|||||||
/* Resolve IP (asynchronous!). */
|
/* Resolve IP (asynchronous!). */
|
||||||
int pid, pipefd[2];
|
int pid, pipefd[2];
|
||||||
assert(s != NULL);
|
assert(s != NULL);
|
||||||
s->success = false;
|
|
||||||
|
|
||||||
pid = Resolver_fork(pipefd);
|
pid = Resolver_fork(pipefd);
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
@ -109,7 +108,6 @@ Resolve_Name( RES_STAT *s, const char *Host, void (*cbfunc)(int, short))
|
|||||||
/* Resolve hostname (asynchronous!). */
|
/* Resolve hostname (asynchronous!). */
|
||||||
int pid, pipefd[2];
|
int pid, pipefd[2];
|
||||||
assert(s != NULL);
|
assert(s != NULL);
|
||||||
s->success = false;
|
|
||||||
|
|
||||||
pid = Resolver_fork(pipefd);
|
pid = Resolver_fork(pipefd);
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
@ -136,7 +134,6 @@ Resolve_Init(RES_STAT *s)
|
|||||||
assert(s != NULL);
|
assert(s != NULL);
|
||||||
s->resolver_fd = -1;
|
s->resolver_fd = -1;
|
||||||
s->pid = 0;
|
s->pid = 0;
|
||||||
/* s->success must not be changed -- it will be set by other Resolve_*() functions */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -356,7 +353,6 @@ Resolve_Read( RES_STAT *s, void* readbuf, size_t buflen)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->success = true;
|
|
||||||
return bytes_read;
|
return bytes_read;
|
||||||
}
|
}
|
||||||
/* -eof- */
|
/* -eof- */
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
* Please read the file COPYING, README and AUTHORS for more information.
|
* Please read the file COPYING, README and AUTHORS for more information.
|
||||||
*
|
*
|
||||||
* $Id: resolve.h,v 1.11 2005/09/12 19:10:21 fw Exp $
|
* $Id: resolve.h,v 1.12 2006/02/08 15:24:10 fw Exp $
|
||||||
*
|
*
|
||||||
* Asynchronous resolver (header)
|
* Asynchronous resolver (header)
|
||||||
*/
|
*/
|
||||||
@ -24,13 +24,11 @@
|
|||||||
typedef struct _Res_Stat {
|
typedef struct _Res_Stat {
|
||||||
int pid; /* PID of resolver process */
|
int pid; /* PID of resolver process */
|
||||||
int resolver_fd; /* pipe fd for lookup result. */
|
int resolver_fd; /* pipe fd for lookup result. */
|
||||||
bool success; /* resolver returned data */
|
|
||||||
} RES_STAT;
|
} RES_STAT;
|
||||||
|
|
||||||
|
|
||||||
#define Resolve_Getfd(x) ((x)->resolver_fd)
|
#define Resolve_Getfd(x) ((x)->resolver_fd)
|
||||||
#define Resolve_INPROGRESS(x) ((x)->resolver_fd >= 0)
|
#define Resolve_INPROGRESS(x) ((x)->resolver_fd >= 0)
|
||||||
#define Resolve_SUCCESS(x) ((x)->resolver_fd < 0 && (x)->success)
|
|
||||||
|
|
||||||
GLOBAL bool Resolve_Addr PARAMS(( RES_STAT *s, struct sockaddr_in *Addr, int identsock, void (*cbfunc)(int, short)));
|
GLOBAL bool Resolve_Addr PARAMS(( RES_STAT *s, struct sockaddr_in *Addr, int identsock, void (*cbfunc)(int, short)));
|
||||||
GLOBAL bool Resolve_Name PARAMS(( RES_STAT *s, const char *Host, void (*cbfunc)(int, short) ));
|
GLOBAL bool Resolve_Name PARAMS(( RES_STAT *s, const char *Host, void (*cbfunc)(int, short) ));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user