]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/testhttp.c
Load cups into easysw/current.
[thirdparty/cups.git] / cups / testhttp.c
index 5a9a86ed99bfd84982bb7bcdeb4666a57412ebd1..37f850c9b3fa56bc475e5577d7c4554b62e84349 100644 (file)
@@ -1,25 +1,16 @@
 /*
- * "$Id: testhttp.c 5350 2006-03-29 15:26:44Z 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.
  *
@@ -84,6 +75,8 @@ static uri_test_t     uri_tests[] =   /* URI test data */
                            "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",
@@ -311,9 +304,21 @@ main(int  argc,                            /* I - Number of command-line arguments */
     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
@@ -519,5 +524,5 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
 
 /*
- * End of "$Id: testhttp.c 5350 2006-03-29 15:26:44Z mike $".
+ * End of "$Id: testhttp.c 6649 2007-07-11 21:46:42Z mike $".
  */