static const char *iprint_server(void)
{
- if ((lp_iprint_server() != NULL) && (strlen(lp_iprint_server()) > 0)) {
+ const char *server = lp_iprint_server(talloc_tos());
+
+ if ((server != NULL) && (strlen(server) > 0)) {
DEBUG(10, ("iprint server explicitly set to %s\n",
- lp_iprint_server()));
- return lp_iprint_server();
+ server));
+ return server;
}
DEBUG(10, ("iprint server left to default %s\n", cupsServer()));
"attributes-natural-language", NULL, language->language);
slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
- lp_printername(snum));
+ lp_printername(talloc_tos(), snum));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
*/
slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s",
- lp_printername(snum));
+ lp_printername(talloc_tos(), snum));
if ((response = cupsDoRequest(http, request, httpPath)) != NULL) {
if (ippGetStatusCode(response) >= IPP_OK_CONFLICT) {
"attributes-natural-language", NULL, language->language);
slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
- lp_printername(snum));
+ lp_printername(talloc_tos(), snum));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
*/
slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s",
- lp_printername(snum));
+ lp_printername(talloc_tos(), snum));
if ((response = cupsDoRequest(http, request, httpPath)) != NULL) {
if (ippGetStatusCode(response) >= IPP_OK_CONFLICT) {
"attributes-natural-language", NULL, language->language);
slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
- lp_printername(snum));
+ lp_printername(talloc_tos(), snum));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
* Do the request and get back a response...
*/
- slprintf(uri, sizeof(uri) - 1, "/ipp/%s", lp_printername(snum));
+ slprintf(uri, sizeof(uri) - 1, "/ipp/%s", lp_printername(talloc_tos(), snum));
if ((response = cupsDoFileRequest(http, request, uri, pjob->filename)) != NULL) {
if (ippGetStatusCode(response) >= IPP_OK_CONFLICT) {
DEBUG(0,("Unable to print file to %s - %s\n",
- lp_printername(snum),
+ lp_printername(talloc_tos(), snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
}
} else {
DEBUG(0,("Unable to print file to `%s' - %s\n",
- lp_printername(snum),
+ lp_printername(talloc_tos(), snum),
ippErrorString(cupsLastError())));
}