# Unicorn 0.93.2 - more compatible with Rails

**URL:** <https://www.ruby-forum.com/t/unicorn-0-93-2-more-compatible-with-rails/176873>\
**Category:** Ruby\
**Created:** [October 7, 2009, 11:00am UTC](https://www.ruby-forum.com/t/unicorn-0-93-2-more-compatible-with-rails/176873 "2009-10-07T11:00:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/97f17d/32.png) [@ericw](https://www.ruby-forum.com/u/ericw)\
**Post date:** [October 7, 2009, 11:00am UTC](https://www.ruby-forum.com/t/unicorn-0-93-2-more-compatible-with-rails/176873/1 "2009-10-07T11:00:49Z")

</div>

Unicorn is a HTTP server for Rack applications designed to take  
advantage of features in Unix/Unix-like kernels and only serve fast  
clients on low-latency, high-bandwidth connections. Slow clients should  
only be served by placing a reverse proxy capable of fully-buffering  
both the the request and response in between Unicorn and slow clients.

- [http://unicorn.bogomips.org/](http://unicorn.bogomips.org/)
- removed\_email\_address@domain.invalid
- git://git.bogomips.org/unicorn.git

Thanks to Chris W. for reporting issues with large  
POST bodies and for helping me test.

Changes:

Avoid truncated POST bodies with URL-encoded forms in Rails  
by switching TeeInput to use read-in-full semantics (only) when  
a Content-Length: header exists. Chunked request bodies  
continue to exhibit readpartial semantics to support  
simultaneous bidirectional chunking.

The lack of return value checking in Rails to protect against a  
short ios.read(length) is entirely reasonable even if not  
pedantically correct. Most ios.read(length) implementations  
return the full amount requested except right before EOF.

A ticket has been opened here to track the issue:  
[#3343 ensure raw\_post reads all of the specified length - Ruby on Rails - rails](https://rails.lighthouseapp.com/projects/8994/tickets/3343)

Also there are some minor documentation improvements.

Eric W. (8):  
Fix NEWS generation on single-paragraph tag messages  
Include GPLv2 in docs  
doc: make it clear contributors retain copyrights  
TODO: removed Rainbows! (see [rainbows.rubyforge.org](http://rainbows.rubyforge.org))  
Document the START\_CTX hash contents  
more-compatible TeeInput#read for POSTs with Content-Length  
tests for read-in-full vs readpartial semantics  
unicorn 0.93.2

---

<div class="post-metadata">

**Author:** ![ericw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/97f17d/32.png) [@ericw](https://www.ruby-forum.com/u/ericw)\
**Post date:** [October 7, 2009, 6:20pm UTC](https://www.ruby-forum.com/t/unicorn-0-93-2-more-compatible-with-rails/176873/2 "2009-10-07T18:20:31Z")

</div>

On Oct 7, 3:00 am, Eric W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ## Thanks to Chris W. for reporting issues with large The lack of return value checking in Rails to protect against a Fix NEWS generation on single-paragraph tag messages Include GPLv2 in docs doc: make it clear contributors retain copyrights TODO: removed Rainbows! (see [rainbows.rubyforge.org](http://rainbows.rubyforge.org)) Document the START\_CTX hash contents more-compatible TeeInput#read for POSTs with Content-Length tests for read-in-full vs readpartial semantics unicorn 0.93.2
> 
> Eric W.

There was a pretty good blog entry on Unicorn recently:

[http://tomayko.com/writings/unicorn-is-unix](http://tomayko.com/writings/unicorn-is-unix)

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![ericw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/97f17d/32.png) [@ericw](https://www.ruby-forum.com/u/ericw)\
**Post date:** [October 8, 2009, 12:15am UTC](https://www.ruby-forum.com/t/unicorn-0-93-2-more-compatible-with-rails/176873/3 "2009-10-08T00:15:57Z")

</div>

Daniel B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Oct 7, 3:00 am, Eric W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Unicorn is a HTTP server for Rack applications designed to take  
> > advantage of features in Unix/Unix-like kernels and only serve fast  
> > clients on low-latency, high-bandwidth connections. Slow clients should  
> > only be served by placing a reverse proxy capable of fully-buffering  
> > both the the request and response in between Unicorn and slow clients.
> 
> There was a pretty good blog entry on Unicorn recently:
> 
> [http://tomayko.com/writings/unicorn-is-unix](http://tomayko.com/writings/unicorn-is-unix)

Yup, it is excellent 🙂

One minor correction about SELF\_PIPE usage here:

[http://article.gmane.org/gmane.comp.lang.ruby.unicorn.general/59](http://article.gmane.org/gmane.comp.lang.ruby.unicorn.general/59)

Overall I’m extremely happy with the article and interest this has  
generated in good ol’ Unix-isms 🙂

---

<div class="post-metadata">

**Author:** ![ericw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/97f17d/32.png) [@ericw](https://www.ruby-forum.com/u/ericw)\
**Post date:** [October 8, 2009, 5:06pm UTC](https://www.ruby-forum.com/t/unicorn-0-93-2-more-compatible-with-rails/176873/4 "2009-10-08T17:06:17Z")

</div>

On Oct 7, 4:15 pm, Eric W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > [http://tomayko.com/writings/unicorn-is-unix](http://tomayko.com/writings/unicorn-is-unix)
> 
> Yup, it is excellent 🙂
> 
> One minor correction about SELF\_PIPE usage here:
> 
> [http://article.gmane.org/gmane.comp.lang.ruby.unicorn.general/59](http://article.gmane.org/gmane.comp.lang.ruby.unicorn.general/59)
> 
> Overall I’m extremely happy with the article and interest this has  
> generated in good ol’ Unix-isms 🙂

Here is some more:

> **[\* is Unix - Jacob Kaplan-Moss](https://jacobian.org/writing/star-is-unix/)**
>
> Ryan’s I like Unicorn because it’s Unix appears to have started a mini-meme of folks writing simple forking network servers in their language of choice. I’m really enjoying reading ’em – they’re a sort of Rosetta Stone of network code – so I’m going...

Regards,

Dan
