Merge lp:~widelands-dev/widelands/bug-1704449-net-assert into lp:widelands

Proposed by Notabilis
Status: Merged
Merged at revision: 8403
Proposed branch: lp:~widelands-dev/widelands/bug-1704449-net-assert
Merge into: lp:widelands
Diff against target: 16 lines (+4/-2)
1 file modified
src/network/internet_gaming.cc (+4/-2)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1704449-net-assert
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+327930@code.launchpad.net

Commit message

Removing invalid assert in code for metaserver communication.

Description of the change

Removing an assert which does not always hold. When I am not wrong, the assert can't hold in some situations. This is no bug in the code but just a case of unexpected timing, which makes the assert fail.

See linked bug report for a longer explanation.

To post a comment you must log in.
Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

looks straigt forward,
Ill fetch the compile from appveyor juts to be sure.

BTW, is there some central place whre I can finde those state transitions
indicated by IGPCMD_GAME_OPEN?

Revision history for this message
Notabilis (notabilis27) wrote :

The documentation about the network commands for the metaserver is in src/network/internet_gaming_protocol.h. But I guess it is not quite what you are looking for. Other than that, you can only search for it in src/network/internet_gaming.cc where all the code for communicating with the metaserver is located.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 2463. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/256424684.
Appveyor build 2288. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1704449_net_assert-2288.

Revision history for this message
GunChleoc (gunchleoc) wrote :

LGTM :)

@bunnybot merge

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/network/internet_gaming.cc'
2--- src/network/internet_gaming.cc 2017-07-01 08:22:54 +0000
3+++ src/network/internet_gaming.cc 2017-07-22 17:33:46 +0000
4@@ -598,8 +598,10 @@
5
6 else if (cmd == IGPCMD_GAME_OPEN) {
7 // Client received the acknowledgment, that the game was opened
8- assert(waitcmd_ == IGPCMD_GAME_OPEN);
9- waitcmd_ = "";
10+ // We can't use an assert here since this message might arrive after the game already started
11+ if (waitcmd_ == IGPCMD_GAME_OPEN) {
12+ waitcmd_ = "";
13+ }
14 }
15
16 else if (cmd == IGPCMD_GAME_CONNECT) {

Subscribers

People subscribed via source and target branches

to status/vote changes: