summaryrefslogtreecommitdiffstats
path: root/tdeprint/cups/cupsdconf2/cups-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'tdeprint/cups/cupsdconf2/cups-util.c')
-rw-r--r--tdeprint/cups/cupsdconf2/cups-util.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/tdeprint/cups/cupsdconf2/cups-util.c b/tdeprint/cups/cupsdconf2/cups-util.c
index 3772b35d0..907459c65 100644
--- a/tdeprint/cups/cupsdconf2/cups-util.c
+++ b/tdeprint/cups/cupsdconf2/cups-util.c
@@ -237,11 +237,11 @@ cupsGetConf(void)
while ((bytes =
#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
- httpRead
+ httpRead(cups_server, buffer, sizeof(buffer))
#else
- httpRead2
+ httpRead2(cups_server, buffer, sizeof(buffer))
#endif
- (cups_server, buffer, sizeof(buffer))) > 0)
+ ) > 0)
{
write(fd, buffer, bytes);
}
@@ -341,21 +341,22 @@ cupsPutConf(const char *name) /* I - Name of the config file to send */
break;
}
else
+ {
#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
- httpWrite
+ httpWrite(cups_server, buffer, bytes);
#else
- httpWrite2
+ httpWrite2(cups_server, buffer, bytes);
#endif
- (cups_server, buffer, bytes);
+ }
if (status == HTTP_CONTINUE)
{
#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
- httpWrite
+ httpWrite(cups_server, buffer, 0);
#else
- httpWrite2
+ httpWrite2(cups_server, buffer, 0);
#endif
- (cups_server, buffer, 0);
+
while ((status = httpUpdate(cups_server)) == HTTP_CONTINUE);
}
@@ -512,13 +513,23 @@ cups_local_auth(http_t *http) /* I - Connection */
* See if we are accessing localhost...
the struct has changed in newer versions - PiggZ (adam@piggz.co.uk)
*/
-#if CUPS_VERSION_MAJOR > 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR >= 2)
- if (!httpAddrLocalhost(http))
+#if (CUPS_VERSION_MAJOR >= 2)
+ if (!httpAddrLocalhost(httpGetAddress(http)))
+ {
+ return (0);
+ }
+#elif CUPS_VERSION_MAJOR > 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR >= 2)
+ if (!httpAddrLocalhost(http))
+ {
+ return (0);
+ }
#else
if (ntohl(*(int*)&http->hostaddr.sin_addr) != 0x7f000001 &&
- strcasecmp(http->hostname, "localhost") != 0)
+ strcasecmp(http->hostname, "localhost") != 0)
+ {
+ return (0);
+ }
#endif
- return (0);
/*
* Try opening a certificate file for this PID. If that fails,