diff options
author | Othmar Gsenger <otti@anytun.org> | 2008-02-28 21:52:46 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2008-02-28 21:52:46 +0000 |
commit | bf8cc84306f0ddf4b4e9c7edfc7458498be2c49b (patch) | |
tree | 9596f22fd3016c8a6df534ebc5aa532ed564d7e3 | |
parent | new sync protocol (diff) |
sync bugfix
-rw-r--r-- | syncClientSocket.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/syncClientSocket.cpp b/syncClientSocket.cpp index 0159f83..9e6510c 100644 --- a/syncClientSocket.cpp +++ b/syncClientSocket.cpp @@ -56,10 +56,16 @@ void SyncClientSocket::OnRawData(const char *buf,size_t len) } else if(missing_chars>0 && missing_chars<=static_cast<int16_t>(iss_.str().size())) { - boost::archive::text_iarchive ia(iss_); + char * buffer = new char [missing_chars]; + iss_.read(buffer,missing_chars); + std::stringstream tmp; + tmp.write(buffer,missing_chars); + std::cout<<tmp.str()<<std::endl; + boost::archive::text_iarchive ia(tmp); SyncCommand scom(cl_); ia >> scom; missing_chars=-1; + delete buffer; } else break; } |