Hello all, Recently I have started writing some small package apps. The main app I''m working on at the moment is Camping/Photos[1]. Here I use a controller to serve static files (Theme[3]) that I have copied from [2]. There seems a problem however, when using this via lighttpd. All files that get served (via photos-dispatch.rb) get an extra ''\r\n'' in front. This means that PNG and JPEG files break. I tried serving an empty file (0B) and got served a file of 2 bytes containing ''\r\n''. Since I use the X-Sendfile header I kind of assumed it is in the hands of lighttp. However, I have had this working and the only things I have changed are in the app and not in lighttpd, maybe there are some subtleties I am missing. Can anyone help me finding the bug? Kind regards, Paul 1: https://trac.luon.net/camping-photos/ 2: http://code.whytheluckystiff.net/camping/wiki/ServingStaticFiles 3: https://trac.luon.net/camping-photos/file/trunk/photos/controllers.rb -- Student @ Eindhoven | email: paul at luon.net University of Technology, The Netherlands | JID: paul at luon.net>>> Using the Power of Debian GNU/Linux <<< | GnuPG key ID: 0x50064181
I think this problem was solved just after Camping 1.5 was released. Please try the following: gem install camping --source code.whytheluckystiff.net and see if that fixes it. Manfred
On Sat, Nov 25, 2006 at 02:01:55PM +0100, Manfred Stienstra wrote:> I think this problem was solved just after Camping 1.5 was released. > Please try the following: > > gem install camping --source code.whytheluckystiff.netYes, I was running 1.5. This seems to have been fixed in 171. I still think it''s strange since the body should be discarded when an X-Sendfile header is present.. somehow the newline survived? Thanks! Paul -- Student @ Eindhoven | email: paul at luon.net University of Technology, The Netherlands | JID: paul at luon.net>>> Using the Power of Debian GNU/Linux <<< | GnuPG key ID: 0x50064181
On Sat, Nov 25, 2006 at 02:01:55PM +0100, Manfred Stienstra wrote:> I think this problem was solved just after Camping 1.5 was released.That''s true, this little problem bothered me a lot and maybe it''s time for 1.6. Our milestones: are loading apps straight from a Gem and daemon mode[1]. Anything else? _why [1] http://code.whytheluckystiff.net/camping/roadmap
I''d like to see the logic in the camping server wrapped into a class. This would allow other uses. Right now, there is no easy way to pass in database, url, and port parameters. It would be helpful to have an API like: require ''camping/server'' db = { ''host'' => ''localhost, ''username'' => ''camping'', ''password'' => ''foo'', ''db'' => ''mysql_camping'', .... } myserver = Camping::Server.new(''localhost'', 3301, db) myserver.run # boots the server and returns when the sever dies I wrote a rake task to launch camping apps using a Rails config file, and I had to duplicate virtually all the code in the camping server. I''m happy to write this patch, but I won''t have time until later this week. What''s the timeline for 1.6? -M On 11/26/06, why the lucky stiff <why at whytheluckystiff.net> wrote:> On Sat, Nov 25, 2006 at 02:01:55PM +0100, Manfred Stienstra wrote: > > I think this problem was solved just after Camping 1.5 was released. > > That''s true, this little problem bothered me a lot and maybe it''s time for 1.6. > Our milestones: are loading apps straight from a Gem and daemon mode[1]. > > Anything else? > > _why > > [1] http://code.whytheluckystiff.net/camping/roadmap > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
On Mon, Nov 27, 2006 at 08:20:00AM -0600, Mark Fredrickson wrote:> I''d like to see the logic in the camping server wrapped into a class. > This would allow other uses. Right now, there is no easy way to pass > in database, url, and port parameters. It would be helpful to have an > API like: > > require ''camping/server'' > > db = { ''host'' => ''localhost, ''username'' => ''camping'', ''password'' => > ''foo'', ''db'' => ''mysql_camping'', .... } > myserver = Camping::Server.new(''localhost'', 3301, db) > myserver.run # boots the server and returns when the sever diesThat''s a brilliant idea. Thankyou and there''s no rush, just: whenever. _why