Print this page
Bump Apache dependency to Apache 2

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/print/mod_ipp/mod_ipp.c
          +++ new/usr/src/lib/print/mod_ipp/mod_ipp.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
       23 + * Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
  23   24   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  24   25   * Use is subject to license terms.
  25   26   *
  26   27   */
  27   28  
  28   29  /* $Id: mod_ipp.c 149 2006-04-25 16:55:01Z njacobs $ */
  29   30  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   31  /*
  33   32   * Internet Printing Protocol (IPP) module for Apache.
  34   33   */
  35   34  
  36   35  #include "ap_config.h"
  37   36  
  38   37  #include <stdio.h>
  39   38  #include <time.h>
  40   39  #include <sys/time.h>
  41   40  #include <values.h>
↓ open down ↓ 2 lines elided ↑ open up ↑
  44   43  
  45   44  #include "httpd.h"
  46   45  #include "http_config.h"
  47   46  #include "http_core.h"
  48   47  #include "http_protocol.h"
  49   48  #include "http_log.h"
  50   49  #include "http_main.h"
  51   50  #include "papi.h"
  52   51  #ifndef APACHE_RELEASE  /* appears to only exist in Apache 1.X */
  53   52  #define APACHE2
  54      -#include "apr_compat.h"
       53 +#define ap_table_get apr_table_get
  55   54  #endif
  56   55  
  57   56  #include <papi.h>
  58   57  #include <ipp-listener.h>
  59   58  
  60   59  #ifndef APACHE2
  61   60  module MODULE_VAR_EXPORT ipp_module;
  62   61  #else
  63   62  module AP_MODULE_DECLARE_DATA ipp_module;
  64   63  #endif
↓ open down ↓ 122 lines elided ↑ open up ↑
 187  186          /*
 188  187           * fill in the message.  If the buffer is too small, allocate
 189  188           * one that is large enough and fill it in.
 190  189           */
 191  190          if ((size = vsnprintf(message, BUFSIZ, fmt, args)) >= BUFSIZ)
 192  191                  if ((message = alloca(size)) != NULL)
 193  192                          vsnprintf(message, size, fmt, args);
 194  193          va_end(args);
 195  194  
 196  195  #ifdef APACHE2
 197      -        ap_log_rerror(file, line, level, NULL, r, message);
      196 +        ap_log_rerror(file, line, level, APR_SUCCESS, r, message);
 198  197  #else
 199  198          ap_log_rerror(file, line, level, r, message);
 200  199  #endif
 201  200  }
 202  201  
 203  202  static int
 204  203  ipp_handler(request_rec *r)
 205  204  {
 206  205          papi_attribute_t **request = NULL, **response = NULL;
 207  206          IPPListenerConfig *config;
↓ open down ↓ 73 lines elided ↑ open up ↑
 281  280                  if (config->default_user != NULL)
 282  281                          (void) papiAttributeListAddString(&request,
 283  282                                                  PAPI_ATTR_EXCL, "default-user",
 284  283                                                  config->default_user);
 285  284                  if (config->default_svc != NULL)
 286  285                          (void) papiAttributeListAddString(&request,
 287  286                                          PAPI_ATTR_EXCL, "default-service",
 288  287                                          config->default_svc);
 289  288          }
 290  289  
      290 +#ifndef APACHE2
 291  291          /*
 292  292           * For Trusted Solaris, pass the fd number of the socket connection
 293  293           * to the backend so the it can be forwarded to the backend print
 294  294           * service to retrieve the sensativity label off of a multi-level
 295  295           * port.
 296  296           */
 297  297          (void) papiAttributeListAddInteger(&request, PAPI_ATTR_EXCL,
 298  298                          "peer-socket", ap_bfileno(r->connection->client, B_RD));
      299 +#endif
 299  300  
 300  301          /* process the request */
 301  302          status = ipp_process_request(request, &response, read_data, r);
 302  303          if (status != PAPI_OK) {
 303  304                  errno = 0;
 304  305                  _log_rerror(APLOG_MARK, APLOG_ERR, r,
 305  306                          "request failed: %s\n", papiStatusString(status));
 306  307                  discard_data(r);
 307  308          }
 308  309  #ifdef DEBUG
↓ open down ↓ 83 lines elided ↑ open up ↑
 392  393                  config->conformance = IPP_PARSE_CONFORMANCE_STRICT;
 393  394          } else {
 394  395                  return ("unknown conformance, try (automatic/1.0/1.1)");
 395  396          }
 396  397  
 397  398          return (NULL);
 398  399  }
 399  400  
 400  401  /*ARGSUSED0*/
 401  402  static const char *
 402      -ipp_operation(cmd_parms *cmd, void *cfg, char *op, char *toggle)
      403 +ipp_operation(cmd_parms *cmd, void *cfg, const char *op, const char *toggle)
 403  404  {
 404  405          IPPListenerConfig *config = (IPPListenerConfig *)cfg;
 405  406          papi_status_t status;
 406  407  
 407  408          status = ipp_configure_operation(&config->operations, op, toggle);
 408  409          switch (status) {
 409  410          case PAPI_OK:
 410  411                  return (NULL);
 411  412          case PAPI_BAD_ARGUMENT:
 412  413                  return (gettext("internal error (invalid argument)"));
↓ open down ↓ 140 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX