]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/client.h
Import changes from CUPS 1.4svn-r8704.
[thirdparty/cups.git] / scheduler / client.h
index 7a7b70cd70bf4d996c1756615622c7871fbb7bdb..aa2cee81866cb4b51259a1d1915f239b323f0eb5 100644 (file)
@@ -1,27 +1,23 @@
 /*
- * "$Id: client.h 5305 2006-03-18 03:05:12Z mike $"
+ * "$Id: client.h 7935 2008-09-11 01:54:11Z mike $"
  *
  *   Client definitions for the Common UNIX Printing System (CUPS) scheduler.
  *
- *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ *   Copyright 2007-2009 by Apple Inc.
+ *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   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/".
  */
 
+#ifdef HAVE_AUTHORIZATION_H
+#  include <Security/Authorization.h>
+#endif /* HAVE_AUTHORIZATION_H */
+
+
 /*
  * HTTP client structure...
  */
@@ -32,22 +28,25 @@ struct cupsd_client_s
   ipp_t                        *request,       /* IPP request information */
                        *response;      /* IPP response information */
   cupsd_location_t     *best;          /* Best match for AAA */
-  time_t               start;          /* Request start time */
+  struct timeval       start;          /* Request start time */
   http_state_t         operation;      /* Request operation */
   off_t                        bytes;          /* Bytes transferred for this request */
-  char                 username[33],   /* Username from Authorization: line */
+  int                  type;           /* AuthType for username */
+  char                 username[256],  /* Username from Authorization: line */
                        password[33],   /* Password from Authorization: line */
                        uri[HTTP_MAX_URI],
                                        /* Localized URL/URI for GET/PUT */
                        *filename,      /* Filename of output file */
                        *command,       /* Command to run */
-                       *options;       /* Options for command */
+                       *options,       /* Options for command */
+                       *query_string;  /* QUERY_STRING environment variable */
   int                  file;           /* Input/output file */
   int                  file_ready;     /* Input ready on file/pipe? */
   int                  pipe_pid;       /* Pipe process ID (or 0 if not a pipe) */
   int                  sent_header,    /* Non-zero if sent HTTP header */
                        got_fields,     /* Non-zero if all fields seen */
-                       field_col;      /* Column within line */
+                       header_used;    /* Number of header bytes used */
+  char                 header[2048];   /* Header from CGI program */
   cups_lang_t          *language;      /* Language to use */
 #ifdef HAVE_SSL
   int                  auto_ssl;       /* Automatic test for SSL/TLS */
@@ -55,6 +54,16 @@ struct cupsd_client_s
   http_addr_t          clientaddr;     /* Client address */
   char                 servername[256];/* Server name for connection */
   int                  serverport;     /* Server port for connection */
+#ifdef HAVE_GSSAPI
+  int                  have_gss;       /* Have GSS credentials? */
+  gss_cred_id_t        gss_creds;      /* Delegated credentials from client */
+  unsigned             gss_flags;      /* Credential flags */
+  gss_buffer_desc      gss_output_token;
+                                       /* Output token for Negotiate header */
+#endif /* HAVE_GSSAPI */
+#ifdef HAVE_AUTHORIZATION_H
+  AuthorizationRef     authref;        /* Authorization ref */
+#endif /* HAVE_AUTHORIZATION_H */
 };
 
 #define HTTP(con) &((con)->http)
@@ -78,16 +87,20 @@ typedef struct
 
 VAR int                        ListenBackLog   VALUE(SOMAXCONN),
                                        /* Max backlog of pending connections */
-                       LocalPort       VALUE(631);
+                       LocalPort       VALUE(631),
                                        /* Local port to use */
+                       RemotePort      VALUE(0);
+                                       /* Remote port to use */
 VAR http_encryption_t  LocalEncryption VALUE(HTTP_ENCRYPT_IF_REQUESTED);
                                        /* Local port encryption to use */
 VAR cups_array_t       *Listeners      VALUE(NULL);
                                        /* Listening sockets */
-VAR cups_array_t       *Clients        VALUE(NULL);
+VAR time_t             ListeningPaused VALUE(0);
+                                       /* Time when listening was paused */
+VAR cups_array_t       *Clients        VALUE(NULL),
                                        /* HTTP clients */
-VAR http_addrlist_t    *ServerAddrs    VALUE(NULL);
-                                       /* Server address(es) */
+                       *ActiveClients  VALUE(NULL);
+                                       /* Active HTTP clients */
 VAR char               *ServerHeader   VALUE(NULL);
                                        /* Server header in requests */
 VAR int                        CGIPipes[2]     VALUE2(-1,-1);
@@ -104,22 +117,24 @@ extern void       cupsdAcceptClient(cupsd_listener_t *lis);
 extern void    cupsdCloseAllClients(void);
 extern int     cupsdCloseClient(cupsd_client_t *con);
 extern void    cupsdDeleteAllListeners(void);
+extern int     cupsdFlushHeader(cupsd_client_t *con);
 extern void    cupsdPauseListening(void);
 extern int     cupsdProcessIPPRequest(cupsd_client_t *con);
-extern int     cupsdReadClient(cupsd_client_t *con);
+extern void    cupsdReadClient(cupsd_client_t *con);
 extern void    cupsdResumeListening(void);
 extern int     cupsdSendCommand(cupsd_client_t *con, char *command,
                                 char *options, int root);
-extern int     cupsdSendError(cupsd_client_t *con, http_status_t code);
+extern int     cupsdSendError(cupsd_client_t *con, http_status_t code,
+                              int auth_type);
 extern int     cupsdSendHeader(cupsd_client_t *con, http_status_t code,
-                               char *type);
+                               char *type, int auth_type);
 extern void    cupsdShutdownClient(cupsd_client_t *con);
 extern void    cupsdStartListening(void);
 extern void    cupsdStopListening(void);
 extern void    cupsdUpdateCGI(void);
-extern int     cupsdWriteClient(cupsd_client_t *con);
+extern void    cupsdWriteClient(cupsd_client_t *con);
 
 
 /*
- * End of "$Id: client.h 5305 2006-03-18 03:05:12Z mike $".
+ * End of "$Id: client.h 7935 2008-09-11 01:54:11Z mike $".
  */