recvjob.c (68380) | recvjob.c (68735) |
---|---|
1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 29 unchanged lines hidden (view full) --- 38 The Regents of the University of California. All rights reserved.\n"; 39#endif /* not lint */ 40 41#ifndef lint 42#if 0 43static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95"; 44#endif 45static const char rcsid[] = | 1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 29 unchanged lines hidden (view full) --- 38 The Regents of the University of California. All rights reserved.\n"; 39#endif /* not lint */ 40 41#ifndef lint 42#if 0 43static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95"; 44#endif 45static const char rcsid[] = |
46 "$FreeBSD: head/usr.sbin/lpr/lpd/recvjob.c 68380 2000-11-06 04:37:56Z gad $"; | 46 "$FreeBSD: head/usr.sbin/lpr/lpd/recvjob.c 68735 2000-11-14 22:08:52Z gad $"; |
47#endif /* not lint */ 48 49/* 50 * Receive printer jobs from the network, queue them and 51 * start the printer daemon. 52 */ 53#include <sys/param.h> 54#include <sys/mount.h> --- 83 unchanged lines hidden (view full) --- 138 * Return the number of jobs successfully transfered. 139 */ 140static int 141readjob(pp) 142 struct printer *pp; 143{ 144 register int size; 145 register char *cp; | 47#endif /* not lint */ 48 49/* 50 * Receive printer jobs from the network, queue them and 51 * start the printer daemon. 52 */ 53#include <sys/param.h> 54#include <sys/mount.h> --- 83 unchanged lines hidden (view full) --- 138 * Return the number of jobs successfully transfered. 139 */ 140static int 141readjob(pp) 142 struct printer *pp; 143{ 144 register int size; 145 register char *cp; |
146 int cfcnt, dfcnt; 147 char givenid[32], givenhost[MAXHOSTNAMELEN]; | 146 int cfcnt, dfcnt; 147 char givenid[32], givenhost[MAXHOSTNAMELEN]; |
148 149 ack(); 150 cfcnt = 0; 151 dfcnt = 0; 152 for (;;) { 153 /* 154 * Read a command to tell us what to do 155 */ --- 237 unchanged lines hidden (view full) --- 393 va_start(ap, msg); 394#else 395 va_start(ap); 396#endif 397 syslog(LOG_ERR, "Error receiving job from %s:", fromb); 398 vsyslog(LOG_ERR, msg, ap); 399 va_end(ap); 400 /* | 148 149 ack(); 150 cfcnt = 0; 151 dfcnt = 0; 152 for (;;) { 153 /* 154 * Read a command to tell us what to do 155 */ --- 237 unchanged lines hidden (view full) --- 393 va_start(ap, msg); 394#else 395 va_start(ap); 396#endif 397 syslog(LOG_ERR, "Error receiving job from %s:", fromb); 398 vsyslog(LOG_ERR, msg, ap); 399 va_end(ap); 400 /* |
401 * rcleanup is not called until AFTER logging the error message, 402 * because rcleanup will zap some variables which may have been 403 * supplied as parameters for that msg... | 401 * rcleanup is not called until AFTER logging the error message, 402 * because rcleanup will zap some variables which may have been 403 * supplied as parameters for that msg... |
404 */ 405 rcleanup(0); 406 /* 407 * Add a minimal delay before returning the final error code to 408 * the sending host. This just in case that machine responds 409 * this error by INSTANTLY retrying (and instantly re-failing...). 410 * It would be stupid of the sending host to do that, but if there 411 * was a broken implementation which did it, the result might be 412 * obscure performance problems and a flood of syslog messages on 413 * the receiving host. 414 */ 415 sleep(2); /* a paranoid throttling measure */ 416 putchar('\1'); /* return error code */ 417 exit(1); 418} | 404 */ 405 rcleanup(0); 406 /* 407 * Add a minimal delay before returning the final error code to 408 * the sending host. This just in case that machine responds 409 * this error by INSTANTLY retrying (and instantly re-failing...). 410 * It would be stupid of the sending host to do that, but if there 411 * was a broken implementation which did it, the result might be 412 * obscure performance problems and a flood of syslog messages on 413 * the receiving host. 414 */ 415 sleep(2); /* a paranoid throttling measure */ 416 putchar('\1'); /* return error code */ 417 exit(1); 418} |