summaryrefslogtreecommitdiff
path: root/src/server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cc')
-rw-r--r--src/server.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/server.cc b/src/server.cc
index a79f463..f13d8df 100644
--- a/src/server.cc
+++ b/src/server.cc
@@ -31,6 +31,10 @@
/*
* $Log$
+ * Revision 1.19 2005/05/22 16:34:44 deva
+ *
+ * Fix: Connection is now taken down when taking a sanpshot without recording.
+ *
* Revision 1.18 2005/05/22 15:49:22 deva
* Added multithreaded encoding support.
*
@@ -334,21 +338,20 @@ void newConnection(Socket *socket)
}
}
- if(h.header.h_data.record) {
- if(!enc) enc = newMovEncoder(cpr);
- enc->encode(frame);
- }
-
if(h.header.h_data.savestate) {
savestate = h.header.h_data.savestate;
}
if(h.header.h_data.freeze) {
if(freeze_frame) delete freeze_frame;
- freeze_frame = frame;
- } else {
- // Never delete the frames here!
- //delete frame;
+ // copy the frame into another temporary one.
+ freeze_frame = new Frame(frame->data, frame->size);
+ }
+
+ // This one must be last!
+ if(h.header.h_data.record) {
+ if(!enc) enc = newMovEncoder(cpr);
+ enc->encode(frame);
}
frame = new Frame(NULL, DVPACKAGE_SIZE);
@@ -356,9 +359,10 @@ void newConnection(Socket *socket)
// TODO: Use save state
+ fprintf(stderr, "Closing connection...\n"); fflush(stderr);
+
if(enc) delete enc;
- fprintf(stderr, "Connection end[pid: %d]...\n", getpid());
- fflush(stderr);
+ fprintf(stderr, "Connection closed [pid: %d]...\n", getpid()); fflush(stderr);
}