diff options
author | deva <deva> | 2005-04-26 10:17:04 +0000 |
---|---|---|
committer | deva <deva> | 2005-04-26 10:17:04 +0000 |
commit | f3833f876d4d7dff6e247123c7e9ad633a625b74 (patch) | |
tree | 4446a9a4e3790162f4345dfb23d7c8e70a972b39 /src/server.cc | |
parent | 617a90f67fe2f768fa0ce7002623e43581865837 (diff) |
*** empty log message ***
Diffstat (limited to 'src/server.cc')
-rw-r--r-- | src/server.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/server.cc b/src/server.cc index 3370586..3bfd1a2 100644 --- a/src/server.cc +++ b/src/server.cc @@ -83,22 +83,26 @@ void newConnection(Socket *socket) Frame *frame; Frame *freeze_frame = NULL; MovEncoder *enc = NULL; + unsigned char dvbuf[DVPACKAGE_SIZE]; - frame = new Frame((unsigned char *)malloc(DVPACKAGE_SIZE), DVPACKAGE_SIZE); + // frame = new Frame((unsigned char *)malloc(DVPACKAGE_SIZE), DVPACKAGE_SIZE); printf("New connection[pid: %d]...\n", getpid()); Network network = Network(socket); - while(int ret = network.recvPackage(&h, frame->data, DVPACKAGE_SIZE)) { + while(int ret = network.recvPackage(&h, dvbuf, DVPACKAGE_SIZE)) { if(ret == -1) { fprintf(stderr, "An error occurred...!\n"); break; } - printf("Read: %d bytes\t", ret); - printf("\ttyp: %d\t", h.header_type); - printf("\tcpr: %s\t", h.header.h_data.cpr); - printf("\tfrz: %d\t", h.header.h_data.freeze); - printf("\tsht: %d\n", h.header.h_data.snapshot); + + frame = new Frame(dvbuf, DVPACKAGE_SIZE); + + printf("Read: %d bytes ", ret); + printf("\ttyp: %d ", h.header_type); + printf("\tcpr: %s ", h.header.h_data.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) { @@ -126,13 +130,10 @@ void newConnection(Socket *socket) } else { delete frame; } - - frame = new Frame((unsigned char *)malloc(DVPACKAGE_SIZE), DVPACKAGE_SIZE); } // TODO: Use save state - delete frame; if(enc) delete enc; printf("Connection end[pid: %d]...\n", getpid()); |