Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Httperf only allows cookies of 256 bytes or less. Rails sets cookies that are bigger than that. This will result in output such as `httperf.sess_cookie: truncating cookie to 245 bytes` and failed Rails sessions. This brew adds the `--big-cookies` option to the `httperf` formula so you can use it with Rails.
require 'formula'
class Httperf < Formula
homepage 'http://code.google.com/p/httperf/'
url 'http://httperf.googlecode.com/files/httperf-0.9.0.tar.gz'
sha1 '2aa885c0c143d809c0e50a6eca5063090bddee35'
option 'enable-debug', 'Build with debugging support'
option 'big-cookies', 'Allow cookies larger than 256 bytes'
def install
debug = build.include?('enable-debug') ? '--enable-debug' : '--disable-debug'
if build.include?('big-cookies')
inreplace 'src/gen/sess_cookie.c' do |s|
s.gsub! /MAX_COOKIE_LEN\s+256/, 'MAX_COOKIE_LEN 1024'
end
end
system "./configure", debug,
"--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make install"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.