yahns Ruby server user/dev discussion
 help / color / Atom feed
fa52f54bb03024f24448de759fac73073f3c20a1 blob 1046 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
43
44
45
46
47
 
# -*- encoding: binary -*-
# Copyright (C) 2016 all contributors <yahns-public@yhbt.net>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require_relative 'wbuf'

# This is only used for "proxy_buffering: false"
class Yahns::WbufLite < Yahns::Wbuf # :nodoc:
  attr_reader :busy
  attr_writer :req_res

  def initialize(req_res)
    alive = req_res.alive
    super(nil, alive ? :ignore : false)
    @req_res = req_res
  end

  def wbuf_write(client, buf)
    super
  rescue
    @req_res = @req_res.close if @req_res
    raise
  end

  def wbuf_flush(client)
    super
  rescue
    @req_res = @req_res.close if @req_res
    raise
  end

  # called by Yahns::HttpClient#step_write
  def wbuf_close(client)
    wbuf_abort

    # resume reading when @blocked is empty
    if @req_res
      client.hijack_cleanup
      Thread.current[:yahns_queue].queue_mod(@req_res, Yahns::Queue::QEV_RD)
      return :ignore
    end
    @wbuf_persist
  rescue
    @req_res = @req_res.close if @req_res
    raise
  end
end
debug log:

solving fa52f54 ...
found fa52f54 in https://yhbt.net/yahns.git

yahns Ruby server user/dev discussion

Archives are clonable:
	git clone --mirror https://yhbt.net/yahns-public
	git clone --mirror http://ou63pmih66umazou.onion/yahns-public

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

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

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