> -----Original Message-----
> From: Vibhu Mohindra [mailto:[EMAIL PROTECTED]]

> > Also - I don't think that this patch is correct - it will 
> only make the
> > receiver thread not being able to change the status of the 
> connection if
> > a transmitter exist. maybe a better approach would be to 
> have two status
> > variables ?
> 
> I don't understand. Do you mean that in certain situations we 
> may not have
> a transmitter thread at all?

Yes, but that is not my point.

> If so, then note that the status 
> will never
> become SMSCCONN_ACTIVE - it can only rise up to 
> SMSCCONN_ACTIVE_RECV. This
> is not right, I'm sure.

It's ok if you don't have a transmitter thread.

> The earlier objection was regarding the status administrative info
> generated by Kannel. I agree with that - if the receiver 
> doesn't indicate
> that it is down, the status page will not show any problems. 
> If you could
> help me to understand how else this patch could fail, I'd 
> appreciate it.

Yep - that's my problem. how about the following complicated logic:
whenever the receiver thread wants to change the status, it will check
if it has a transmitter thread attached, and if so will do the
following:
if (its_safe_to_change_status()) {
        if (new_status = SMSCCONN_ACTIVE_RECV) 
                status = privdata->current_state
        else {
                privdata->current_state = status;
                status = new_status;
                privdata->new_status = new_status;
        }
} else {
        deinit_privdata_status_variables();
}

its_safe_to_change_status() {
        if ( ! privdata_status_variables_have_been_inited)
                return false;
        if (privdata->new_status == status)
                return true;
        return false;
}

a bit complicated, but I think it'll be safe enough - the point of the
excersize is to allow the receiver thread to change the status while
giving precedense to the status set by the transmitter, and instead of
setting SMSCCONN_ACTIVE_RECV, restore the status set by the transmitter.

Comments please ?

--
Oded Arbel
m-Wise mobile solutions
[EMAIL PROTECTED]

+972-9-9581711 (116)
+972-67-340014

::..
"...all life is only a set of pictures in the brain, among which there
is no 
difference between those born of real things and those born of inward
dreamings, 
and no cause to value the one above the other." 
        -- HPL, from The Silver Key 

Reply via email to