|
|
@ -311,7 +311,8 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void BeginMessage(const char* pszCommand) |
|
|
|
// TODO: Document the postcondition of this function. Is cs_vSend locked?
|
|
|
|
|
|
|
|
void BeginMessage(const char* pszCommand) EXCLUSIVE_LOCK_FUNCTION(cs_vSend) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ENTER_CRITICAL_SECTION(cs_vSend); |
|
|
|
ENTER_CRITICAL_SECTION(cs_vSend); |
|
|
|
if (nHeaderStart != -1) |
|
|
|
if (nHeaderStart != -1) |
|
|
@ -323,7 +324,8 @@ public: |
|
|
|
printf("sending: %s ", pszCommand); |
|
|
|
printf("sending: %s ", pszCommand); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void AbortMessage() |
|
|
|
// TODO: Document the precondition of this function. Is cs_vSend locked?
|
|
|
|
|
|
|
|
void AbortMessage() UNLOCK_FUNCTION(cs_vSend) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (nHeaderStart < 0) |
|
|
|
if (nHeaderStart < 0) |
|
|
|
return; |
|
|
|
return; |
|
|
@ -336,7 +338,8 @@ public: |
|
|
|
printf("(aborted)\n"); |
|
|
|
printf("(aborted)\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void EndMessage() |
|
|
|
// TODO: Document the precondition of this function. Is cs_vSend locked?
|
|
|
|
|
|
|
|
void EndMessage() UNLOCK_FUNCTION(cs_vSend) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0) |
|
|
|
if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -368,19 +371,6 @@ public: |
|
|
|
LEAVE_CRITICAL_SECTION(cs_vSend); |
|
|
|
LEAVE_CRITICAL_SECTION(cs_vSend); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void EndMessageAbortIfEmpty() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (nHeaderStart < 0) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
int nSize = vSend.size() - nMessageStart; |
|
|
|
|
|
|
|
if (nSize > 0) |
|
|
|
|
|
|
|
EndMessage(); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
AbortMessage(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PushVersion(); |
|
|
|
void PushVersion(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|