diff options
Diffstat (limited to 'src/server.cc')
-rw-r--r-- | src/server.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/server.cc b/src/server.cc index 27b6848..c8a359e 100644 --- a/src/server.cc +++ b/src/server.cc @@ -26,6 +26,10 @@ */ /* * $Log$ + * Revision 1.10 2005/05/02 19:47:43 deva + * Fixed overlapping cpr numbers on the server (now it saves one cpr pr. + * connection, and ignores any changes sent) + * * Revision 1.9 2005/05/02 18:46:15 deva * Files are now saved in a custom folder (defined in miav.conf) * @@ -246,6 +250,8 @@ MovEncoder *newMovEncoder(char* cpr) void newConnection(Socket *socket) { + char cpr[256]; + bool hasCpr = false; ServerStatus status; n_savestate savestate = LATER; @@ -267,25 +273,30 @@ void newConnection(Socket *socket) break; } + if(!hasCpr) { + sprintf(cpr, h.header.h_data.cpr); + hasCpr = true; + } + printf("Read: %d bytes ", ret); printf("\ttyp: %d ", h.header_type); - printf("\tcpr: %s ", h.header.h_data.cpr); + printf("\tcpr: %s ", cpr); printf("\tfrz: %d ", h.header.h_data.freeze); printf("\tsht: %d ", h.header.h_data.snapshot); printf("\tsave: %d\n", h.header.h_data.savestate); if(h.header.h_data.snapshot) { if(freeze_frame) { - saveFrameAsImage(h.header.h_data.cpr, freeze_frame); + saveFrameAsImage(cpr, freeze_frame); delete freeze_frame; freeze_frame = NULL; } else { - saveFrameAsImage(h.header.h_data.cpr, frame); + saveFrameAsImage(cpr, frame); } } if(h.header.h_data.record) { - if(!enc) enc = newMovEncoder(h.header.h_data.cpr); + if(!enc) enc = newMovEncoder(cpr); enc->encode(frame); } |