diff options
Diffstat (limited to 'lib/server/Protocol.cpp')
-rw-r--r-- | lib/server/Protocol.cpp | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/lib/server/Protocol.cpp b/lib/server/Protocol.cpp index 6333b1db..382f1c37 100644 --- a/lib/server/Protocol.cpp +++ b/lib/server/Protocol.cpp @@ -11,14 +11,9 @@ #include <sys/types.h> -<<<<<<< HEAD -#include <stdlib.h> -#include <string.h> -======= #include <cstdlib> #include <cstring> #include <cstdio> ->>>>>>> 0.12 #include <new> @@ -50,19 +45,6 @@ // // -------------------------------------------------------------------------- Protocol::Protocol(IOStream &rStream) -<<<<<<< HEAD - : mrStream(rStream), - mHandshakeDone(false), - mMaxObjectSize(PROTOCOL_DEFAULT_MAXOBJSIZE), - mTimeout(PROTOCOL_DEFAULT_TIMEOUT), - mpBuffer(0), - mBufferSize(0), - mReadOffset(-1), - mWriteOffset(-1), - mValidDataSize(-1), - mLastErrorType(NoError), - mLastErrorSubType(NoError) -======= : mrStream(rStream), mHandshakeDone(false), mMaxObjectSize(PROTOCOL_DEFAULT_MAXOBJSIZE), @@ -74,7 +56,6 @@ Protocol::Protocol(IOStream &rStream) mValidDataSize(-1), mLogToSysLog(false), mLogToFile(NULL) ->>>>>>> 0.12 { BOX_TRACE("Send block allocation size is " << PROTOCOL_ALLOCATE_SEND_BLOCK_CHUNK); @@ -102,37 +83,6 @@ Protocol::~Protocol() // -------------------------------------------------------------------------- // // Function -<<<<<<< HEAD -// Name: Protocol::GetLastError(int &, int &) -// Purpose: Returns true if there was an error, and type and subtype if there was. -// Created: 2003/08/19 -// -// -------------------------------------------------------------------------- -bool Protocol::GetLastError(int &rTypeOut, int &rSubTypeOut) -{ - if(mLastErrorType == NoError) - { - // no error. - return false; - } - - // Return type and subtype in args - rTypeOut = mLastErrorType; - rSubTypeOut = mLastErrorSubType; - - // and unset them - mLastErrorType = NoError; - mLastErrorSubType = NoError; - - return true; -} - - -// -------------------------------------------------------------------------- -// -// Function -======= ->>>>>>> 0.12 // Name: Protocol::Handshake() // Purpose: Handshake with peer (exchange ident strings) // Created: 2003/08/20 @@ -150,11 +100,7 @@ void Protocol::Handshake() PW_Handshake hsSend; ::memset(&hsSend, 0, sizeof(hsSend)); // Copy in ident string -<<<<<<< HEAD - ::strncpy(hsSend.mIdent, GetIdentString(), sizeof(hsSend.mIdent)); -======= ::strncpy(hsSend.mIdent, GetProtocolIdentString(), sizeof(hsSend.mIdent)); ->>>>>>> 0.12 // Send it mrStream.Write(&hsSend, sizeof(hsSend)); @@ -227,11 +173,7 @@ void Protocol::CheckAndReadHdr(void *hdr) // Created: 2003/08/19 // // -------------------------------------------------------------------------- -<<<<<<< HEAD -std::auto_ptr<ProtocolObject> Protocol::Receive() -======= std::auto_ptr<Message> Protocol::ReceiveInternal() ->>>>>>> 0.12 { // Get object header PW_ObjectHeader objHeader; @@ -251,11 +193,7 @@ std::auto_ptr<Message> Protocol::ReceiveInternal() } // Create a blank object -<<<<<<< HEAD - std::auto_ptr<ProtocolObject> obj(MakeProtocolObject(ntohl(objHeader.mObjType))); -======= std::auto_ptr<Message> obj(MakeMessage(ntohl(objHeader.mObjType))); ->>>>>>> 0.12 // Make sure memory is allocated to read it into EnsureBufferAllocated(objSize); @@ -307,11 +245,7 @@ std::auto_ptr<Message> Protocol::ReceiveInternal() // Created: 2003/08/19 // // -------------------------------------------------------------------------- -<<<<<<< HEAD -void Protocol::Send(const ProtocolObject &rObject) -======= void Protocol::SendInternal(const Message &rObject) ->>>>>>> 0.12 { // Check usage if(mValidDataSize != -1 || mWriteOffset != -1 || mReadOffset != -1) @@ -754,8 +688,6 @@ void Protocol::SendStream(IOStream &rStream) // Can't send this using the fixed size header uncertainSize = true; } -<<<<<<< HEAD -======= if(streamSize == 0) { @@ -767,7 +699,6 @@ void Protocol::SendStream(IOStream &rStream) "Sending a stream with a definite size of zero " "is not allowed in the protocol"); } ->>>>>>> 0.12 // Inform sub class InformStreamSending(streamSize); @@ -907,9 +838,6 @@ int Protocol::SendStreamSendBlock(uint8_t *Block, int BytesInBlock) // -------------------------------------------------------------------------- void Protocol::InformStreamReceiving(u_int32_t Size) { -<<<<<<< HEAD - // Do nothing -======= if(GetLogToSysLog()) { if(Size == Protocol::ProtocolStream_SizeUncertain) @@ -930,7 +858,6 @@ void Protocol::InformStreamReceiving(u_int32_t Size) : "Receiving stream, size %d\n", Size); ::fflush(GetLogToFile()); } ->>>>>>> 0.12 } // -------------------------------------------------------------------------- @@ -943,9 +870,6 @@ void Protocol::InformStreamReceiving(u_int32_t Size) // -------------------------------------------------------------------------- void Protocol::InformStreamSending(u_int32_t Size) { -<<<<<<< HEAD - // Do nothing -======= if(GetLogToSysLog()) { if(Size == Protocol::ProtocolStream_SizeUncertain) @@ -966,7 +890,6 @@ void Protocol::InformStreamSending(u_int32_t Size) : "Sending stream, size %d\n", Size); ::fflush(GetLogToFile()); } ->>>>>>> 0.12 } |