cups/cups-r10572.patch
2012-08-29 11:33:10 +02:00

31 lines
1020 B
Diff

From 03b8c2d4e3f5f3528479288df6c738f671488e54 Mon Sep 17 00:00:00 2001
From: mike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Date: Tue, 28 Aug 2012 21:54:13 +0000
Subject: CUPS now includes the port number in the Host: header
for HTTP requests.
diff --git a/cups/http.c b/cups/http.c
index 358701e..f818635 100644
--- a/cups/http.c
+++ b/cups/http.c
@@ -3702,8 +3702,17 @@ http_send(http_t *http, /* I - Connection to server */
DEBUG_printf(("9http_send: %s: %s", http_fields[i],
httpGetField(http, i)));
- if (httpPrintf(http, "%s: %s\r\n", http_fields[i],
- httpGetField(http, i)) < 1)
+ if (i == HTTP_FIELD_HOST)
+ {
+ if (httpPrintf(http, "Host: %s:%d\r\n", httpGetField(http, i),
+ _httpAddrPort(http->hostaddr)) < 1)
+ {
+ http->status = HTTP_ERROR;
+ return (-1);
+ }
+ }
+ else if (httpPrintf(http, "%s: %s\r\n", http_fields[i],
+ httpGetField(http, i)) < 1)
{
http->status = HTTP_ERROR;
return (-1);