/*
- * "$Id: testhttp.c 5235 2006-03-06 13:02:23Z mike $"
+ * "$Id: testhttp.c 6649 2007-07-11 21:46:42Z mike $"
*
* HTTP test program for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2005 by Easy Software Products.
+ * Copyright 2007 by Apple Inc.
+ * Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
- * property of Easy Software Products and are protected by Federal
- * copyright law. Distribution and use rights are outlined in the file
- * "LICENSE.txt" which should have been included with this file. If this
- * file is missing or damaged please contact Easy Software Products
- * at:
- *
- * Attn: CUPS Licensing Information
- * Easy Software Products
- * 44141 Airport View Drive, Suite 204
- * Hollywood, Maryland 20636 USA
- *
- * Voice: (301) 373-9600
- * EMail: cups-info@cups.org
- * WWW: http://www.cups.org
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
"http", "username:password", "server", "/", 8080, 8080 },
{ HTTP_URI_OK, "http://username:passwor%64@server:8080/directory/filename",
"http", "username:password", "server", "/directory/filename", 8080, 8080 },
+ { HTTP_URI_OK, "http://[2000::10:100]:631/ipp",
+ "http", "", "2000::10:100", "/ipp", 631, 631 },
{ HTTP_URI_OK, "https://username:passwor%64@server/directory/filename",
"https", "username:password", "server", "/directory/filename", 443, 0 },
{ HTTP_URI_OK, "ipp://username:passwor%64@[::1]/ipp",
"mailto", "", "", "user@domain.com", 0, 0 },
{ HTTP_URI_OK, "socket://server/",
"socket", "", "server", "/", 9100, 0 },
+ { HTTP_URI_OK, "socket://192.168.1.1:9101/",
+ "socket", "", "192.168.1.1", "/", 9101, 9101 },
{ HTTP_URI_OK, "ipp://username:password@[v1.fe80::200:1234:5678:9abc+eth0]:999/ipp",
"ipp", "username:password", "fe80::200:1234:5678:9abc%eth0", "/ipp", 999, 999 },
{ HTTP_URI_OK, "http://server/admin?DEVICE_URI=usb://HP/Photosmart%25202600%2520series?serial=MY53OK70V10400",
/* Missing resource */
{ HTTP_URI_MISSING_RESOURCE, "socket://[::192.168.2.1]",
"socket", "", "::192.168.2.1", "/", 9100, 0 },
+ { HTTP_URI_MISSING_RESOURCE, "socket://192.168.1.1:9101",
+ "socket", "", "192.168.1.1", "/", 9101 },
/* Bad URI */
{ HTTP_URI_BAD_URI, "",
addrlist = httpAddrGetList(hostname, AF_UNSPEC, NULL);
if (addrlist)
{
- for (i = 0, addr = addrlist; addr; i ++, addr = addr->next);
+ for (i = 0, addr = addrlist; addr; i ++, addr = addr->next)
+ {
+ char numeric[1024]; /* Numeric IP address */
+
+
+ httpAddrString(&(addr->addr), numeric, sizeof(numeric));
+ if (!strcmp(numeric, "UNKNOWN"))
+ break;
+ }
+
+ if (addr)
+ printf("FAIL (bad address for %s)\n", hostname);
+ else
+ printf("PASS (%d address(es) for %s)\n", i, hostname);
- printf("PASS (%d address(es) for %s)\n", i, hostname);
httpAddrFreeList(addrlist);
}
else
current = time(NULL);
if (current == start) current ++;
printf("\r" CUPS_LLFMT "/" CUPS_LLFMT " bytes ("
- CUPS_LLFMT " bytes/sec) ", total, length,
- total / (current - start));
+ CUPS_LLFMT " bytes/sec) ", CUPS_LLCAST total,
+ CUPS_LLCAST length, CUPS_LLCAST (total / (current - start)));
fflush(stdout);
}
}
/*
- * End of "$Id: testhttp.c 5235 2006-03-06 13:02:23Z mike $".
+ * End of "$Id: testhttp.c 6649 2007-07-11 21:46:42Z mike $".
*/