[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/icecream-make-it-cool/services
From: Dirk Mueller <mueller () kde ! org>
Date: 2007-08-21 9:24:15
Message-ID: 1187688255.932911.15906.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 702843 by mueller:
support "quit" on the normal daemon port as well
M +6 -5 comm.cpp
--- branches/work/icecream-make-it-cool/services/comm.cpp #702842:702843
@@ -124,17 +124,18 @@
{
if (protocol == 0)
return false;
- uint32_t remote_prot;
+ uint32_t remote_prot = 0;
unsigned char vers[4];
//readuint32 (remote_prot);
memcpy(vers, inbuf + intogo, 4);
intogo += 4;
- remote_prot = vers[0];
+ for (int i = 0; i < 4; ++i)
+ remote_prot |= vers[i] << (i*8);
if (protocol == -1)
{
/* The first time we read the remote protocol. */
protocol = 0;
- if (remote_prot < MIN_PROTOCOL_VERSION)
+ if (remote_prot < MIN_PROTOCOL_VERSION || remote_prot > (1<<20))
{
remote_prot = 0;
return false;
@@ -143,8 +144,8 @@
if (remote_prot > PROTOCOL_VERSION)
remote_prot = PROTOCOL_VERSION; // ours is smaller
- vers[0] = remote_prot;
- //writeuint32 (remote_prot);
+ for (int i = 0; i < 4; ++i)
+ vers[i] = remote_prot >> (i * 8);
writefull (vers, 4);
if (!flush_writebuf (true))
return false;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic