Tim Woodall ([EMAIL PROTECTED]) wrote:
>
> Hmmm.... I don't know what I am telling you :-)
>
> All I do know is that it doesn't make sense to me. The
> line src = atm_cells + tmp; doesn't actually do anything useful
> because we immediately set src = atm_cells;
>
> I have absolutely no idea whether the "correct" thing is to
> delete the src = atm_cells + tmp; or to wrap the src = atm_cells;
> in a if(!tmp).
>
>
> Tim.
>
Oh ! What a stupid "bug", not really a bug but... I can explain
you why this bit of code is there (the src = atm_cells + tmp)
Reason :
When we receive data which length is not zero modulo 48, that's
we received garbage either at the beginning or at the end of the
data. I remember, I hesitated to set the default behaviour to
ignore the beginning or the end of the data. So i tested both
solution but as none is really better (because both are valid
or i should say an easy workaround of the problem).
So now the solutions :
/* Skip data at the beginning */
dst = ...;
src = atm_cells;
if(!tmp) {
src += tmp;
length -= tmp;
}
or the other solution
/* Skip data at the end */
dst = ...;
src = atm_cells;
if(!tmp)
length -= tmp;
But i think the first solution is a better one. 1 reason :
- if we skip the end of the data, we surely skip
the aal5 "header" that is at the end. Not a good
solution :\
Do you agree ?
--
Edouard Gomez
Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]?subject=unsubscribe