# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../gtk+/cups-api.patch # Copyright (C) 2007 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- T2-COPYRIGHT-NOTE-END --- #We need it to work with cups-1.3.x -Aldas diff -Nur gtk+-2.10.14-orig/modules/printbackends/cups/gtkcupsutils.c gtk+-2.10.14/modules/printbackends/cups/gtkcupsutils.c --- gtk+-2.10.14-orig/modules/printbackends/cups/gtkcupsutils.c 2007-12-14 09:16:24.000000000 +0000 +++ gtk+-2.10.14/modules/printbackends/cups/gtkcupsutils.c 2007-12-14 09:26:10.000000000 +0000 @@ -19,8 +19,8 @@ * Boston, MA 02111-1307, USA. */ -#include "gtkcupsutils.h" #include "config.h" +#include "gtkcupsutils.h" #include "gtkdebug.h" #include @@ -30,10 +30,6 @@ #include #include -#if CUPS_VERSION_MAJOR > 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR > 1) || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR == 1 && CUPS_VERSION_PATCH >= 20) -#define HAVE_HTTP_AUTHSTRING 1 -#endif - typedef void (*GtkCupsRequestStateFunc) (GtkCupsRequest *request); static void _connect (GtkCupsRequest *request); @@ -617,7 +613,7 @@ if (request->data_io != NULL) { fstat (g_io_channel_unix_get_fd (request->data_io), &data_info); - sprintf (length, "%lu", (unsigned long)ippLength(request->ipp_request) + data_info.st_size); + sprintf (length, "%lu", (unsigned long) (ippLength(request->ipp_request) + data_info.st_size)); } else { @@ -627,9 +623,13 @@ httpClearFields(request->http); httpSetField(request->http, HTTP_FIELD_CONTENT_LENGTH, length); httpSetField(request->http, HTTP_FIELD_CONTENT_TYPE, "application/ipp"); +#ifdef HAVE_HTTPGETAUTHSTRING + httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, httpGetAuthString (request->http)); +#else #ifdef HAVE_HTTP_AUTHSTRING httpSetField(request->http, HTTP_FIELD_AUTHORIZATION, request->http->authstring); #endif +#endif if (httpPost(request->http, request->resource)) {