user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 7/9] ds: remove read method, here, too
  2019-06-10  5:18  5% [PATCH 0/9] ds: Diet Socket Eric Wong
@ 2019-06-10  5:18  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-06-10  5:18 UTC (permalink / raw)
  To: meta

Since we stop using it in NNTP, we don't need it at all.
---
 lib/PublicInbox/DS.pm | 30 ------------------------------
 1 file changed, 30 deletions(-)

diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm
index 5177d1f1..78ea7227 100644
--- a/lib/PublicInbox/DS.pm
+++ b/lib/PublicInbox/DS.pm
@@ -663,36 +663,6 @@ sub on_incomplete_write {
     $self->watch_write(1);
 }
 
-=head2 C<< $obj->read( $bytecount ) >>
-
-Read at most I<bytecount> bytes from the underlying handle; returns scalar
-ref on read, or undef on connection closed.
-
-=cut
-sub read {
-    my PublicInbox::DS $self = shift;
-    return if $self->{closed};
-    my $bytes = shift;
-    my $buf;
-    my $sock = $self->{sock};
-
-    # if this is too high, perl quits(!!).  reports on mailing lists
-    # don't seem to point to a universal answer.  5MB worked for some,
-    # crashed for others.  1MB works for more people.  let's go with 1MB
-    # for now.  :/
-    my $req_bytes = $bytes > 1048576 ? 1048576 : $bytes;
-
-    my $res = sysread($sock, $buf, $req_bytes, 0);
-    DebugLevel >= 2 && $self->debugmsg("sysread = %d; \$! = %d", $res, $!);
-
-    if (! $res && $! != EAGAIN) {
-        # catches 0=conn closed or undef=error
-        return undef;
-    }
-
-    return \$buf;
-}
-
 =head2 (VIRTUAL) C<< $obj->event_read() >>
 
 Readable event handler. Concrete deriviatives of PublicInbox::DS should
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/9] ds: Diet Socket
@ 2019-06-10  5:18  5% Eric Wong
  2019-06-10  5:18  7% ` [PATCH 7/9] ds: remove read method, here, too Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-06-10  5:18 UTC (permalink / raw)
  To: meta

Getting more aggressive with changes to PublicInbox::DS.

I'm thinking patches 8-9 will be important to make TLS
support easier.

On a side note: while reading the code to IO::KQueue;
I've noticed it doesn't take advantage at all of the
syscall reduction kevent() can potentially provide over
over the use of epoll_ctl+epoll_wait :<

Eric Wong (9):
  ds: simplify write buffer accounting
  ds: cleanup Errno imports and favor constant comparisons
  ds: reduce Errno imports and drop ->close reason
  ds: remove {fd} field
  ds: remove steal_socket method
  nntp: use sysread to append to existing buffer
  ds: remove read method, here, too
  ds: do not distinguish between POLLHUP and POLLERR
  ds: stop caring about event flags set by epoll/poll/kqueue

 lib/PublicInbox/DS.pm          | 235 +++++++++------------------------
 lib/PublicInbox/EvCleanup.pm   |   8 +-
 lib/PublicInbox/HTTP.pm        |  11 +-
 lib/PublicInbox/HTTPD/Async.pm |   4 +-
 lib/PublicInbox/NNTP.pm        |  44 +++---
 5 files changed, 93 insertions(+), 209 deletions(-)

-- 
EW


^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-06-10  5:18  5% [PATCH 0/9] ds: Diet Socket Eric Wong
2019-06-10  5:18  7% ` [PATCH 7/9] ds: remove read method, here, too Eric Wong

Code repositories for project(s) associated with this public inbox

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

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).