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.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/x11/ipc/server/ocopserver.cpp b/x11/ipc/server/ocopserver.cpp
index e76657e..421e49c 100644
--- a/x11/ipc/server/ocopserver.cpp
+++ b/x11/ipc/server/ocopserver.cpp
@@ -131,14 +131,12 @@ int OCopServer::accept() {
131 * accept it 131 * accept it
132 * the socket is currently blocking IIRC 132 * the socket is currently blocking IIRC
133 */ 133 */
134 return ::accept( m_serverfd, (struct sockaddr*)&m_address, &m_adrlaenge ); 134 return ::accept( m_serverfd, (struct sockaddr*)&m_address, &m_adrlaenge );
135} 135}
136void OCopServer::newOnClient( int fd ) { 136void OCopServer::newOnClient( int fd ) {
137 int bug[4096];
138 //qWarning("new stuff for client on fd %d", fd );
139 errno = 0; 137 errno = 0;
140 OCOPHead head; 138 OCOPHead head;
141 memset(&head, 0, sizeof(head) ); 139 memset(&head, 0, sizeof(head) );
142 int rea = ::read(fd, &head, sizeof(head) ); 140 int rea = ::read(fd, &head, sizeof(head) );
143 //qWarning("read %d %d", rea, errno); 141 //qWarning("read %d %d", rea, errno);
144 /* 142 /*
@@ -150,13 +148,13 @@ void OCopServer::newOnClient( int fd ) {
150 deregisterClient( fd ); 148 deregisterClient( fd );
151 return; 149 return;
152 } 150 }
153 /* 151 /*
154 * OCOPHead 152 * OCOPHead
155 */ 153 */
156 qWarning("data %s %d", bug, rea ); 154 //qWarning("data %s %d", &bug, rea );
157 155
158 /* 156 /*
159 * Check the magic 157 * Check the magic
160 * if chcked read till EOF if magic does not match 158 * if chcked read till EOF if magic does not match
161 * otherwise do read 159 * otherwise do read
162 * channel 160 * channel
@@ -171,15 +169,17 @@ void OCopServer::newOnClient( int fd ) {
171 QCString func( head.funclen+1 ); 169 QCString func( head.funclen+1 );
172 QByteArray data ( head.datalen ); 170 QByteArray data ( head.datalen );
173 171
174 /* 172 /*
175 * we do not check for errors 173 * we do not check for errors
176 */ 174 */
175 qWarning("read ");
177 int s = read(fd, channel.data(), head.chlen ); 176 int s = read(fd, channel.data(), head.chlen );
178 s = read(fd, func.data(), head.funclen ); 177 s = read(fd, func.data(), head.funclen );
179 s = read(fd, data.data(), head.datalen ); 178 s = read(fd, data.data(), head.datalen );
179 qWarning("read");
180 180
181 /* debug output */ 181 /* debug output */
182 qWarning("channel %s %d", channel.data(), head.chlen ); 182 qWarning("channel %s %d", channel.data(), head.chlen );
183 qWarning("func %s %d", func.data(), head.funclen ); 183 qWarning("func %s %d", func.data(), head.funclen );
184 /* debug end */ 184 /* debug end */
185 185
@@ -282,12 +282,13 @@ void OCopServer::dispatch( const OCOPPacket& packet, int sourceFD ) {
282 case OCOPPacket::Return: 282 case OCOPPacket::Return:
283 break; 283 break;
284 /* not implemented :( */ 284 /* not implemented :( */
285 case OCOPPacket::Signal: 285 case OCOPPacket::Signal:
286 break; 286 break;
287 case OCOPPacket::IsRegistered: 287 case OCOPPacket::IsRegistered:
288 qWarning("IsRegistered");
288 isRegistered( packet.channel(), sourceFD ); 289 isRegistered( packet.channel(), sourceFD );
289 break; 290 break;
290 }; 291 };
291} 292}
292void OCopServer::errorOnServer() { 293void OCopServer::errorOnServer() {
293 /* 294 /*
@@ -337,12 +338,13 @@ void OCopServer::delChannel( const QCString& channel,
337 ints.remove( fd ); 338 ints.remove( fd );
338 m_channels.replace( it.key(), ints ); 339 m_channels.replace( it.key(), ints );
339 } 340 }
340 } 341 }
341} 342}
342void OCopServer::isRegistered( const QCString& channel, int fd) { 343void OCopServer::isRegistered( const QCString& channel, int fd) {
344 qWarning("isRegistered");
343 OCOPHead head; 345 OCOPHead head;
344 QCString func(2); 346 QCString func(2);
345 347
346 memset(&head, 0, sizeof(head ) ); 348 memset(&head, 0, sizeof(head ) );
347 head.magic = 47; 349 head.magic = 47;
348 head.type = OCOPPacket::IsRegistered; 350 head.type = OCOPPacket::IsRegistered;
@@ -366,13 +368,13 @@ void OCopServer::isRegistered( const QCString& channel, int fd) {
366 write(fd, channel.data(), channel.size() ); 368 write(fd, channel.data(), channel.size() );
367 write(fd, func.data(), func.size() ); 369 write(fd, func.data(), func.size() );
368} 370}
369QValueList<int> OCopServer::clients( const QCString& channel ) { 371QValueList<int> OCopServer::clients( const QCString& channel ) {
370 return m_channels[channel]; 372 return m_channels[channel];
371} 373}
372void OCopServer::call( const OCOPPacket& p, int fd ) { 374void OCopServer::call( const OCOPPacket& p, int ) {
373 QValueList<int> cli = clients( p.channel() ); 375 QValueList<int> cli = clients( p.channel() );
374 QValueList<int>::Iterator it; 376 QValueList<int>::Iterator it;
375 377
376 OCOPHead head = p.head(); 378 OCOPHead head = p.head();
377 for (it = cli.begin(); it != cli.end(); ++it ) { 379 for (it = cli.begin(); it != cli.end(); ++it ) {
378 write( (*it), &head, sizeof(head ) ); 380 write( (*it), &head, sizeof(head ) );