[jitsi-dev] Re: [ice4j] r287 committed - Handle correctly TCP framing header for both local and relayed TCP soc...


#1

+++ /trunk/src/org/ice4j/socket/TCPOutputStream.java Thu Oct 13 04:36:57
+ public void close()
+ throws IOException
+ {
+ }
+ public void flush()
+ throws IOException
+ {
+ }

Shouldn't these be forwarded to the underlying stream?

+++ /trunk/src/org/ice4j/socket/DelegatingSocket.java Thu Oct 13
+ short desiredLength = (short)
+ (((inputStream.read() << 8) & 0xff) | (inputStream.read() &
0xff));

This calculation is wrong. The first byte is first shifted, and then the shifted part is stripped off again. Furthermore, a short is too small to take an _unsigned_ 16bit integer.
->
int desiredLength = (int)(((inputStream.read() & 0xff) << 8) | (inputStream.read() & 0xff));

Ingo


#2

Hi Ingo,

Thanks for reviews.

Le 13/10/11 14:06, Bauersachs Ingo a �crit :

+++ /trunk/src/org/ice4j/socket/TCPOutputStream.java Thu Oct 13 04:36:57
+ public void close()
+ throws IOException
+ {
+ }
+ public void flush()
+ throws IOException
+ {
+ }

Shouldn't these be forwarded to the underlying stream?

Yes.

+++ /trunk/src/org/ice4j/socket/DelegatingSocket.java Thu Oct 13
+ short desiredLength = (short)
+ (((inputStream.read()<< 8)& 0xff) | (inputStream.read()&
0xff));

This calculation is wrong. The first byte is first shifted, and then the shifted part is stripped off again. Furthermore, a short is too small to take an _unsigned_ 16bit integer.
->
int desiredLength = (int)(((inputStream.read()& 0xff)<< 8) | (inputStream.read()& 0xff));

Yes of course. Thanks again. I will fix all of these things.

Regards,

···

--
Seb

Ingo


#3

Hi Ingo,

This has been fixed in ice4j SVN revision 288.

Thanks again.

Regards,

···

--
Seb

Le 13/10/11 14:22, Sebastien Vincent a �crit :

Hi Ingo,

Thanks for reviews.

Le 13/10/11 14:06, Bauersachs Ingo a �crit :

+++ /trunk/src/org/ice4j/socket/TCPOutputStream.java Thu Oct 13 04:36:57
+ public void close()
+ throws IOException
+ {
+ }
+ public void flush()
+ throws IOException
+ {
+ }

Shouldn't these be forwarded to the underlying stream?

Yes.

+++ /trunk/src/org/ice4j/socket/DelegatingSocket.java Thu Oct 13
+ short desiredLength = (short)
+ (((inputStream.read()<< 8)& 0xff) | (inputStream.read()&
0xff));

This calculation is wrong. The first byte is first shifted, and then the shifted part is stripped off again. Furthermore, a short is too small to take an _unsigned_ 16bit integer.
->
int desiredLength = (int)(((inputStream.read()& 0xff)<< 8) | (inputStream.read()& 0xff));

Yes of course. Thanks again. I will fix all of these things.

Regards,
--
Seb

Ingo