Eric Wong | 18 May 23:13

[PATCH 0/2] strip leading/trailing linear whitespace in headers

Hello, I've pushed the following two changes to my git repo,
based on "master" of git://github.com/fauna/mongrel.git

  [PATCH 1/2] ragel.rake: rebuild on http11_parser_common.rl changes
  [PATCH 2/2] strip trailing and leading linear whitespace in headers

The first patch is a trivial rake dependency fix.

I could definitely use a more pairs of eyes to review my second patch
which I've included inline below.  I'm also planning this for the
unicorn and kcar projects.

RFC 2616, section 4.2:
> The field-content does not include any leading or trailing LWS:
> linear white space occurring before the first non-whitespace
> character of the field-value or after the last non-whitespace
> character of the field-value. Such leading or trailing LWS MAY be
> removed without changing the semantics of the field value. Any LWS
> that occurs between field-content MAY be replaced with a single SP
> before interpreting the field value or forwarding the message
> downstream.
---
  You can pull from my repo here:

    git pull git://bogomips.org/mongrel.git http11-lws

  If you like web browsers (I don't) you can view the changes here:

    http://bogomips.org/mongrel.git?h=http11-lws

(Continue reading)

wyhaines | 17 May 17:20
Picon

hi

, as soon as i heard about this I thought of you http://j.mp/koA4P6
Luis Lavena | 1 Jan 22:46
Picon
Gravatar

[ANN] mongrel_service 0.4.beta2 Released

mongrel_service version 0.4.beta2 has been released!

* <http://github.com/fauna/mongrel_service>

This plugin offer native win32 services for rails.
This replace mongrel_rails_service.

Since this is a pre-release gem, you can install it with:

gem install mongrel_service --prerelease

If no bug is found, expect an final release next week.

Changes:

### 0.4.beta2 / 2010-01-01

* Enhancements:
  * Removed win32-service dependency, making mongrel_service more portable
    between Ruby implementations on Windows (One-Click and RubyInstaller)

  * Now mongrel log files are written to the path specified by --log option.
    Contribution by Daniel Gies (BigFix). Closes #44.

* Bugfixes:
  * Wait longer for child process terminate properly (max 20 seconds).
    Imported tests from RubyServices project. Closes #18.

  * Workaround Windows 2008 process detection issues forcing 'service'
    initialization parameter. Closes #54. [papillon]
(Continue reading)

Eric Wong | 28 Nov 03:08

[ANN] Zbatery - Unicorn+Rainbows! with less Unix

Hi all,

Don't have time to really write it up, but maybe we could just rot 13
the name and stick a 2.0 label on it :>

  http://git.bogomips.org/cgit/zbatery.git

If you grab the latest unicorn.git, you can get Rubinius support
for the HTTP parser.

  http://git.bogomips.org/cgit/unicorn.git

Also, in the latest rainbows.git it can work with Rubinius Actors

  http://git.bogomips.org/cgit/rainbows.git

--

-- 
Eric Wong
(about to go outside for the first time this week, may not return alive)
Eric Wong | 13 Sep 01:57

[RFC Mongrel2] simpler response API + updated HTTP parser

Hi all,

I've pushed out some changes based on fauna/master[1] to
git://git.bogomips.org/ur-mongrel that includes a good chunk of the
platform-independent stuff found in Unicorn.

The new HTTP parser is named "mongrel_http" to avoid loadtime conflicts
with the old one ("http11") but maintains the same class name
(Mongrel::HttpParser).  This one even supports HTTP/0.9, so "http11"
wasn't an appropriate name for it :)

Problems:

  I'm having some trouble with Rake+Echoe 3.2 with an "uninitialized
  constant Platform" error but everything seems to work by hand without
  Rake+Echoe.

  I'm also getting some test failures under 1.9.1-p243 with the
  semaphore/threading tests.  I haven't looked too hard at this current
  threading model, but my gut feeling is that it's too complicated and a
  "dumber" model in mongrel 1.x *or* a fixed number of worker threads
  doing accept() is sufficient...

  One thing that may be cool is to support multiple
  threading/concurrency models since 1.8/1.9/jruby/rubinius all
  implement threads differently and we can also get Actors with
  1.9/Rubinius.

shortlog and diffstat below:

(Continue reading)

Eric Wong | 5 Sep 23:50

merging Unicorn HTTP parser back to Mongrel

Hello,  (ok, this email got longer than expected, I now consider the
most important parts the first and last paragraphs of the last
footnote).

The Unicorn HTTP parser is feature complete as far as I can tell and
supports things the Mongrel one does not.  I would very much like to see
it used in places that Unicorn isn't suited for[1].  In fact, a chunk of
the new features are much better suited for a server with better slow
client handling like Mongrel.

The big roadblock to getting this back into Mongrel is the Java/JRuby
version of the parser Mongrel uses.  Simply put, I don't do Java;
somebody else will have to port it.  But I'll have to convince you
that these features are worth going into Mongrel, too :)

