* User, system, and password routines for the Common UNIX Printing
* System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* The default encryption setting comes from the CUPS_ENCRYPTION
* environment variable, then the ~/.cupsrc file, and finally the
* /etc/cups/client.conf file. If not set, the default is
- * HTTP_ENCRYPT_IF_REQUESTED.
+ * @code HTTP_ENCRYPT_IF_REQUESTED@.
*/
http_encryption_t /* O - Encryption settings */
/*
* 'cupsGetPassword()' - Get a password from the user.
*
- * Uses the current password callback function. Returns NULL if the
+ * Uses the current password callback function. Returns @code NULL@ if the
* user does not provide a password.
*/
void
cupsSetEncryption(http_encryption_t e) /* I - New encryption preference */
{
- _cupsGlobals()->encryption = e;
+ _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
+
+
+ cg->encryption = e;
+
+ if (cg->http)
+ httpEncryption(cg->http, e);
}
/*
* 'cupsSetPasswordCB()' - Set the password callback for CUPS.
*
- * Pass NULL to restore the default (console) password callback.
+ * Pass @code NULL@ to restore the default (console) password callback.
*/
void
* 'cupsSetServer()' - Set the default server name.
*
* The "server" string can be a fully-qualified hostname, a numeric
- * IPv4 or IPv6 address, or a domain socket pathname. Pass NULL to
+ * IPv4 or IPv6 address, or a domain socket pathname. Pass @code NULL@ to
* restore the default server name.
*/
cg->server[0] = '\0';
cg->servername[0] = '\0';
}
+
+ if (cg->http)
+ {
+ httpClose(cg->http);
+ cg->http = NULL;
+ }
}
/*
* 'cupsSetUser()' - Set the default user name.
*
- * Pass NULL to restore the default user name.
+ * Pass @code NULL@ to restore the default user name.
*/
void