After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 591481 - New BaseWebServer class with DaapProxyWebServer implementing it
New BaseWebServer class with DaapProxyWebServer implementing it
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: DAAP
git master
Other All
: Normal enhancement
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-08-11 19:27 UTC by Neil Loknath
Modified: 2010-04-12 06:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
New abstract web server class (23.39 KB, patch)
2009-08-11 19:29 UTC, Neil Loknath
none Details | Review
Some changes on Neil's patch (21.32 KB, patch)
2009-08-22 16:57 UTC, Bertrand Lorentz
committed Details | Review

Description Neil Loknath 2009-08-11 19:27:04 UTC
This new abstract class eliminates code duplication and allows the basic, redundant tasks of listening for connections, validating requests, writing responses, etc. to be done in one spot.

I am also using this class in my SoC work for the Telepathy extension.

Patch coming...
Comment 1 Neil Loknath 2009-08-11 19:29:19 UTC
Created attachment 140477 [details] [review]
New abstract web server class
Comment 2 Bertrand Lorentz 2009-08-22 16:57:20 UTC
Created attachment 141432 [details] [review]
Some changes on Neil's patch

A few changes on the patch :
- Rename the class to BaseHttpServer
- Small improvement on the existing code being moved : StringBuidler instead of string concatenation
- Make more properties read-only

I wasn't able to test this properly, because I'm apparently unable set-up DAAP sharing properly on my system. So if someone cold confirm that DAAP still works with this, it'd be nice !


Aaron, Gabriel, any comments on the new class ?
Comment 3 Neil Loknath 2009-08-23 19:05:40 UTC
Bertrand, your updated class is working for me. Tested DAAP and my Telepathy extension.
Comment 4 Gabriel Burt 2009-11-06 04:22:09 UTC
Comment on attachment 141432 [details] [review]
Some changes on Neil's patch

Looks good, sorry it took so long to review.
Comment 5 Gabriel Burt 2009-11-06 04:27:22 UTC
Comment on attachment 141432 [details] [review]
Some changes on Neil's patch

I went ahead and committed it.  Thanks guys!
Comment 6 scnaifeh 2010-03-30 01:17:09 UTC
This change caused a problem for me using the forked-daapd DAAP server.  The check on the length parameter in BaseHttpServer.WriteResponseStream causes Banshee to fail when playing tunes that forked-daapd is set to transcode.  According to the comments in forked-daapd's httpd streaming function, it can only guess the overall length of the stream before transcoding is complete, so it does not send "Content-Length" in the stream header.  This causes the assertion in BaseHttpServer.WriteResponseStream to fail.

I have been able to work around this by commenting out the length parameter check in BaseHttpServer.WriteResponseStream.  So far, this has not caused any adverse side-effects that I am aware of. I am by no means a programmer, however, and I have no idea if this is the right thing to do or if the fix should really happen somewhere else.  I also have not tested with any other DAAP server that does transcoding.
Comment 7 Neil Loknath 2010-04-12 04:40:11 UTC
I assume you're talking about this in BaseHttpServer.WriteResponseStream:
+            if (length < 1) {
+                throw new ArgumentOutOfRangeException ("length", "Must be > 0");
+            }

It's always helpful to submit a patch, if possible. You can read here for more information on that:
http://banshee-project.org/contribute/write-code/
Comment 8 Gabriel Burt 2010-04-12 06:23:25 UTC
Really should submit a new bug report too - that specific check is different enough from that this bug was opened to solve.