355b4669e025ff377602b6fc7caaf30dbc218371jacobs * CDDL HEADER START
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * The contents of this file are subject to the terms of the
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Common Development and Distribution License (the "License").
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * You may not use this file except in compliance with the License.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * See the License for the specific language governing permissions
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * and limitations under the License.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * When distributing Covered Code, include this CDDL HEADER in each
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * If applicable, add the following below this CDDL HEADER, with the
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * fields enclosed by brackets "[]" replaced with your own identifying
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * information: Portions Copyright [yyyy] [name of copyright owner]
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * CDDL HEADER END
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Use is subject to license terms.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs/* $Id: service.c 171 2006-05-20 06:00:32Z njacobs $ */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#pragma ident "%Z%%M% %I% %E% SMI"
355b4669e025ff377602b6fc7caaf30dbc218371jacobs/*LINTLIBRARY*/
355b4669e025ff377602b6fc7caaf30dbc218371jacobs ; /* this should log an error */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs return (HTTP_ENCRYPT_NEVER); /* should never get here */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if (svc->connection != NULL) /* alread connected ? */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * a name was supplied and it's not in URI form, we will
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * try to use a "default" IPP service under the assumption
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * that this is most likely a short-form printer name from
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * from a papiPrinter*() or papiJob*() call and not from a
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * papiServiceCreate() call.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if ((service_name = getenv("PAPI_SERVICE_URI")) == NULL) {
355b4669e025ff377602b6fc7caaf30dbc218371jacobs svc->connection = httpConnectEncrypt(svc->uri->host, port,
355b4669e025ff377602b6fc7caaf30dbc218371jacobspapiServiceCreate(papi_service_t *handle, char *service_name,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if ((*handle = svc = calloc(1, sizeof (*svc))) == NULL)
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if ((encoding != NULL) && (strcasecmp(encoding, "content-length") == 0))
355b4669e025ff377602b6fc7caaf30dbc218371jacobspapiServiceSetUserName(papi_service_t handle, char *user_name)
355b4669e025ff377602b6fc7caaf30dbc218371jacobspapiServiceSetPassword(papi_service_t handle, char *password)
355b4669e025ff377602b6fc7caaf30dbc218371jacobspapiServiceSetAppData(papi_service_t handle, void *app_data)
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * fill in the message. If the buffer is too small, allocate
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * one that is large enough and fill it in.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if ((size = vsnprintf(message, BUFSIZ, fmt, ap)) >= BUFSIZ)