Skip to content

Instantly share code, notes, and snippets.

@fdmanana
fdmanana / gist:1034294
Created June 19, 2011 13:46
replicator always retry on attachment streaming failure
diff --git a/src/couchdb/couch_api_wrap.erl b/src/couchdb/couch_api_wrap.erl
index aa481c7..63e607a 100644
--- a/src/couchdb/couch_api_wrap.erl
+++ b/src/couchdb/couch_api_wrap.erl
@@ -597,7 +597,7 @@ doc_from_multi_part_stream(ContentType, DataFun) ->
started ->
unlink(Parser),
exit(Parser, kill),
- restart_remote_open_doc_revs();
+ restart_att_streaming();
@fdmanana
fdmanana / gist:1034290
Created June 19, 2011 13:40
replicator, shared/dedicated httpc pool configuration
diff --git a/src/couchdb/couch_api_wrap.erl b/src/couchdb/couch_api_wrap.erl
index 63e607a..8fcd08f 100644
--- a/src/couchdb/couch_api_wrap.erl
+++ b/src/couchdb/couch_api_wrap.erl
@@ -101,7 +101,6 @@ db_open(DbName, Options, Create) ->
end.
db_close(#httpdb{httpc_pool = Pool}) ->
- unlink(Pool),
ok = couch_httpc_pool:stop(Pool);
@fdmanana
fdmanana / gist:1006926
Created June 3, 2011 18:50
Multiple CouchDB mappers
diff --git a/src/couchdb/Makefile.am b/src/couchdb/Makefile.am
index f64a036..afc766c 100644
--- a/src/couchdb/Makefile.am
+++ b/src/couchdb/Makefile.am
@@ -88,6 +88,7 @@ source_files = \
couch_view_compactor.erl \
couch_view_updater.erl \
couch_view_group.erl \
+ couch_view_mapper.erl \
couch_db_updater.erl \
@fdmanana
fdmanana / gist:832610
Created February 17, 2011 20:27
The CouchDB replicator database

1. Introduction to the replicator database

A database where you PUT/POST documents to trigger replications and you DELETE to cancel ongoing replications. These documents have exactly the same content as the JSON objects we used to POST to /_replicate/ (fields "source", "target", "create_target", "continuous", "doc_ids", "filter", "query_params".

Replication documents can have a user defined "_id". Design documents (and _local documents) added to the replicator database are ignored.

The default name of this database is _replicator. The name can be changed in the .ini configuration, section [replicator], parameter db.

2. Basics

diff --git a/lib/ssl/src/ssl_broker.erl b/lib/ssl/src/ssl_broker.erl
index 178fb5f..7187b1f 100644
--- a/lib/ssl/src/ssl_broker.erl
+++ b/lib/ssl/src/ssl_broker.erl
@@ -608,6 +608,19 @@ handle_info({tcp, Socket, Data},
{noreply, St}
end;
+handle_info({tcp, Socket, Data},
+ #st{active = Active, collector = Collector, status = open,
diff --git a/lib/public_key/asn1/OTP-PKIX.asn1 b/lib/public_key/asn1/OTP-PKIX.asn1
index c0cf440..ad70419 100644
--- a/lib/public_key/asn1/OTP-PKIX.asn1
+++ b/lib/public_key/asn1/OTP-PKIX.asn1
@@ -302,18 +302,25 @@ SupportedPublicKeyAlgorithms PUBLIC-KEY-ALGORITHM-CLASS ::= {
-- DSA Keys and Signatures
+
+ DSAParams ::= CHOICE
diff --git a/lib/public_key/src/pubkey_cert.erl b/lib/public_key/src/pubkey_cert.erl
index 0ccc747..b53f8e7 100644
--- a/lib/public_key/src/pubkey_cert.erl
+++ b/lib/public_key/src/pubkey_cert.erl
@@ -176,9 +176,15 @@ validate_revoked_status(_OtpCert, _Verify, AccErr) ->
validate_extensions(OtpCert, ValidationState, Verify, AccErr) ->
TBSCert = OtpCert#'OTPCertificate'.tbsCertificate,
- Extensions = TBSCert#'OTPTBSCertificate'.extensions,
- validate_extensions(Extensions, ValidationState, no_basic_constraint,
-module(qteste).
-compile(export_all).
run() ->
process_flag(trap_exit, true),
{ok, Q} = couch_work_queue:new(
[{max_size, 8}, {max_items, 2}, {multi_workers, true}]),
C1 = consumer("Consumer_1", Q),
C2 = consumer("Consumer_2", Q),
diff --git a/etc/couchdb/default.ini.tpl.in b/etc/couchdb/default.ini.tpl.in
index 6b70777..6aedace 100644
--- a/etc/couchdb/default.ini.tpl.in
+++ b/etc/couchdb/default.ini.tpl.in
@@ -17,7 +17,10 @@ uri_file = %localstatelibdir%/couch.uri
port = 5984
bind_address = 127.0.0.1
max_connections = 2048
-authentication_handlers = {couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}
+; authentication handler which uses Apple Directory Services
fdmanana@fdmanana-mac ~/git/hub/couchdb (1.0.x)> git diff --cached src/couchdb/Makefile.am
diff --git a/src/couchdb/Makefile.am b/src/couchdb/Makefile.am
index 308a383..250ab39 100644
--- a/src/couchdb/Makefile.am
+++ b/src/couchdb/Makefile.am
@@ -27,6 +27,8 @@ CLEANFILES = $(compiled_files) $(doc_base)
# CLEANFILES = $(doc_modules) edoc-info
source_files = \
+ couch_apple_ds_auth.erl \