* wip
@ 2016-05-27 7:11 Eric Wong
0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2016-05-27 7:11 UTC (permalink / raw)
To: spew
diff --git a/lib/PublicInbox/GetlineBody.pm b/lib/PublicInbox/GetlineBody.pm
index 4f8765b..5f32782 100644
--- a/lib/PublicInbox/GetlineBody.pm
+++ b/lib/PublicInbox/GetlineBody.pm
@@ -13,19 +13,23 @@ sub new {
bless { rpipe => $rpipe, end => $end, buf => $buf }, $class;
}
+# close should always be called after getline returns undef,
+# but a client aborting a connection can ruin our day; so lets
+# hope our underlying PSGI server does not leak references, here.
sub DESTROY { $_[0]->close }
sub getline {
my ($self) = @_;
- my $buf = delete $self->{buf};
+ my $buf = delete $self->{buf}; # initial buffer
defined $buf ? $buf : $self->{rpipe}->getline;
}
sub close {
my ($self) = @_;
- delete $self->{rpipe};
- my $end = delete $self->{end} or return;
- $end->();
+ my $rpipe = delete $self->{rpipe};
+ close $rpipe if $rpipe;
+ my $end = delete $self->{end};
+ $end->() if $end;
}
1;
diff --git a/lib/PublicInbox/GitHTTPBackend.pm b/lib/PublicInbox/GitHTTPBackend.pm
index fd7afbc..1819444 100644
--- a/lib/PublicInbox/GitHTTPBackend.pm
+++ b/lib/PublicInbox/GitHTTPBackend.pm
@@ -186,7 +186,6 @@ sub serve_smart {
my $x = PublicInbox::Qspawn->new([qw(git http-backend)], \%env, \%rdr);
my ($fh, $rpipe);
my $end = sub {
- close $rpipe if $rpipe && !$fh; # generic PSGI
if (my $err = $x->finish) {
err($env, "git http-backend ($git_dir): $err");
drop_client($env);
diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm
index 0454f60..321eb40 100644
--- a/lib/PublicInbox/HTTP.pm
+++ b/lib/PublicInbox/HTTP.pm
@@ -266,6 +266,9 @@ sub getline_response {
while ($forward && defined(my $buf = $forward->getline)) {
$write->($buf);
last if $self->{closed};
+
+ # do not read more of the body until the client can
+ # catch up, we do not want to OOM on slow clients.
if ($self->{write_buf_size}) {
$self->write($self->{pull});
return;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* wip
@ 2016-08-22 20:32 Eric Wong
0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2016-08-22 20:32 UTC (permalink / raw)
To: spew
diff --git a/.gitignore b/.gitignore
index 3b333a5..6a44471 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,5 +9,6 @@
*.1
*.5
*.7
+*.8
*.html
*.gz
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
index 8ba4186..107ad36 100644
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -1 +1 @@
-/public-inbox-mda.txt
+/public-inbox-*.txt
diff --git a/Documentation/include.mk b/Documentation/include.mk
index 5d73028..99f3d43 100644
--- a/Documentation/include.mk
+++ b/Documentation/include.mk
@@ -16,33 +16,42 @@ podtext = $(PODTEXT) $(PODTEXT_OPTS)
m1 =
m1 += public-inbox-mda
+m1 += public-inbox-httpd
+m1 += public-inbox-nntpd
m5 =
+m5 += public-inbox-config
m7 =
+m8 =
+m8 += public-inbox-daemon
man1 := $(addsuffix .1, $(m1))
man5 := $(addsuffix .5, $(m5))
man7 := $(addsuffix .7, $(m7))
+man8 := $(addsuffix .8, $(m8))
all:: man html
-man: $(man1) $(man5) $(man7)
+man: $(man1) $(man5) $(man7) $(man8)
prefix ?= $(HOME)
mandir ?= $(prefix)/share/man
man1dir = $(mandir)/man1
man5dir = $(mandir)/man5
man7dir = $(mandir)/man7
+man8dir = $(mandir)/man8
install-man: man
test -z "$(man1)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
test -z "$(man5)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
test -z "$(man7)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
+ test -z "$(man8)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
test -z "$(man1)" || $(INSTALL) -m 644 $(man1) $(DESTDIR)$(man1dir)
test -z "$(man5)" || $(INSTALL) -m 644 $(man5) $(DESTDIR)$(man5dir)
test -z "$(man7)" || $(INSTALL) -m 644 $(man7) $(DESTDIR)$(man7dir)
+ test -z "$(man8)" || $(INSTALL) -m 644 $(man8) $(DESTDIR)$(man8dir)
-%.1 : Documentation/%.pod
- $(podman) -s 1 $< $@+ && mv $@+ $@
+%.1 %.5 %.7 %.8 : Documentation/%.pod
+ $(podman) -s $(suffix $@) $< $@+ && mv $@+ $@
mantxt = $(addprefix Documentation/, $(addsuffix .txt, $(m1)))
docs += $(mantxt)
diff --git a/Documentation/public-inbox-config.pod b/Documentation/public-inbox-config.pod
new file mode 100644
index 0000000..c68eb61
--- /dev/null
+++ b/Documentation/public-inbox-config.pod
@@ -0,0 +1,59 @@
+=head1 NAME
+
+public-inbox-config - public-inbox config file layout
+
+=head1 SYNOPSIS
+
+~/.public-inbox/config
+
+=head1 DESCRIPTION
+
+The public-inbox config file is parseable by L<git-config(1)>.
+
+=head1 CONFIGURATION FILE
+
+=head2 EXAMPLE
+
+ [publicinbox "test"]
+ ; multiple addresses are supported for migrations
+ address = test@example.com
+ mainrepo = /home/user/path/to/test.git
+ url = http://example.com/test
+ newsgroup = inbox.test
+
+=head2 VARIABLES
+
+=over 8
+
+=item publicinbox.<name>.address
+
+The email address of the public-inbox. May be specified
+more than once for merging multiple mailing lists into one.
+
+Default: (none)
+
+=item publicinbox.<name>.mainrepo
+
+The path to the git repository which hosts the public-inbox.
+
+Default: (none), required in all instances
+
+=back
+
+=head1 CONTACT
+
+All feedback welcome via plain-text mail to L<mailto:meta@public-inbox.org>
+
+The mail archives are hosted at L<https://public-inbox.org/meta/>
+and L<http://hjrcffqmbrq6wope.onion/meta/>
+
+=head1 COPYRIGHT
+
+Copyright 2013-2016 all contributors L<mailto:meta@public-inbox.org>
+
+License: AGPL-3.0+ L<https://www.gnu.org/licenses/agpl-3.0.txt>
+
+=head1 SEE ALSO
+
+L<git(1)>, L<git-config(1)>, L<public-inbox-daemon(8)>,
+L
diff --git a/Documentation/public-inbox-daemon.pod b/Documentation/public-inbox-daemon.pod
new file mode 100644
index 0000000..4f22a5c
--- /dev/null
+++ b/Documentation/public-inbox-daemon.pod
@@ -0,0 +1,62 @@
+=head1 NAME
+
+public-inbox-daemon - common daemon documentation for public-inbox
+
+=head1 SYNOPSIS
+
+B<public-inbox-httpd>
+B<public-inbox-nntpd>
+
+=head1 DESCRIPTION
+
+Common daemon options and behavior for public-inbox network daemons.
+Network daemons for public-inbox provide NNTP and HTTP access
+to repositories.
+
+=head1 O
+
+=head1 SIGNALS
+
+=over 8
+
+=item SIGUSR1
+
+Reopens log files pointed to by --stdout and --stderr options.
+
+
+
+
+=back
+
+=head1 ENVIRONMENT
+
+=over 8
+
+=item PI_CONFIG
+
+config file. default: ~/.public-inbox/config
+See L<public-inbox-config(5)>
+
+=item LISTEN_FDS, LISTEN_PID
+
+Used by systemd (and compatible) installations.
+See L<sd_listen_fds(3)>
+
+=back
+
+=head1 CONTACT
+
+All feedback welcome via plain-text mail to L<mailto:meta@public-inbox.org>
+
+The mail archives are hosted at L<https://public-inbox.org/meta/>
+and L<http://hjrcffqmbrq6wope.onion/meta/>
+
+=head1 COPYRIGHT
+
+Copyright 2013-2016 all contributors L<mailto:meta@public-inbox.org>
+
+License: AGPL-3.0+ L<https://www.gnu.org/licenses/agpl-3.0.txt>
+
+=head1 SEE ALSO
+
+L<public-inbox-httpd(1)>, L<public-inbox-nntpd(1)>
diff --git a/Documentation/public-inbox-httpd.pod b/Documentation/public-inbox-httpd.pod
new file mode 100644
index 0000000..34f057b
--- /dev/null
+++ b/Documentation/public-inbox-httpd.pod
@@ -0,0 +1,34 @@
+=head1 NAME
+
+public-inbox-httpd - PSGI server optimized for public-inbox
+
+=head1 SYNOPSIS
+
+B<public-inbox-httpd> [OPTIONS] [/path/to/myapp.psgi]
+
+=head1 DESCRIPTION
+
+public-inbox-httpd is a PSGI/Plack server supporting HTTP/1.1.
+It uses options and environment variables common to all
+L<public-inbox-daemon(8)> implementations.
+This may point to a PSGI file for supporting generic PSGI applications.
+If a PSGI file is not specified, L<PublicInbox::WWW(3pm)> is loaded
+with default middleware.
+
+=head1 CONTACT
+
+All feedback welcome via plain-text mail to L<mailto:meta@public-inbox.org>
+
+The mail archives are hosted at L<https://public-inbox.org/meta/>
+and L<http://hjrcffqmbrq6wope.onion/meta/>
+
+=head1 COPYRIGHT
+
+Copyright 2013-2016 all contributors L<mailto:meta@public-inbox.org>
+
+License: AGPL-3.0+ L<https://www.gnu.org/licenses/agpl-3.0.txt>
+
+=head1 SEE ALSO
+
+L<git(1)>, L<git-config(1)>, L<public-inbox-daemon(8)>,
+L<Plack(3pm)>
diff --git a/Documentation/public-inbox-nntpd.pod b/Documentation/public-inbox-nntpd.pod
new file mode 100644
index 0000000..40b6b8b
--- /dev/null
+++ b/Documentation/public-inbox-nntpd.pod
@@ -0,0 +1,31 @@
+=head1 NAME
+
+public-inbox-nntpd - NNTP server for sharing public-inbox
+
+=head1 SYNOPSIS
+
+B<public-inbox-nntpd> [OPTIONS]
+
+=head1 DESCRIPTION
+
+public-inbox-nntpd provides a NNTP daemon for public-inbox.
+It uses options and environment variables common to all
+L<public-inbox-daemon(8)> implementations.
+
+=head1 CONTACT
+
+All feedback welcome via plain-text mail to L<mailto:meta@public-inbox.org>
+
+The mail archives are hosted at L<https://public-inbox.org/meta/>,
+L<nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta>,
+L<nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta>
+
+=head1 COPYRIGHT
+
+Copyright 2013-2016 all contributors L<mailto:meta@public-inbox.org>
+
+License: AGPL-3.0+ L<https://www.gnu.org/licenses/agpl-3.0.txt>
+
+=head1 SEE ALSO
+
+L<git(1)>, L<git-config(1)>, L<public-inbox-daemon(8)>
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-22 20:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-22 20:32 wip Eric Wong
-- strict thread matches above, loose matches on Subject: below --
2016-05-27 7:11 wip Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).