Re: [PATCH] SMPP Online time

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Centrium GmbH
Message-ID <[email protected]>
Hi,

have you notice in bb_smscconn.c:bb_smscconn_status(...):
        switch (info.status) {
            case SMSCCONN_ACTIVE:
            case SMSCCONN_ACTIVE_RECV:
                sprintf(tmp3, "online %lds", info.online);
                break;
            case SMSCCONN_DISCONNECTED:

that means online time will be printed _only_ when smsc link is online and 
there no race conditions, because all accesses to online time are protected
with flow_mutex...

anyway, that make no sense to set online time within smpp module to -1.
patch applied, thanks!

On Thursday 11 March 2004 19:08, Nisan Bloch wrote:
> Hi
>
> Ok this is what happens
>
> in smpp_smsc:io_thread(.....
>          smpp->conn->connect_time = -1
>
> then in the smscconn modules
>
> smscconn.c:int smscconn_info
>          infotable->online = time(NULL) - conn->connect_time;
>
> So this is a odd race condition - also none of the other smsc modules
> explicitly set
> conn->connect_time
>
> And finally you will see that the very large online times are actually the
> unixtime stamp of the server that bearerbox is running on.
>
>
> Nisan
>
> At 07:44 PM 2004/03/11, you wrote:
> > > setting smpp->conn->connect_time = -1 in io_thread is a problem as well
> > > - one can then end up with an onlinetime of time() - (-1)
> > > the smscconn functions do this anyway
> >
> >nop, there is no "time() - (-1)" anywhere in the smpp module code, or
> >am I missing something? Please drop me the lines if any.
> >
> >Stipe
> >
> >mailto:[email protected]
> >-------------------------------------------------------------------
> >Wapme Systems AG
> >
> >Münsterstr. 248
> >40470 Düsseldorf, NRW, Germany
> >
> >phone: +49.211.74845.0
> >fax: +49.211.74845.299
> >
> >mailto:[email protected]
> >http://www.wapme-systems.de/
> >-------------------------------------------------------------------
> >
> >-----BEGIN PGP PUBLIC KEY BLOCK-----
> >Version: GnuPG v1.2.2 (Cygwin)
> >
> >mIsEP6mcYwEEAMDnUiUwrbb+xwTFWN6TxF2+XZu7/alwJMeCwMBRvXtPZqfjpPhS
> >OkBpU0F4TrVuugz1HINTSaJTYq10AzDQXp5NkyWgckqW79nPAWuOX0dicbJk+cN2
> >nM2TI4KaxUDe6u8hghNEnH/i2lXsUu9apnP/iixzV81VC2je3uc9hZpnAAYptEVT
> >dGlwZSBUb2xqIChUZWNobm9sb2d5IENlbnRlciAmIFJlc2VhcmNoIExhYikgPHRv
> >bGpAd2FwbWUtc3lzdGVtcy5kZT6ItAQTAQIAHgUCP6mcYwIbAwYLCQgHAwIDFQID
> >AxYCAQIeAQIXgAAKCRABV0w1BqPYRuSqA/wPzsQxao2YePENCtgRTrO86U6zg3sl
> >OcS6CJFI4FZP5h/xD3GRsNH1+MPSvZlomDdpFnr547DGz/Kq9MXuQwVvlVig5yWZ
> >K5dtKp1r5YLhxJQBhfirZbRFFnYmf19f18J8OoS28tuFVftDl1AIwJS3HLyBTv6H
> >g2HyLAEKQIp30Q==
> >=aYCI
> >-----END PGP PUBLIC KEY BLOCK-----

-- 
Best regards / Mit besten Grüßen aus Düsseldorf

Dipl.-Ing.
Alexander Malysh
___________________________________________

Centrium GmbH
Vogelsanger Weg 80
40470 Düsseldorf

Fon: +49 (0211) 74 84 51 80
Fax: +49 (0211) 277 49 109

email: [email protected]
web: www.centrium.de
msn: [email protected]
icq: 98063111
___________________________________________

Please avoid sending me Word, Excel or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.