No description
This patch sets CURLOPT_FORBID_REUSE, which tells cURL to close all connections when they are done. By default, connections are held open for later use unless explicitly closed or expired by a timeout. This can improve performance if the same instance is used for multiple requests to a single host. We never have that: a host receives only one message per queue job, so keeping the socket opened for 60 seconds (the default timeout) is totally useless. In addition, keeping the sockets open can cause problems for larger instances with fast workers and a lot of jobs. Mainly, diaspora/#6485 is caused by this very issue, which is resolved by this as well. |
||
|---|---|---|
| app/controllers/diaspora_federation | ||
| bin | ||
| config | ||
| lib | ||
| spec | ||
| test/dummy | ||
| .codeclimate.yml | ||
| .editorconfig | ||
| .envrc | ||
| .gitignore | ||
| .rspec | ||
| .rubocop.yml | ||
| .ruby-gemset | ||
| .ruby-version | ||
| .travis.yml | ||
| .yardopts | ||
| CONTRIBUTING.md | ||
| diaspora_federation-rails.gemspec | ||
| diaspora_federation-test.gemspec | ||
| diaspora_federation.gemspec | ||
| Gemfile | ||
| Gemfile.lock | ||
| Guardfile | ||
| LICENSE | ||
| Rakefile | ||
| README.md | ||
diaspora* federation library
A library that provides functionalities needed for the diaspora* federation protocol
This repository contains two gems:
diaspora_federationprovides the functionality for de-/serialization and de-/encryption of Entities in the protocols used for communication among the various installations of diaspora*.diaspora_federation-railsis a rails engine that adds the diaspora* federation protocol to a rails app.
Usage
Add the gem to your Gemfile:
gem "diaspora_federation-rails"
Mount the routes in your config/routes.rb:
mount DiasporaFederation::Engine => "/"
Configure the engine in config/initializers/diaspora_federation.rb:
DiasporaFederation.configure do |config|
# the pod url
config.server_uri = AppConfig.pod_uri
config.define_callbacks do
on :fetch_person_for_webfinger do |diaspora_id|
person = Person.find_local_by_diaspora_id(diaspora_id)
if person
DiasporaFederation::Discovery::WebFinger.new(
# ...
)
end
end
on :fetch_person_for_hcard do |guid|
# ...
end
end
end
Contributing
See our contribution guide for more information on how to contribute to the diaspora* federation library.