/*
- * $Id: HttpMsg.cc,v 1.22 2005/12/29 18:04:41 wessels Exp $
+ * $Id: HttpMsg.cc,v 1.23 2006/01/09 20:38:44 wessels Exp $
*
* DEBUG: section 74 HTTP Message
* AUTHOR: Alex Rousskov
assert(NULL == cache_control);
cache_control = httpHeaderGetCc(&header);
}
+
+/*
+ * useful for debugging
+ */
+void HttpMsg::firstLineBuf(MemBuf& mb)
+{
+ Packer p;
+ packerToMemInit(&p, &mb);
+ packFirstLineInto(&p, true);
+ packerClean(&p);
+}
/*
- * $Id: HttpMsg.h,v 1.5 2005/11/21 23:02:37 wessels Exp $
+ * $Id: HttpMsg.h,v 1.6 2006/01/09 20:38:44 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
virtual void packFirstLineInto(Packer * p, bool full_uri) const = 0;
virtual bool parseFirstLine(const char *blk_start, const char *blk_end) = 0;
virtual void hdrCacheInit();
+
+public:
+
+ void firstLineBuf(MemBuf&);
};
theState = stIeof;
}
+bool ICAPModXact::fillVirginHttpHeader(MemBuf &mb) const
+{
+ if (virgin == NULL)
+ return false;
+
+ if (virgin->data == NULL)
+ return false;
+
+ if (virgin->data->header == NULL)
+ return false;
+
+ virgin->data->header->firstLineBuf(mb);
+
+ return true;
+}
/*
- * $Id: ICAPModXact.h,v 1.4 2005/12/22 23:09:09 wessels Exp $
+ * $Id: ICAPModXact.h,v 1.5 2006/01/09 20:38:44 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
virtual void fillPendingStatus(MemBuf &buf) const;
virtual void fillDoneStatus(MemBuf &buf) const;
+ virtual bool fillVirginHttpHeader(MemBuf&) const;
private:
void packHead(MemBuf &httpBuf, const HttpMsg *head);
writer = &ICAPXaction_noteCommWrote;
comm_old_write_mbuf(connection, &buf, writer, this);
fd_table[connection].noteUse(icapPconnPool);
+ commSetTimeout(connection, 61, &ICAPXaction_noteCommTimedout, this);
}
void ICAPXaction::noteCommWrote(comm_err_t commStatus, size_t size)
void ICAPXaction::handleCommTimedout()
{
+ debugs(93, 0, HERE << "ICAP FD " << connection << " timeout to " << theService->methodStr() << " " << theService->uri.buf());
+ MemBuf mb;
+ mb.init();
+
+ if (fillVirginHttpHeader(mb)) {
+ debugs(93, 0, HERE << "\tfor " << mb.content());
+ }
+
mustStop("connection with ICAP service timed out");
}
*/
comm_read(connection, commBuf, readBuf.spaceSize(), reader, this);
+ commSetTimeout(connection, 61, &ICAPXaction_noteCommTimedout, this);
}
// comm module read a portion of the ICAP response for us
if (stopReason != NULL)
buf.Printf("Stopped");
}
+
+bool ICAPXaction::fillVirginHttpHeader(MemBuf &buf) const
+{
+ return false;
+}
/*
- * $Id: ICAPXaction.h,v 1.5 2005/12/22 23:40:26 wessels Exp $
+ * $Id: ICAPXaction.h,v 1.6 2006/01/09 20:38:44 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
virtual void fillPendingStatus(MemBuf &buf) const;
virtual void fillDoneStatus(MemBuf &buf) const;
+ // useful for debugging
+ virtual bool fillVirginHttpHeader(MemBuf&) const;
+
protected:
int connection; // FD of the ICAP server connection