|
Packit Service |
82fcde |
/* Test case by Sam Varshavchik <mrsam@courier-mta.com>. */
|
|
Packit Service |
82fcde |
#include <mcheck.h>
|
|
Packit Service |
82fcde |
#include <netdb.h>
|
|
Packit Service |
82fcde |
#include <stdio.h>
|
|
Packit Service |
82fcde |
#include <string.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
int
|
|
Packit Service |
82fcde |
main (void)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
struct addrinfo hints, *res;
|
|
Packit Service |
82fcde |
int i, ret;
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
mtrace ();
|
|
Packit Service |
82fcde |
for (i = 0; i < 100; i++)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
memset (&hints, 0, sizeof (hints));
|
|
Packit Service |
82fcde |
hints.ai_family = PF_UNSPEC;
|
|
Packit Service |
82fcde |
hints.ai_socktype = SOCK_STREAM;
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
ret = getaddrinfo ("www.gnu.org", "http", &hints, &res;;
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
if (ret)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
printf ("%s\n", gai_strerror (ret));
|
|
Packit Service |
82fcde |
return 1;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
freeaddrinfo (res);
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
return 0;
|
|
Packit Service |
82fcde |
}
|