ServerStateData::~ServerStateData()
{
+ // paranoid: check that swanSong has been called
+ assert(!requestBodySource);
+#if USE_ADAPTATION
+ assert(!virginBodyDestination);
+ assert(!adaptedBodySource);
+#endif
+
entry->unlock();
HTTPMSGUNLOCK(request);
fwd = NULL; // refcounted
+ if (responseBodyBuffer != NULL) {
+ delete responseBodyBuffer;
+ responseBodyBuffer = NULL;
+ }
+}
+
+void
+ServerStateData::swanSong()
+{
+ // get rid of our piping obligations
if (requestBodySource != NULL)
requestBodySource->clearConsumer();
cleanAdaptation();
#endif
- if (responseBodyBuffer != NULL) {
- delete responseBodyBuffer;
- responseBodyBuffer = NULL;
- }
+ BodyConsumer::swanSong();
+#if USE_ADAPTATION
+ Initiator::swanSong();
+ BodyProducer::swanSong();
+#endif
}
+
HttpReply *
ServerStateData::virginReply() {
assert(theVirginReply);
virtual void processReplyBody() = 0;
//AsyncJob virtual methods
+ virtual void swanSong();
virtual bool doneAll() const { return
#if USE_ADAPTATION
Adaptation::Initiator::doneAll() &&