Skip to content

Instantly share code, notes, and snippets.

➜ couchdb git:(1843-feature-bigcouch) ✗ curl localhost:15984/_membership
{"all_nodes":["node1@127.0.0.1","node2@127.0.0.1","node3@127.0.0.1"],"cluster_nodes":["node1@127.0.0.1","node2@127.0.0.1","node3@127.0.0.1"]}
diff --git a/src/mochiweb_http.erl b/src/mochiweb_http.erl
index 38d51d4..335f813 100644
--- a/src/mochiweb_http.erl
+++ b/src/mochiweb_http.erl
@@ -87,6 +87,7 @@ reentry(Body) ->
headers(Socket, Request, Headers, _Body, ?MAX_HEADERS) ->
%% Too many headers sent, bad request.
ok = mochiweb_socket:setopts(Socket, [{packet, raw}]),
+ couch_log:error("too many headers", []),
handle_invalid_request(Socket, Request, Headers);
@rnewson
rnewson / gist:350921e88deef2905dc0
Created June 26, 2014 15:13
Cloning 1843-feature-bigcouch
➜ tmp git clone https://git-wip-us.apache.org/repos/asf/couchdb.git
Cloning into 'couchdb'...
remote: Counting objects: 54441, done.
remote: Compressing objects: 100% (16476/16476), done.
remote: Total 54441 (delta 40574), reused 49915 (delta 37260)
Receiving objects: 100% (54441/54441), 19.82 MiB | 1004.00 KiB/s, done.
Resolving deltas: 100% (40574/40574), done.
Checking connectivity... done.
➜ tmp cd couchdb
➜ couchdb git:(master) git checkout 1843-feature-bigcouch
#!/bin/sh
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
< HTTP/1.1 200 OK
< X-CouchDB-Body-Time: 0
< X-Couch-Request-ID: 31ca484b
* Server CouchDB/c10fe5e (Erlang OTP/R14B01) is not blacklisted
< Server: CouchDB/c10fe5e (Erlang OTP/R14B01)
< Date: Mon, 07 Jul 2014 10:32:26 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 16
< Cache-Control: must-revalidate
<
[couchdb]
util_driver_dir = /home/USER/lib
couchdb git:(master) curl foo:bar@localhost:15986/db1/_design/foo/_view/bar -d '{"queries": [ {"key":"doc1"} , {"key":"doc1"} ]}'
{"results":[
{"total_rows":1,"offset":0,"rows":[
{"id":"doc1","key":"doc1","value":null}
]},
{"total_rows":1,"offset":0,"rows":[
{"id":"doc1","key":"doc1","value":null}
]}
]}
#!/usr/bin/env escript
main(Path) ->
{ok, Fd} = file:open(Path, [binary, read, raw]),
Count = count_headers(Fd),
file:close(Fd),
io:format("~s contains ~B headers.~n", [Path, Count]).
count_headers(Fd) ->
count_headers(Fd, 0, 0).
Couchdb 1.5.1 install
> grep util_driver_dir /usr/local/etc/couchdb/*
/usr/local/etc/couchdb/default.ini:util_driver_dir = /usr/local/Cellar/couchdb/1.5.1/lib/couchdb/erlang/lib/couch-1.5.1/priv/lib
brew upgrade
> grep util_driver_dir /usr/local/etc/couchdb/*
/usr/local/etc/couchdb/default.ini:util_driver_dir = /usr/local/Cellar/couchdb/1.5.1/lib/couchdb/erlang/lib/couch-1.5.1/priv/lib
/usr/local/etc/couchdb/default.ini.default:util_driver_dir = /usr/local/Cellar/couchdb/1.6.0/lib/couchdb/erlang/lib/couch-1.6.0/priv/lib
@rnewson
rnewson / couchdb.rb
Created July 21, 2014 20:59
overwrite default.ini after install
diff --git a/Library/Formula/couchdb.rb b/Library/Formula/couchdb.rb
index c77e70c..258140b 100644
--- a/Library/Formula/couchdb.rb
+++ b/Library/Formula/couchdb.rb
@@ -59,6 +59,25 @@ class Couchdb < Formula
(var+'log/couchdb').mkpath
end
+ def post_install
+ if new_default_ini.exist?