diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2011-01-17 23:54:15 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2011-01-17 23:54:15 +0000 |
commit | 0268488e2f31bbec0c6b02ff7b7594b3191e6177 (patch) | |
tree | 23495e9caedd80740ae4d956554c014d339da456 /cgi-bin/printers.c | |
parent | c779abb06a2a4c102b65b3f9f65e4ca6a792fff7 (diff) | |
download | cups-0268488e2f31bbec0c6b02ff7b7594b3191e6177.tar.gz |
Merge changes from CUPS 1.5svn-r9491.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@2949 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cgi-bin/printers.c')
-rw-r--r-- | cgi-bin/printers.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/cgi-bin/printers.c b/cgi-bin/printers.c index f57a4251e..8b613f3b7 100644 --- a/cgi-bin/printers.c +++ b/cgi-bin/printers.c @@ -1,9 +1,9 @@ /* * "$Id: printers.c 7940 2008-09-16 00:45:16Z mike $" * - * Printer status CGI for the Common UNIX Printing System (CUPS). + * Printer status CGI for CUPS. * - * Copyright 2007-2008 by Apple Inc. + * Copyright 2007-2011 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -148,7 +148,21 @@ main(int argc, /* I - Number of command-line arguments */ } else if (printer) { - if (!strcmp(op, "start-printer")) + if (!*op) + { + const char *server_port = getenv("SERVER_PORT"); + /* Port number string */ + int port = atoi(server_port ? server_port : "0"); + /* Port number */ + char uri[1024]; /* URL */ + + httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), + getenv("HTTPS") ? "https" : "http", NULL, + getenv("SERVER_NAME"), port, "/printers/%s", printer); + + printf("Location: %s\n\n", uri); + } + else if (!strcmp(op, "start-printer")) do_printer_op(http, printer, IPP_RESUME_PRINTER, cgiText(_("Resume Printer"))); else if (!strcmp(op, "stop-printer")) |