summaryrefslogtreecommitdiff
path: root/src/server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cc')
-rw-r--r--src/server.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/server.cc b/src/server.cc
index 4d556fc..29571d6 100644
--- a/src/server.cc
+++ b/src/server.cc
@@ -120,11 +120,13 @@ void newConnection(Socket *socket, Info *info)
info->info("Closing connection...");
- // Send end of stream frame.
- frame->endOfFrameStream = true;
- enc->encode(frame);
-
- if(enc) delete enc;
+ // No encoder exists, if this is a pure snapshot (image) connection.
+ if(enc) {
+ // Send end of stream frame.
+ frame->endOfFrameStream = true;
+ enc->encode(frame);
+ delete enc;
+ }
info->info("CONNECTION CLOSED");
}