option values separated by commas.
- Added new scheduler malloc logging in debug mode
(provides summary of total arena size, allocated,
- and free bytes once every 5 minutes)
+ and free bytes once a minute)
- The EPM-based distributions didn't install the
correct symlinks for a few man pages.
- - Fixed a memory leak in DeletePrinter() in the
- scheduler - wasn't freeing filters.
+ - Fixed a memory leak in the scheduler - wasn't
+ freeing old filters when deleting or renaming
+ printers.
+ - The web interfaces now correctly link to the
+ localhost address when accessing printers from
+ the local system.
CHANGES IN CUPS v1.1.2
/*
- * "$Id: config.h.in,v 1.30 2000/09/14 15:36:24 mike Exp $"
+ * "$Id: config.h.in,v 1.31 2000/09/14 18:54:11 mike Exp $"
*
* Configuration file for the Common UNIX Printing System (CUPS).
*
#undef HAVE_WAIT3
/*
- * Do we have the mallinfo function in libmalloc and malloc.h?
+ * Do we have the mallinfo function and malloc.h?
*/
-#undef HAVE_LIBMALLOC
+#undef HAVE_MALLINFO
#undef HAVE_MALLOC_H
/*
- * End of "$Id: config.h.in,v 1.30 2000/09/14 15:36:24 mike Exp $".
+ * End of "$Id: config.h.in,v 1.31 2000/09/14 18:54:11 mike Exp $".
*/
dnl
-dnl "$Id: configure.in,v 1.55 2000/09/14 18:04:09 mike Exp $"
+dnl "$Id: configure.in,v 1.56 2000/09/14 18:54:12 mike Exp $"
dnl
dnl Configuration script for the Common UNIX Printing System (CUPS).
dnl
AC_CHECK_LIB(sec,getspent)
LIBMALLOC=""
-AC_CHECK_LIB(c,mallinfo,LIBS="$LIBS",LIBS="$LIBS")
+AC_CHECK_LIB(c,mallinfo,LIBS="$LIBS"; AC_DEFINE(HAVE_MALLINFO),LIBS="$LIBS")
if test "$ac_cv_lib_c_mallinfo" = "no"; then
AC_CHECK_LIB(malloc,mallinfo,
LIBS="$LIBS"
LIBMALLOC="-lmalloc"
- AC_DEFINE(HAVE_LIBMALLOC),
+ AC_DEFINE(HAVE_MALLINFO),
LIBS="$LIBS")
fi
AC_SUBST(LIBMALLOC)
AC_OUTPUT(Makedefs cups.sh)
dnl
-dnl End of "$Id: configure.in,v 1.55 2000/09/14 18:04:09 mike Exp $".
+dnl End of "$Id: configure.in,v 1.56 2000/09/14 18:54:12 mike Exp $".
dnl
/*
- * "$Id: client.c,v 1.70 2000/09/14 16:38:36 mike Exp $"
+ * "$Id: client.c,v 1.71 2000/09/14 18:54:13 mike Exp $"
*
* Client routines for the Common UNIX Printing System (CUPS) scheduler.
*
else
host = NULL;
- if (host == NULL)
+ if (con->http.hostaddr.sin_addr.s_addr == ServerAddr.sin_addr.s_addr)
+ {
+ /*
+ * Map accesses from the same host to the server name.
+ */
+
+ strncpy(con->http.hostname, ServerName, sizeof(con->http.hostname) - 1);
+ }
+ else if (host == NULL)
sprintf(con->http.hostname, "%d.%d.%d.%d", (address >> 24) & 255,
(address >> 16) & 255, (address >> 8) & 255, address & 255);
else
/*
- * End of "$Id: client.c,v 1.70 2000/09/14 16:38:36 mike Exp $".
+ * End of "$Id: client.c,v 1.71 2000/09/14 18:54:13 mike Exp $".
*/
/*
- * "$Id: client.h,v 1.12 2000/09/07 19:54:05 mike Exp $"
+ * "$Id: client.h,v 1.13 2000/09/14 18:54:13 mike Exp $"
*
* Client definitions for the Common UNIX Printing System (CUPS) scheduler.
*
/* Number of HTTP clients */
VAR client_t *Clients VALUE(NULL);
/* HTTP clients */
+VAR struct sockaddr_in ServerAddr; /* Server IP address */
/*
extern int WriteClient(client_t *con);
/*
- * End of "$Id: client.h,v 1.12 2000/09/07 19:54:05 mike Exp $".
+ * End of "$Id: client.h,v 1.13 2000/09/14 18:54:13 mike Exp $".
*/
/*
- * "$Id: dirsvc.c,v 1.60 2000/09/12 18:35:01 mike Exp $"
+ * "$Id: dirsvc.c,v 1.61 2000/09/14 18:54:13 mike Exp $"
*
* Directory services routines for the Common UNIX Printing System (CUPS).
*
if (p->type & CUPS_PRINTER_REMOTE)
{
+ DeletePrinterFilters(p);
strcat(p->name, "@");
strcat(p->name, p->hostname);
SetPrinterAttrs(p);
if (p->type & CUPS_PRINTER_REMOTE)
{
+ DeletePrinterFilters(p);
strcat(p->name, "@");
strcat(p->name, p->hostname);
SetPrinterAttrs(p);
/*
- * End of "$Id: dirsvc.c,v 1.60 2000/09/12 18:35:01 mike Exp $".
+ * End of "$Id: dirsvc.c,v 1.61 2000/09/14 18:54:13 mike Exp $".
*/
/*
- * "$Id: ipp.c,v 1.96 2000/09/13 12:49:55 mike Exp $"
+ * "$Id: ipp.c,v 1.97 2000/09/14 18:54:13 mike Exp $"
*
* IPP routines for the Common UNIX Printing System (CUPS) scheduler.
*
else if (pclass->type & CUPS_PRINTER_REMOTE)
{
/*
- * Rename the remote class to "Class@server"...
+ * Rename the remote class to "Class"...
*/
+ DeletePrinterFilters(pclass);
snprintf(pclass->name, sizeof(pclass->name), "%s@%s", resource + 10,
pclass->hostname);
SetPrinterAttrs(pclass);
* Rename the remote printer to "Printer@server"...
*/
+ DeletePrinterFilters(printer);
snprintf(printer->name, sizeof(printer->name), "%s@%s", resource + 10,
printer->hostname);
SetPrinterAttrs(printer);
/*
- * End of "$Id: ipp.c,v 1.96 2000/09/13 12:49:55 mike Exp $".
+ * End of "$Id: ipp.c,v 1.97 2000/09/14 18:54:13 mike Exp $".
*/
/*
- * "$Id: listen.c,v 1.5 2000/09/07 19:54:05 mike Exp $"
+ * "$Id: listen.c,v 1.6 2000/09/14 18:54:14 mike Exp $"
*
* Server listening routines for the Common UNIX Printing System (CUPS)
* scheduler.
int i, /* Looping var */
val; /* Parameter value */
listener_t *lis; /* Current listening socket */
+ struct hostent *host; /* Host entry for server address */
LogMessage(L_DEBUG, "StartListening() NumListeners=%d", NumListeners);
+ /*
+ * Get the server's IP address...
+ */
+
+ memset(&ServerAddr, 0, sizeof(ServerAddr));
+
+ if ((host = gethostbyname(ServerName)) != NULL)
+ {
+ /*
+ * Found the server's address!
+ */
+
+ memcpy((char *)&(ServerAddr.sin_addr), host->h_addr, host->h_length);
+ ServerAddr.sin_family = host->h_addrtype;
+ }
+ else
+ {
+ /*
+ * Didn't find it! Use an address of 0...
+ */
+
+ LogMessage(L_ERROR, "StartListening() Unable to find IP address for server name \"%s\"!\n",
+ ServerName);
+
+ ServerAddr.sin_family = AF_INET;
+ }
+
/*
* Setup socket listeners...
*/
/*
- * End of "$Id: listen.c,v 1.5 2000/09/07 19:54:05 mike Exp $".
+ * End of "$Id: listen.c,v 1.6 2000/09/14 18:54:14 mike Exp $".
*/
/*
- * "$Id: main.c,v 1.44 2000/09/14 15:36:26 mike Exp $"
+ * "$Id: main.c,v 1.45 2000/09/14 18:54:14 mike Exp $"
*
* Scheduler main loop for the Common UNIX Printing System (CUPS).
*
#include <sys/resource.h>
#include <syslog.h>
-#if defined(HAVE_MALLOC_H) && defined(HAVE_LIBMALLOC)
+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
# include <malloc.h>
-#endif /* HAVE_MALLOC_H && HAVE_LIBMALLOC */
+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */
/*
listener_t *lis; /* Current listener */
time_t activity; /* Activity timer */
time_t senddoc_time; /* Send-Document time */
+#ifdef HAVE_MALLINFO
+ time_t mallinfo_time; /* Malloc information time */
+#endif /* HAVE_MALLINFO */
struct timeval timeout; /* select() timeout */
struct rlimit limit; /* Runtime limit */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
senddoc_time = time(NULL);
}
+#ifdef HAVE_MALLINFO
/*
- * Update the root certificate and log memory usage once every 5 minutes...
+ * Log memory usage every minute...
*/
- if ((time(NULL) - RootCertTime) >= 300)
+ if ((time(NULL) - mallinfo_time) >= 60 && LogLevel >= L_DEBUG)
{
-#if defined(HAVE_MALLOC_H) && defined(HAVE_LIBMALLOC)
struct mallinfo mem; /* Malloc information */
- /*
- * Log memory usage...
- */
-
mem = mallinfo();
LogMessage(L_DEBUG, "mallinfo: arena = %d, used = %d, free = %d\n",
mem.arena, mem.usmblks + mem.uordblks,
mem.fsmblks + mem.fordblks);
-#endif /* HAVE_MALLOC_H && HAVE_LIBMALLOC */
+ mallinfo_time = time(NULL);
+ }
+#endif /* HAVE_MALLINFO */
+ /*
+ * Update the root certificate once every 5 minutes...
+ */
+
+ if ((time(NULL) - RootCertTime) >= 300)
+ {
/*
* Update the root certificate...
*/
/*
- * End of "$Id: main.c,v 1.44 2000/09/14 15:36:26 mike Exp $".
+ * End of "$Id: main.c,v 1.45 2000/09/14 18:54:14 mike Exp $".
*/