PDA

View Full Version : how to submit a patch to slimproto library?



mbennett
2010-12-27, 09:55
hi -- I've recently discovered the joys of squeezeboxen and believe I found a bug in the SlimProtoLib code (used in, at least, softsqueeze and squeezeslave) which might result in loss of synchronization over TCP; it's a small patch, but I'm unclear where to submit this or who to contact. Any pointers would be appreciated.

thanks!
-mike bennett

bpa
2010-12-27, 10:40
If you have a patch for SoftSqueeze 3.9b1 - I'll look at it. Please attach patch file on this thread.

Ralphy has Softsqueeze 3.8 on sourceforge and he also looks after Squeezeslave which has its own thread - http://forums.slimdevices.com/showthread.php?t=83362

mbennett
2010-12-27, 11:07
Thanks! Here's the README; please let me know if I should rework this.
-mike
====
This a patch to slimproto (SlimProtoLib) to deal with SOCK_STREAM
sends correctly when partial writes occur.

Justification: when dealing with SOCK_DGRAM (UDP) sockets, send()s
are all-or-nothing; slimproto.c seems to expect this behavior from
the socket, but SOCK_STREAM (TCP) sockets can accept partial writes
in the socket buffer, requiring the application resend the unqueued
portion of the message.

The potential impact of a partially written message assumed to
have been fully written is that the receiver will see a malformed
message stream, resulting in loss of message synchronization on the
socket, which would require closing of the connection. This would
most likely occur during network congestion or overload.

This patch provides this send-a-full-message functionality behind a
new 'send_message' routine which perform sends() operations until
the entire message has been accepted by the socket.

- mike bennett 27dec10 (mbennett in the slimdevices forum)

ralphy
2010-12-28, 07:50
Thanks for the patch Mike.

No need to rework it.

I've tested the change on linux, osx and windows with no initial adverse affects.
As it's not the sort of change that will initially cause issues I'll continue testing in the coming weeks.

I've commited the patch for squeezeslave at r225 on googlecode (http://code.google.com/p/squeezeslave/source/list) so others can test as well.

mbennett
2010-12-28, 08:23
Thanks, ralphy, for committing the patch. I'll be very interested to see if this has any impact on synchronization issues from others' testing.

-mike

ralphy
2010-12-28, 09:00
You're welcome.

I'm always happy when others take interest in making squeezeslave better for everyone. Thank you.

r218 contains an additional slimprotocol fix at the http layer for better sync support.
Prior to this change SS ignored the different autostart values causing sync mode(s) to usually be out of sync more than it could have been.
Hopefully this helps as well.