I could provide a standalone C parser that can be wrapped with FFI, but
I'm not sure if the performance would be acceptable.  I'm fairly certain
that a pure-Ruby version with Ragel-generated code would not provide
acceptable performance anywhere; maybe a hand-coded one could, but I'm
not particularly excited about doing that...

The MRI-C parser should just work on Win32.

Unlike the rest of Unicorn, the HTTP parser remains portable to non-UNIX
platforms and thread-safe.  There are no system-calls made directly
through it (only memory allocations through the Ruby C API).

New features that aren't in Mongrel are:

* HTTP/0.9 support - blame a network BOFH hell bent for hell on saving
(Continue reading)

Eric Wong | 14 Aug 03:18

teaching Mongrel to inherit sockets (and replace mongrel_cluster)

This change to Mongrel should be completely harmless for non-UNIX
systems, too (it won't break (or do) anything).

This minimal change let Mongrels inherit listen sockets from a parent
process, so that parent could be a cluster manager.  This means no more
port juggling with mongrel_cluster!  The entire Mongrel pack will all
share one port.

Only the manager script (see below) itself relies on UNIX-isms (but I
think mongrel_cluster did, too).

diff --git a/lib/mongrel.rb b/lib/mongrel.rb
index 0619abe..90e99e7 100644
--- a/lib/mongrel.rb
+++ b/lib/mongrel.rb
@@ -91,7 +91,11 @@ module Mongrel
     def initialize(host, port, num_processors=950, throttle=0, timeout=60)

       tries = 0
-      @socket = TCPServer.new(host, port) 
+      @socket = if ENV['LISTEN_FD']
+        TCPServer.for_fd(ENV['LISTEN_FD'].to_i)
+      else
+        TCPServer.new(host, port)
+      end
       if defined?(Fcntl::FD_CLOEXEC)
         @socket.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
       end
---

(Continue reading)

Eric Wong | 10 Aug 02:10

[PATCH] join repeated headers with a comma

These are joined in in accordance with rfc2616, section 4.2[1].

This is also ticket #50 in Trac:
   http://mongrel.rubyforge.org/ticket/50

[1] - http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
---

 This applies against c365ba16d12a14bdf1cc50a26f67dd3b45f5a4d8 in Evan's
 fauna repository, I'm completely certain where I should be applying
 this but it should be trivial to port this patch to anything else
 remotely resembling it...

 ext/http11/http11.c           |    9 ++++++++-
 test/unit/test_http_parser.rb |   10 +++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/ext/http11/http11.c b/ext/http11/http11.c
index a228019..a770c60 100644
--- a/ext/http11/http11.c
+++ b/ext/http11/http11.c
@@ -182,6 +182,7 @@ void http_field(void *data, const char *field, size_t flen, const char *value, s
   VALUE req = (VALUE)data;
   VALUE v = Qnil;
   VALUE f = Qnil;
+  VALUE e = Qnil;

   VALIDATE_MAX_LENGTH(flen, FIELD_NAME);
   VALIDATE_MAX_LENGTH(vlen, FIELD_VALUE);
@@ -208,7 +209,13 @@ void http_field(void *data, const char *field, size_t flen, const char *value, s
(Continue reading)

Eric Wong | 9 Jul 11:56

[PATCH] always set FD_CLOEXEC on sockets post-accept()

FD_CLOEXEC is not guaranteed to be inherited by the accept()-ed
descriptors even if the listener socket has this set.  This can
be a problem with applications that fork+exec long running
background processes and our client expects us to close
a connection to signal a completed response: the connection
would only be closed when the background process closed it
(when it exited), not when Mongrel closes the socket.

This issue was discovered with a server other than Mongrel but
the issue here is applicable to Mongrel as well.
---

  This patch was based on the below branch
  (against c365ba16d12a14bdf1cc50a26f67dd3b45f5a4d8)

  > I used git-svn and added it to
  > http://github.com/fauna/mongrel/tree/trunk_from_svn, where it can lie
  > unchanged for reference.

  P.S.: I know I used to have a commit bit to the Mongrel SVN but I
  never really cared for it since I've always preferred the
  mailing-patches-around-for-review form of development.  Let me know if
  pushing things to git://git.bogomips.org/mongrel.git for you to
  pull is preferable in the future.

  P.P.S: not sure if it's common around here, but I've long had mutt
  setup to pipe messages to "git am" directly from the index or pager
  and also diff syntax hilighting in the mutt pager.  It all makes patch
  review/testing *much* nicer without having to context switch out of a
  terminal/screen.
(Continue reading)

Luis Lavena | 8 Jul 14:23
Picon
Gravatar

TODO list for 1.1.6 release

Hey Evan and others watching this list.

I would love to release an official small point release for Mongrel in
the next couple of days. Mainly, the following things is what I'm
aiming:

* Basic Ruby 1.9 functionality

This means "it just built and run", it doesn't mean anything optimized
for 1.9. Bigger versions can address those details.

There is a weird Zlib error I'm going to investigate.

* Modernize infrastructure

- Latest Ruby versions do not require fastthread, since has been
integrated by default (1.8.6 greater than p114)
- CGI has been patched since 1.8.6-p114

I believe those 2 dependencies can be dropped, and
required_ruby_version of Mongrel itself bumped to 1.8.6 instead of
1.8.5, since due our changes in API compatibility may not build.

Also, I've invested a couple of months creating rake-compiler:

http://github.com/luislavena/rake-compiler

Not a shameless self-promotion, but it has been working great for
other projects and also removed the need to depend or require a
Windows building environment to be able to release Windows gems.
(Continue reading)

Eric Wong | 2 Jul 00:58

[ANN] unicorn 0.9.0 (experimental release)

Unicorn is a Rack HTTP server for Unix, fast clients and nothing else[1]

We now have support for "Transfer-Encoding: chunked" bodies in
requests.  Not only that, Rack applications reading input bodies
get that data streamed off to the client socket on an as-needed
basis.  This allows the application to do things like upload
progress notification and even tunneling of arbitrary stream
protocols via bidirectional chunked encoding.

See Unicorn::App::Inetd and examples/git.ru (including the
comments) for an example of tunneling the git:// protocol over
HTTP.

This release also gives applications the ability to respond
positively to "Expect: 100-continue" headers before being rerun
without closing the socket connection.  See Unicorn::App::Inetd
for an example of how this is used.

This release is NOT recommended for production use.

Eric Wong (43):
      http_request: no need to reset the request
      http_request: StringIO is binary for empty bodies (1.9)
      http_request: fix typo for 1.9
      Transfer-Encoding: chunked streaming input support
      Unicorn::App::Inetd: reinventing Unix, poorly :)
      README: update with mailing list info
      local.mk.sample: publish_doc gzips all html, js, css
      Put copyright text in new files, include GPL2 text
      examples/cat-chunk-proxy: link to proposed curl(1) patch
(Continue reading)


Gmane