user/dev discussion of public-inbox itself
 help / color / mirror / Atom feed
a048cd1a6e26bcbe799647115bc18c38f46c1d73 blob 1139 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
41
42
 
# Copyright (C) 2020 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>

# connects public-inbox processes to public-inbox-gcf2(1)
package PublicInbox::Gcf2Client;
use strict;
use parent 'PublicInbox::Git';
use PublicInbox::Spawn qw(popen_rd);
use IO::Handle ();

sub new {
	my ($rdr) = @_;
	my $self = bless {}, __PACKAGE__;
	my ($out_r, $out_w);
	pipe($out_r, $out_w) or $self->fail("pipe failed: $!");
	$rdr //= {};
	$rdr->{0} = $out_r;
	@$self{qw(in pid)} = popen_rd(['public-inbox-gcf2'], undef, $rdr);
	$self->{inflight} = [];
	$self->{out} = $out_w;
	fcntl($out_w, 1031, 4096) if $^O eq 'linux'; # 1031: F_SETPIPE_SZ
	$out_w->autoflush(1);
	$self;
}

sub add_git_dir {
	my ($self, $git_dir) = @_;

	# ensure buffers are drained, length($git_dir) may exceed
	# PIPE_BUF on platforms where PIPE_BUF is only 512 bytes
	my $inflight = $self->{inflight};
	while (scalar(@$inflight)) {
		$self->cat_async_step($inflight);
	}
	print { $self->{out} } $git_dir, "\n" or
				$self->fail("write error: $!");
}

# always false, since -gcf2 retries internally
sub alternates_changed {}

1;
debug log:

solving a048cd1a ...
found a048cd1a in https://80x24.org/public-inbox.git

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ http://public-inbox.org/meta \
		meta@public-inbox.org
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

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