yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
blob afee1e95032763d385620dbeccf44ca6789cd8a6 954 bytes (raw)
name: lib/yahns/wbuf_lite.rb 	 # note: path name is non-authoritative(*)

 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
 
# -*- 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

  def initialize(req_res)
    super(nil, :ignore)
    @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)
    end
    :ignore
  rescue
    @req_res = @req_res.close if @req_res
    raise
  end
end

debug log:

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

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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

	https://yhbt.net/yahns.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).