@@ -81,8 +81,8 @@ ServerWorker::~ServerWorker()
8181 // We still want to remove this source so that the stream does not get stuck
8282 // if other senders are still active / resp. the window gets closed if no
8383 // more senders contribute to it.
84- if ( !_streamUri .isEmpty ( ))
85- emit removeStreamSource ( _streamUri , _sourceId );
84+ if ( !_streamId .isEmpty ( ))
85+ emit removeStreamSource ( _streamId , _sourceId );
8686
8787 if ( _tcpSocket->state () == QAbstractSocket::ConnectedState )
8888 _sendQuit ();
@@ -103,7 +103,7 @@ void ServerWorker::initConnection()
103103
104104void ServerWorker::closeConnection ( const QString uri )
105105{
106- if ( uri != _streamUri )
106+ if ( uri != _streamId )
107107 return ;
108108
109109 Event closeEvent;
@@ -116,7 +116,7 @@ void ServerWorker::closeConnection( const QString uri )
116116void ServerWorker::replyToEventRegistration ( const QString uri,
117117 const bool success )
118118{
119- if ( uri != _streamUri )
119+ if ( uri != _streamId )
120120 return ;
121121
122122 _registeredToEvents = success;
@@ -196,39 +196,38 @@ void ServerWorker::_handleMessage( const MessageHeader& messageHeader,
196196 const QString uri ( messageHeader.uri );
197197 if ( uri.isEmpty ( ))
198198 {
199- std::cerr << " Warning: rejecting streamer with empty uri"
200- << std::endl;
201- closeConnection ( _streamUri );
199+ std::cerr << " Warning: rejecting streamer with empty id" << std::endl;
200+ closeConnection ( _streamId );
202201 return ;
203202 }
204- if ( uri != _streamUri &&
203+ if ( uri != _streamId &&
205204 messageHeader.type != MESSAGE_TYPE_PIXELSTREAM_OPEN )
206205 {
207- std::cerr << " Warning: ingnoring message with incorrect stream uri : '"
206+ std::cerr << " Warning: ingnoring message with incorrect stream id : '"
208207 << messageHeader.uri << " ', expected: '"
209- << _streamUri .toStdString () << " '" << std::endl;
208+ << _streamId .toStdString () << " '" << std::endl;
210209 return ;
211210 }
212211
213212 switch ( messageHeader.type )
214213 {
215214 case MESSAGE_TYPE_QUIT:
216- emit removeStreamSource ( _streamUri , _sourceId );
217- _streamUri = QString ();
215+ emit removeStreamSource ( _streamId , _sourceId );
216+ _streamId = QString ();
218217 break ;
219218
220219 case MESSAGE_TYPE_PIXELSTREAM_OPEN:
221- if ( !_streamUri .isEmpty ( ))
220+ if ( !_streamId .isEmpty ( ))
222221 {
223222 std::cerr << " Warning: PixelStream already opened!" << std::endl;
224223 return ;
225224 }
226- _streamUri = uri;
227- emit addStreamSource ( _streamUri , _sourceId );
225+ _streamId = uri;
226+ emit addStreamSource ( _streamId , _sourceId );
228227 break ;
229228
230229 case MESSAGE_TYPE_PIXELSTREAM_FINISH_FRAME:
231- emit receivedFrameFinished ( _streamUri , _sourceId );
230+ emit receivedFrameFinished ( _streamId , _sourceId );
232231 break ;
233232
234233 case MESSAGE_TYPE_PIXELSTREAM:
@@ -239,7 +238,7 @@ void ServerWorker::_handleMessage( const MessageHeader& messageHeader,
239238 {
240239 const SizeHints* hints =
241240 reinterpret_cast < const SizeHints* >( byteArray.data ( ));
242- emit receivedSizeHints ( _streamUri , SizeHints ( *hints ));
241+ emit receivedSizeHints ( _streamId , SizeHints ( *hints ));
243242 break ;
244243 }
245244
@@ -251,7 +250,7 @@ void ServerWorker::_handleMessage( const MessageHeader& messageHeader,
251250 {
252251 const bool exclusive =
253252 (messageHeader.type == MESSAGE_TYPE_BIND_EVENTS_EX);
254- emit registerToEvents ( _streamUri , exclusive, this );
253+ emit registerToEvents ( _streamId , exclusive, this );
255254 }
256255 break ;
257256
@@ -272,7 +271,7 @@ void ServerWorker::_handlePixelStreamMessage( const QByteArray& byteArray )
272271 byteArray.right ( byteArray.size () - sizeof ( SegmentParameters ));
273272 segment.imageData = imageData;
274273
275- emit ( receivedSegment ( _streamUri , _sourceId, segment ));
274+ emit ( receivedSegment ( _streamId , _sourceId, segment ));
276275}
277276
278277void ServerWorker::_sendProtocolVersion ()
0 commit comments