2005-10-05 Erez Zadok <ezk@cs.sunysb.edu>
+ * amq/pawd.c (transform_dir): use TCP first, else UDP. Destroy
+ client after use to avoid leftover TCP sockets in the kernel.
+
* libamu/hasmntopt.c (amu_hasmntopt): increase size of MNTMAXSTR
from 128 to to 256, because some users have really long option
strings. Suggestion from jon+amd-at-spock.org.
* convert all sprintf to safer xsnprintf
* convert all strcat to safer xstrlcat
* convert all strcpy to safer xstrlcpy
+ * pawd uses TCP first, then UDP
Amd now understands a new log_option called "defaults" which is synonymous
with "fatal,error,user,warning,info" (and is also what logging happens by
server = localhost;
#endif /* not HAVE_CNODEID */
- if ((hp = gethostbyname(server)) == 0)
+ if ((hp = gethostbyname(server)) == NULL)
return dir;
memset(&server_addr, 0, sizeof(server_addr));
server_addr.sin_family = AF_INET;
server_addr.sin_addr = *(struct in_addr *) hp->h_addr;
- clnt = clntudp_create(&server_addr, AMQ_PROGRAM, AMQ_VERSION, tmo, &s);
- if (clnt == 0)
+ clnt = clnttcp_create(&server_addr, AMQ_PROGRAM, AMQ_VERSION, &s, 0, 0);
+ if (clnt == NULL)
+ clnt = clntudp_create(&server_addr, AMQ_PROGRAM, AMQ_VERSION, tmo, &s);
+ if (clnt == NULL)
return dir;
xstrlcpy(transform, dir, sizeof(transform));
find_mlp(mlp,transform) ) {
xstrlcpy(transform, newdir, sizeof(transform));
}
+ clnt_destroy(clnt);
return transform;
}