-/* $Id: wais.cc,v 1.13 1996/03/28 20:42:48 wessels Exp $ */
+/* $Id: wais.cc,v 1.14 1996/03/29 21:13:31 wessels Exp $ */
+
+/*
+ * DEBUG: Section 24 wais
+ */
#include "squid.h"
StoreEntry *entry = NULL;
entry = data->entry;
- debug(0, 4, "waisReadReplyTimeout: Timeout on %d\n url: %s\n", fd, entry->url);
+ debug(24, 4, "waisReadReplyTimeout: Timeout on %d\n url: %s\n", fd, entry->url);
cached_error_entry(entry, ERR_READ_TIMEOUT, NULL);
comm_set_select_handler(fd, COMM_SELECT_READ, 0, 0);
comm_close(fd);
StoreEntry *entry = NULL;
entry = data->entry;
- debug(0, 4, "waisLifeTimeExpire: FD %d: <URL:%s>\n", fd, entry->url);
+ debug(24, 4, "waisLifeTimeExpire: FD %d: <URL:%s>\n", fd, entry->url);
cached_error_entry(entry, ERR_LIFETIME_EXP, NULL);
comm_set_select_handler(fd, COMM_SELECT_READ | COMM_SELECT_WRITE, 0, 0);
comm_close(fd);
/* check if we want to defer reading */
if ((entry->mem_obj->e_current_len -
entry->mem_obj->e_lowest_offset) > WAIS_DELETE_GAP) {
- debug(0, 3, "waisReadReply: Read deferred for Object: %s\n", entry->key);
- debug(0, 3, " Current Gap: %d bytes\n",
+ debug(24, 3, "waisReadReply: Read deferred for Object: %s\n", entry->key);
+ debug(24, 3, " Current Gap: %d bytes\n",
entry->mem_obj->e_current_len -
entry->mem_obj->e_lowest_offset);
}
}
len = read(fd, buf, 4096);
- debug(0, 5, "waisReadReply - fd: %d read len:%d\n", fd, len);
+ debug(24, 5, "waisReadReply - fd: %d read len:%d\n", fd, len);
if (len < 0 || ((len == 0) && (entry->mem_obj->e_current_len == 0))) {
- debug(0, 1, "waisReadReply - error reading errno %d: %s\n",
+ debug(24, 1, "waisReadReply - error reading errno %d: %s\n",
errno, xstrerror());
if (errno == ECONNRESET) {
/* Connection reset by peer */
{
StoreEntry *entry = NULL;
entry = data->entry;
- debug(0, 5, "waisSendComplete - fd: %d size: %d errflag: %d\n",
+ debug(24, 5, "waisSendComplete - fd: %d size: %d errflag: %d\n",
fd, size, errflag);
if (errflag) {
cached_error_entry(entry, ERR_CONNECT_FAIL, xstrerror());
int len = strlen(data->request) + 4;
char *buf;
- debug(0, 5, "waisSendRequest - fd: %d\n", fd);
+ debug(24, 5, "waisSendRequest - fd: %d\n", fd);
if (data->type)
len += strlen(data->type);
data->mime_hdr, CR, LF);
else
sprintf(buf, "%s %s%c%c", data->type, data->request, CR, LF);
- debug(0, 6, "waisSendRequest - buf:%s\n", buf);
+ debug(24, 6, "waisSendRequest - buf:%s\n", buf);
icpWrite(fd, buf, len, 30, waisSendComplete, (caddr_t) data);
}
int sock, status;
WAISData *data = NULL;
- debug(0, 3, "waisStart - url:%s, type:%s\n", url, type);
- debug(0, 4, " header: %s\n", mime_hdr);
+ debug(24, 3, "waisStart - url:%s, type:%s\n", url, type);
+ debug(24, 4, " header: %s\n", mime_hdr);
data = (WAISData *) xcalloc(1, sizeof(WAISData));
data->entry = entry;
if (!getWaisRelayHost()) {
- debug(0, 0, "waisStart: Failed because no relay host defined!\n");
+ debug(24, 0, "waisStart: Failed because no relay host defined!\n");
cached_error_entry(entry, ERR_NO_RELAY, NULL);
safe_free(data);
return COMM_ERROR;
/* Create socket. */
sock = comm_open(COMM_NONBLOCKING, 0, 0, url);
if (sock == COMM_ERROR) {
- debug(0, 4, "waisStart: Failed because we're out of sockets.\n");
+ debug(24, 4, "waisStart: Failed because we're out of sockets.\n");
cached_error_entry(entry, ERR_NO_FDS, xstrerror());
safe_free(data);
return COMM_ERROR;
* It should be done before this route is called.
* Otherwise, we cannot check return code for connect. */
if (!ipcache_gethostbyname(data->host)) {
- debug(0, 4, "waisstart: Called without IP entry in ipcache. OR lookup failed.\n");
+ debug(24, 4, "waisstart: Called without IP entry in ipcache. OR lookup failed.\n");
comm_close(sock);
cached_error_entry(entry, ERR_DNS_FAIL, dns_error_message);
safe_free(data);
safe_free(data);
return COMM_ERROR;
} else {
- debug(0, 5, "waisStart - conn %d EINPROGRESS\n", sock);
+ debug(24, 5, "waisStart - conn %d EINPROGRESS\n", sock);
}
}
/* Install connection complete handler. */