Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Patching streamdev for 1.3.8



Gerald.Raaf@allrun.de(Gerald Raaf)  10.01.05 15:08


>Am Montag, 10. Januar 2005 14:53 schrieb C.Y.M:
>> Hi,
>>
>> I am a bit confused how this section of the code "client/socket.c"
>> gets patched to compenstate for vdr-1.3.18.  For example, here is a
>> snip of the code of socket.c:
>>
>> ---SNIP---
>>
>> st = time_ms();
>>          if (!TimedWrite((const char*)pkt, pkt.Length(), TimeoutMs))
>>                  { esyslog("Streamdev: Lost connection to %s:%d:
>>                                  %s", (const char*)RemoteIp(),
>>                  RemotePort(),
>> strerror(errno)); Close();
>>                  return false;
>>          }
>>
>>          if (Expected != 0) {
>>                  TimeoutMs -= time_ms() - st;
>>                  return Expect(Expected, NULL, TimeoutMs);
>>          }
>>
>> ---SNIP---
>>
>> assuming we change the first line (st = time_ms();) to this:
>>
>> cTimeMs st;
>> st.Set();
>>
>> What would the next changed line translate to?
>>
>> TimeoutMs -= time_ms() - st;
>>
>> I am confused about how to fix this line because it appears to be a
>> combination of cTimeMs and integer values.

>try it this way

>TimeoutMs -= time_ms() - st; -> TimeoutMs -= int(cTimeMS::Now()) - st;

Emm, as cTimeMS::Now returns an uint64, it will be clearer 
not to cast but to declare TimeoutMS as uint64 too.
I know there is some time upto 2038-01-19, when UNIX signed 32bit timer 
rolls over, but soooooo far isn't it anymore that it should be ignored, 
and it will be far harder to fix than that joke "Y2K".



Rainer





Home | Main Index | Thread Index