Rainbows! Rack HTTP server user/dev discussion
 help / color / Atom feed
8cce64570789763e5d8ad0da8186769e977cd3f1 blob 1239 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
#!/usr/bin/env ruby
# -*- encoding: binary -*-
# this is to remain compatible with the unused_port function in the
# Unicorn test/test_helper.rb file
require 'socket'
require 'tmpdir'

default_port = 8080
addr = ENV['UNICORN_TEST_ADDR'] || '127.0.0.1'
retries = 100
base = 5000
port = sock = lock_path = nil

begin
  begin
    port = base + rand(32768 - base)
    while port == default_port
      port = base + rand(32768 - base)
    end

    sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
    sock.bind(Socket.pack_sockaddr_in(port, addr))
    sock.listen(5)
  rescue Errno::EADDRINUSE, Errno::EACCES
    sock.close rescue nil
    retry if (retries -= 1) >= 0
  end

  # since we'll end up closing the random port we just got, there's a race
  # condition could allow the random port we just chose to reselect itself
  # when running tests in parallel with gmake.  Create a lock file while
  # we have the port here to ensure that does not happen.
  lock_path = "#{Dir::tmpdir}/unicorn_test.#{addr}:#{port}.lock"
  File.open(lock_path, File::WRONLY|File::CREAT|File::EXCL, 0600)
rescue Errno::EEXIST
  sock.close rescue nil
  retry
end
sock.close rescue nil
puts %Q(listen=#{addr}:#{port} T_RM_LIST="$T_RM_LIST #{lock_path}")
debug log:

solving 8cce645 ...
found 8cce645 in http://bogomips.org/rainbows.git

Rainbows! Rack HTTP server user/dev discussion

Archives are clonable:
	git clone --mirror http://bogomips.org/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git