svn commit: samba r17816 - in branches/SAMBA_3_0: . source/printing
jelmer at samba.org
jelmer at samba.org
Thu Aug 24 22:11:00 GMT 2006
Author: jelmer
Date: 2006-08-24 22:10:59 +0000 (Thu, 24 Aug 2006)
New Revision: 17816
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17816
Log:
Merge my cupsprot branch. It is now possible to (optionally) specify :port in
the "cups server" smb.conf parameter.
Modified:
branches/SAMBA_3_0/
branches/SAMBA_3_0/source/printing/print_cups.c
Changeset:
Property changes on: branches/SAMBA_3_0
___________________________________________________________________
Name: bzr:merge
- jelmer at samba.org-20060718161613-53e1c111cabecd57
jelmer at samba.org-20060729112811-c224341dc6387f22
jelmer at samba.org-20060824202535-0923b9ac63b0de61
jelmer at samba.org-20060824205058-95b956f158533304
jelmer at samba.org-20060824220658-230fbfb53bdad5e7
+ jelmer at samba.org-20060718161613-53e1c111cabecd57
jelmer at samba.org-20060729112811-c224341dc6387f22
jelmer at samba.org-20060824202535-0923b9ac63b0de61
jelmer at samba.org-20060824205058-95b956f158533304
jelmer at samba.org-20060824220658-230fbfb53bdad5e7
jelmer at samba.org-20060824220942-b7a63fab1a82825e
Modified: branches/SAMBA_3_0/source/printing/print_cups.c
===================================================================
--- branches/SAMBA_3_0/source/printing/print_cups.c 2006-08-24 22:10:42 UTC (rev 17815)
+++ branches/SAMBA_3_0/source/printing/print_cups.c 2006-08-24 22:10:59 UTC (rev 17816)
@@ -40,16 +40,38 @@
return (NULL);
}
-static const char *cups_server(void)
+static http_t *cups_connect(void)
{
- if ((lp_cups_server() != NULL) && (strlen(lp_cups_server()) > 0)) {
- DEBUG(10, ("cups server explicitly set to %s\n",
- lp_cups_server()));
- return lp_cups_server();
+ http_t *http;
+ char *server, *p;
+ int port;
+
+ if (lp_cups_server() != NULL && strlen(lp_cups_server()) > 0) {
+ server = smb_xstrdup(lp_cups_server());
+ } else {
+ server = smb_xstrdup(cupsServer());
}
- DEBUG(10, ("cups server left to default %s\n", cupsServer()));
- return cupsServer();
+ p = strchr(server, ':');
+ if (p) {
+ port = atoi(p+1);
+ *p = '\0';
+ } else {
+ port = ippPort();
+ }
+
+ DEBUG(10, ("connecting to cups server %s:%d\n",
+ server, port));
+
+ if ((http = httpConnect(server, port)) == NULL) {
+ DEBUG(0,("Unable to connect to CUPS server %s:%d - %s\n",
+ server, port, strerror(errno)));
+ SAFE_FREE(server);
+ return NULL;
+ }
+
+ SAFE_FREE(server);
+ return http;
}
BOOL cups_cache_reload(void)
@@ -80,9 +102,7 @@
* Try to connect to the server...
*/
- if ((http = httpConnect(cups_server(), ippPort())) == NULL) {
- DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
- cups_server(), strerror(errno)));
+ if ((http = cups_connect()) == NULL) {
goto out;
}
@@ -287,9 +307,7 @@
* Try to connect to the server...
*/
- if ((http = httpConnect(cups_server(), ippPort())) == NULL) {
- DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
- cups_server(), strerror(errno)));
+ if ((http = cups_connect()) == NULL) {
goto out;
}
@@ -379,9 +397,7 @@
* Try to connect to the server...
*/
- if ((http = httpConnect(cups_server(), ippPort())) == NULL) {
- DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
- cups_server(), strerror(errno)));
+ if ((http = cups_connect()) == NULL) {
goto out;
}
@@ -471,9 +487,7 @@
* Try to connect to the server...
*/
- if ((http = httpConnect(cups_server(), ippPort())) == NULL) {
- DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
- cups_server(), strerror(errno)));
+ if ((http = cups_connect()) == NULL) {
goto out;
}
@@ -566,9 +580,7 @@
* Try to connect to the server...
*/
- if ((http = httpConnect(cups_server(), ippPort())) == NULL) {
- DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
- cups_server(), strerror(errno)));
+ if ((http = cups_connect()) == NULL) {
goto out;
}
@@ -732,9 +744,7 @@
* Try to connect to the server...
*/
- if ((http = httpConnect(cups_server(), ippPort())) == NULL) {
- DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
- cups_server(), strerror(errno)));
+ if ((http = cups_connect()) == NULL) {
goto out;
}
@@ -1017,9 +1027,7 @@
* Try to connect to the server...
*/
- if ((http = httpConnect(cups_server(), ippPort())) == NULL) {
- DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
- cups_server(), strerror(errno)));
+ if ((http = cups_connect()) == NULL) {
goto out;
}
@@ -1111,9 +1119,7 @@
* Try to connect to the server...
*/
- if ((http = httpConnect(cups_server(), ippPort())) == NULL) {
- DEBUG(0,("Unable to connect to CUPS server %s - %s\n",
- cups_server(), strerror(errno)));
+ if ((http = cups_connect()) == NULL) {
goto out;
}
More information about the samba-cvs
mailing list