Class: EventParsers::Http11Parser::HeaderAndEntityStateStore

Inherits:
Object
  • Object
show all
Defined in:
bin/httphere

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state, delimiter) ⇒ HeaderAndEntityStateStore

Returns a new instance of HeaderAndEntityStateStore.



338
339
340
341
342
# File 'bin/httphere', line 338

def initialize(state, delimiter)
  @state = state
  @delimiter = delimiter
  reset!
end

Instance Attribute Details

#bogus_linesObject

Returns the value of attribute bogus_lines.



336
337
338
# File 'bin/httphere', line 336

def bogus_lines
  @bogus_lines
end

#delimiterObject

Returns the value of attribute delimiter.



336
337
338
# File 'bin/httphere', line 336

def delimiter
  @delimiter
end

#entity_posObject

Returns the value of attribute entity_pos.



336
337
338
# File 'bin/httphere', line 336

def entity_pos
  @entity_pos
end

#entity_sizeObject

Returns the value of attribute entity_size.



336
337
338
# File 'bin/httphere', line 336

def entity_size
  @entity_size
end

#linebufferObject

Returns the value of attribute linebuffer.



336
337
338
# File 'bin/httphere', line 336

def linebuffer
  @linebuffer
end

#stateObject

Returns the value of attribute state.



336
337
338
# File 'bin/httphere', line 336

def state
  @state
end

#textbufferObject

Returns the value of attribute textbuffer.



336
337
338
# File 'bin/httphere', line 336

def textbuffer
  @textbuffer
end

Instance Method Details

#bogus_line!(ln = nil) ⇒ Object



356
357
358
359
# File 'bin/httphere', line 356

def bogus_line!(ln=nil)
  log "bogus line:\n#{ln}\n" if ln && $DEBUG
  @bogus_lines += 1
end

#entity?Boolean

Returns:

  • (Boolean)


352
353
354
# File 'bin/httphere', line 352

def entity?
  !entity_size.nil? && entity_size > 0
end

#reset!Object



344
345
346
347
348
349
350
# File 'bin/httphere', line 344

def reset!
  @linebuffer = []
  @textbuffer = []
  @entity_size = nil
  @entity_pos = 0
  @bogus_lines = 0
end