summaryrefslogtreecommitdiff
path: root/x11/ipc/server/ocopserver.cpp
Unidiff
Diffstat (limited to 'x11/ipc/server/ocopserver.cpp') (more/less context) (show whitespace changes)
-rw-r--r--x11/ipc/server/ocopserver.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/x11/ipc/server/ocopserver.cpp b/x11/ipc/server/ocopserver.cpp
index 3df574b..e76657e 100644
--- a/x11/ipc/server/ocopserver.cpp
+++ b/x11/ipc/server/ocopserver.cpp
@@ -331,53 +331,54 @@ void OCopServer::delChannel( const QCString& channel,
331 331
332 QValueList<int> ints = it.data(); 332 QValueList<int> ints = it.data();
333 if ( ints.count() == 1 ) 333 if ( ints.count() == 1 )
334 m_channels.remove( it ); 334 m_channels.remove( it );
335 else{ 335 else{
336 QValueList<int> ints = it.data(); 336 QValueList<int> ints = it.data();
337 ints.remove( fd ); 337 ints.remove( fd );
338 m_channels.replace( it.key(), ints ); 338 m_channels.replace( it.key(), ints );
339 } 339 }
340 } 340 }
341} 341}
342void OCopServer::isRegistered( const QCString& channel, int fd) { 342void OCopServer::isRegistered( const QCString& channel, int fd) {
343 OCOPHead head; 343 OCOPHead head;
344 QCString func(2); 344 QCString func(2);
345 345
346 memset(&head, 0, sizeof(head ) ); 346 memset(&head, 0, sizeof(head ) );
347 head.magic = 47; 347 head.magic = 47;
348 head.type = OCOPPacket::IsRegistered; 348 head.type = OCOPPacket::IsRegistered;
349 head.chlen = channel.size(); 349 head.chlen = channel.size();
350 head.funclen = func.size(); 350 head.funclen = func.size();
351 head.datalen = 0; 351 head.datalen = 0;
352 352
353 if ( isChannelRegistered( channel ) ) { 353 if ( isChannelRegistered( channel ) ) {
354 //is registered 354 //is registered
355 func[0] = 1; 355 func[0] = 1;
356 }else{ 356 }else{
357 func[0] = 0; 357 func[0] = 0;
358 } 358 }
359 359
360 /** 360 /**
361 * write the head 361 * write the head
362 * and then channel 362 * and then channel
363 * success/failure inside func 363 * success/failure inside func
364 */ 364 */
365 write(fd, &head, sizeof(head) ); 365 write(fd, &head, sizeof(head) );
366 write(fd, channel.data(), channel.size() ); 366 write(fd, channel.data(), channel.size() );
367 write(fd, func.data(), func.size() ); 367 write(fd, func.data(), func.size() );
368} 368}
369QValueList<int> OCopServer::clients( const QCString& channel ) { 369QValueList<int> OCopServer::clients( const QCString& channel ) {
370 return m_channels[channel]; 370 return m_channels[channel];
371} 371}
372void OCopServer::call( const OCOPPacket& p, int fd ) { 372void OCopServer::call( const OCOPPacket& p, int fd ) {
373 QValueList<int> cli = clients( p.channel() ); 373 QValueList<int> cli = clients( p.channel() );
374 QValueList<int>::Iterator it; 374 QValueList<int>::Iterator it;
375 375
376 OCOPHead head = p.head(); 376 OCOPHead head = p.head();
377 for (it = cli.begin(); it != cli.end(); ++it ) { 377 for (it = cli.begin(); it != cli.end(); ++it ) {
378 write( (*it), &head, sizeof(head ) ); 378 write( (*it), &head, sizeof(head ) );
379 /* expl. shared! */
379 write( (*it), p.channel().data(), p.channel().size() ); 380 write( (*it), p.channel().data(), p.channel().size() );
380 write( (*it), p.header().data(), p.header().size() ); 381 write( (*it), p.header().data(), p.header().size() );
381 write( (*it), p.content().data(), p.content().size() ); 382 write( (*it), p.content().data(), p.content().size() );
382 }; 383 };
383} 384}