diff -ncr squid-1.1.0/src/Makefile.in squid-1.1.0.ucs/src/Makefile.in *** squid-1.1.0/src/Makefile.in Sat Dec 07 01:53:57 1996 --- squid-1.1.0.ucs/src/Makefile.in Mon Dec 09 11:41:28 1996 *************** *** 5,11 **** # # Uncomment and customize the following to suit your needs: # ! HOST_OPT = # -DCACHEMGR_HOSTNAME="getfullhostname()" AUTH_OPT = # -DUSE_PROXY_AUTH=1 LOG_HDRS_OPT = # -DLOG_FULL_HEADERS=1 ICMP_OPT = # -DUSE_ICMP=1 --- 5,11 ---- # # Uncomment and customize the following to suit your needs: # ! HOST_OPT = -DCACHEMGR_HOSTNAME="getfullhostname()" AUTH_OPT = # -DUSE_PROXY_AUTH=1 LOG_HDRS_OPT = # -DLOG_FULL_HEADERS=1 ICMP_OPT = # -DUSE_ICMP=1 *************** *** 14,22 **** KILL_PARENT_OPT = # -DKILL_PARENT_OPT USE_POLL_OPT = # -DUSE_POLL ANON_OPT = # -DUSE_ANONYMIZER DEFINES = $(HOST_OPT) $(AUTH_OPT) $(LOG_HDRS_OPT) \ $(ICMP_OPT) $(DELAY_HACK) $(USERAGENT_OPT) \ ! $(KILL_PARENT_OPT) $(USE_POLL_OPT) $(ANON_OPT) prefix = @prefix@ exec_prefix = @exec_prefix@ --- 14,23 ---- KILL_PARENT_OPT = # -DKILL_PARENT_OPT USE_POLL_OPT = # -DUSE_POLL ANON_OPT = # -DUSE_ANONYMIZER + UDP_OPT = -DNO_LOG_UDP DEFINES = $(HOST_OPT) $(AUTH_OPT) $(LOG_HDRS_OPT) \ $(ICMP_OPT) $(DELAY_HACK) $(USERAGENT_OPT) \ ! $(KILL_PARENT_OPT) $(USE_POLL_OPT) $(ANON_OPT) $(UDP_OPT) prefix = @prefix@ exec_prefix = @exec_prefix@ diff -ncr squid-1.1.0/src/icp.c squid-1.1.0.ucs/src/icp.c *** squid-1.1.0/src/icp.c Fri Dec 06 05:28:31 1996 --- squid-1.1.0.ucs/src/icp.c Tue Dec 10 09:48:31 1996 *************** *** 121,126 **** --- 121,127 ---- "TCP_IMS_MISS", "TCP_SWAPFAIL", "TCP_DENIED", + #ifndef NO_LOG_UDP "UDP_HIT", "UDP_HIT_OBJ", "UDP_MISS", *************** *** 127,132 **** --- 128,134 ---- "UDP_DENIED", "UDP_INVALID", "UDP_RELOADING", + #endif "ERR_READ_TIMEOUT", "ERR_LIFETIME_EXP", "ERR_NO_CLIENTS_BIG_OBJ", *************** *** 174,180 **** --- 176,184 ---- static void icpHandleStoreIMS _PARAMS((int, StoreEntry *, void *)); static void icpHandleIMSComplete _PARAMS((int, char *, int, int, void *icpState)); static void icpHitObjHandler _PARAMS((int, void *)); + #ifndef NO_LOG_UDP static void icpLogIcp _PARAMS((icpUdpData *)); + #endif static void icpHandleIcpV2 _PARAMS((int, struct sockaddr_in, char *, int)); static void icpHandleIcpV3 _PARAMS((int, struct sockaddr_in, char *, int)); static void icpSendERRORComplete _PARAMS((int, char *, int, int, void *)); *************** *** 893,898 **** --- 897,903 ---- return (protoDispatch(fd, url, icpState->entry, icpState->request)); } + #ifndef NO_LOG_UDP static void icpLogIcp(icpUdpData * queue) { *************** *** 923,928 **** --- 928,934 ---- queue->logcode, CACHE_ICP_PORT); } + #endif int icpUdpReply(int fd, icpUdpData * queue) *************** *** 952,959 **** --- 958,967 ---- result = COMM_ERROR; } UdpQueueHead = queue->next; + #ifndef NO_LOG_UDP if (queue->logcode) icpLogIcp(queue); + #endif safe_free(queue->msg); safe_free(queue); } *************** *** 1049,1055 **** --- 1057,1065 ---- icpUdpSend(int fd, const struct sockaddr_in *to, icp_common_t * msg, + #ifndef NO_LOG_UDP log_type logcode, + #endif protocol_t proto) { icpUdpData *data = xcalloc(1, sizeof(icpUdpData)); *************** *** 1060,1066 **** --- 1070,1078 ---- data->msg = msg; data->len = (int) ntohs(msg->length); data->start = current_time; /* wrong for HIT_OBJ */ + #ifndef NO_LOG_UDP data->logcode = logcode; + #endif data->proto = proto; AppendUdp(data); commSetSelect(fd, *************** *** 1092,1098 **** --- 1104,1112 ---- icpUdpSend(icpHitObjState->fd, &icpHitObjState->to, reply, + #ifndef NO_LOG_UDP LOG_UDP_HIT_OBJ, + #endif urlParseProtocol(entry->url)); } storeUnlockObject(entry); *************** *** 1157,1163 **** --- 1171,1181 ---- url = buf + sizeof(header) + sizeof(u_num32); if ((icp_request = urlParse(METHOD_GET, url)) == NULL) { reply = icpCreateMessage(ICP_OP_ERR, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, PROTO_NONE); + #else icpUdpSend(fd, &from, reply, LOG_UDP_INVALID, PROTO_NONE); + #endif break; } checklist.src_addr = from.sin_addr; *************** *** 1168,1174 **** --- 1186,1196 ---- inet_ntoa(from.sin_addr), AclMatchedName); if (clientdbDeniedPercent(from.sin_addr) < 95) { reply = icpCreateMessage(ICP_OP_DENIED, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_DENIED, icp_request->protocol); + #endif } break; } *************** *** 1197,1203 **** --- 1219,1229 ---- safe_free(icpHitObjState); } else { reply = icpCreateMessage(ICP_OP_HIT, 0, url, header.reqnum, netdb_gunk); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_HIT, icp_request->protocol); + #endif break; } } *************** *** 1204,1216 **** --- 1230,1254 ---- /* if store is rebuilding, return a UDP_HIT, but not a MISS */ if (store_rebuilding == STORE_REBUILDING_FAST && opt_reload_hit_only) { reply = icpCreateMessage(ICP_OP_RELOADING, 0, url, header.reqnum, netdb_gunk); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_RELOADING, icp_request->protocol); + #endif } else if (hit_only_mode_until > squid_curtime) { reply = icpCreateMessage(ICP_OP_RELOADING, 0, url, header.reqnum, netdb_gunk); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_RELOADING, icp_request->protocol); + #endif } else { reply = icpCreateMessage(ICP_OP_MISS, 0, url, header.reqnum, netdb_gunk); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_MISS, icp_request->protocol); + #endif } break; *************** *** 1307,1313 **** --- 1345,1355 ---- url = buf + sizeof(header) + sizeof(u_num32); if ((icp_request = urlParse(METHOD_GET, url)) == NULL) { reply = icpCreateMessage(ICP_OP_ERR, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, PROTO_NONE); + #else icpUdpSend(fd, &from, reply, LOG_UDP_INVALID, PROTO_NONE); + #endif break; } checklist.src_addr = from.sin_addr; *************** *** 1318,1324 **** --- 1360,1370 ---- inet_ntoa(from.sin_addr), AclMatchedName); if (clientdbDeniedPercent(from.sin_addr) < 95) { reply = icpCreateMessage(ICP_OP_DENIED, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_DENIED, icp_request->protocol); + #endif } break; } *************** *** 1328,1346 **** --- 1374,1408 ---- IcpOpcodeStr[header.opcode]); if (icpCheckUdpHit(entry, icp_request)) { reply = icpCreateMessage(ICP_OP_HIT, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_HIT, icp_request->protocol); + #endif break; } /* if store is rebuilding, return a UDP_HIT, but not a MISS */ if (opt_reload_hit_only && store_rebuilding == STORE_REBUILDING_FAST) { reply = icpCreateMessage(ICP_OP_RELOADING, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_RELOADING, icp_request->protocol); + #endif } else if (hit_only_mode_until > squid_curtime) { reply = icpCreateMessage(ICP_OP_RELOADING, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_RELOADING, icp_request->protocol); + #endif } else { reply = icpCreateMessage(ICP_OP_MISS, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_MISS, icp_request->protocol); + #endif } break; diff -ncr squid-1.1.0/src/icp.h squid-1.1.0.ucs/src/icp.h *** squid-1.1.0/src/icp.h Thu Nov 28 15:26:27 1996 --- squid-1.1.0.ucs/src/icp.h Mon Dec 09 11:57:24 1996 *************** *** 118,123 **** --- 118,124 ---- LOG_TCP_IMS_MISS, /* 8 */ LOG_TCP_SWAPIN_FAIL, /* 9 */ LOG_TCP_DENIED, /* 10 */ + #ifndef NO_LOG_UDP LOG_UDP_HIT, /* 11 */ LOG_UDP_HIT_OBJ, /* 12 */ LOG_UDP_MISS, /* 13 */ *************** *** 124,129 **** --- 125,131 ---- LOG_UDP_DENIED, /* 14 */ LOG_UDP_INVALID, /* 15 */ LOG_UDP_RELOADING, /* 16 */ + #endif ERR_READ_TIMEOUT, /* 17 */ ERR_LIFETIME_EXP, /* 18 */ ERR_NO_CLIENTS_BIG_OBJ, /* 19 */ *************** *** 153,159 **** --- 155,163 ---- size_t len; struct wwd *next; struct timeval start; + #ifndef NO_LOG_UDP log_type logcode; + #endif protocol_t proto; } icpUdpData; *************** *** 204,214 **** --- 208,225 ---- const char *url, int reqnum, int pad)); + #ifndef NO_LOG_UDP extern void icpUdpSend _PARAMS((int fd, const struct sockaddr_in *, icp_common_t * msg, log_type, protocol_t)); + #else + extern void icpUdpSend _PARAMS((int fd, + const struct sockaddr_in *, + icp_common_t * msg, + protocol_t)); + #endif extern void icpHandleUdp _PARAMS((int sock, void *data)); extern void asciiHandleConn _PARAMS((int sock, void *data)); extern void icpSendERROR _PARAMS((int fd, diff -ncr squid-1.1.0/src/neighbors.c squid-1.1.0.ucs/src/neighbors.c *** squid-1.1.0/src/neighbors.c Fri Dec 06 13:50:09 1996 --- squid-1.1.0.ucs/src/neighbors.c Mon Dec 09 11:47:34 1996 *************** *** 468,474 **** --- 468,476 ---- icpUdpSend(theOutIcpConnection, &e->in_addr, query, + #ifndef NO_LOG_UDP LOG_TAG_NONE, + #endif PROTO_NONE); } else { flags = 0; *************** *** 481,487 **** --- 483,491 ---- icpUdpSend(theOutIcpConnection, &e->in_addr, query, + #ifndef NO_LOG_UDP LOG_TAG_NONE, + #endif PROTO_NONE); } *************** *** 529,535 **** --- 533,541 ---- icpUdpSend(theOutIcpConnection, &to_addr, query, + #ifndef NO_LOG_UDP LOG_TAG_NONE, + #endif PROTO_NONE); } } else { diff -ncr squid-1.1.0/src/stat.c squid-1.1.0.ucs/src/stat.c *** squid-1.1.0/src/stat.c Wed Dec 04 04:26:59 1996 --- squid-1.1.0.ucs/src/stat.c Mon Dec 09 11:38:28 1996 *************** *** 1096,1102 **** hier_timeout = hierData->timeout; } if (Config.commonLogFormat) ! sprintf(tmp, "%s %s - [%s] \"%s %s\" %s %d\n", client, ident, mkhttpdlogtime(&squid_curtime), --- 1096,1102 ---- hier_timeout = hierData->timeout; } if (Config.commonLogFormat) ! sprintf(tmp, "%s %s - [%s] \"%s %s\" %s:%s%s %d\n", client, ident, mkhttpdlogtime(&squid_curtime), *************** *** 1103,1108 **** --- 1103,1110 ---- method, url, action, + hier_timeout ? "TIMEOUT_" : null_string, + hier_strings[hier_code], size); else sprintf(tmp, "%9d.%03d %6d %s %s/%03d %d %s %s %s %s%s/%s %s\n", *************** *** 1245,1252 **** --- 1247,1256 ---- case LOG_TCP_IMS_HIT: case LOG_TCP_REFRESH_HIT: case LOG_TCP_REFRESH_FAIL_HIT: + #ifndef NO_LOG_UDP case LOG_UDP_HIT: case LOG_UDP_HIT_OBJ: + #endif obj->proto_stat_data[proto_id].hit++; break; default: