Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
8d596619
Commit
8d596619
authored
Jan 26, 2013
by
Max-Wilhelm Bruker
Browse files
server deadlock fix
parent
14287e54
Changes
1
Hide whitespace changes
Inline
Side-by-side
servatrice/src/serversocketinterface.cpp
View file @
8d596619
...
...
@@ -189,7 +189,8 @@ void ServerSocketInterface::flushOutputQueue()
int
totalBytes
=
0
;
while
(
!
outputQueue
.
isEmpty
())
{
const
ServerMessage
&
item
=
outputQueue
.
first
();
ServerMessage
item
=
outputQueue
.
takeFirst
();
locker
.
unlock
();
QByteArray
buf
;
unsigned
int
size
=
item
.
ByteSize
();
...
...
@@ -199,10 +200,11 @@ void ServerSocketInterface::flushOutputQueue()
buf
.
data
()[
2
]
=
(
unsigned
char
)
(
size
>>
8
);
buf
.
data
()[
1
]
=
(
unsigned
char
)
(
size
>>
16
);
buf
.
data
()[
0
]
=
(
unsigned
char
)
(
size
>>
24
);
// In case socket->write() calls catchSocketError(), the mutex must not be locked during this call.
socket
->
write
(
buf
);
totalBytes
+=
size
+
4
;
outputQueue
.
removeFirst
();
locker
.
relock
();
}
servatrice
->
incTxBytes
(
totalBytes
);
socket
->
flush
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment