protocol-http2 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85110feabc1cc1bb5247a1a7f6c6688b2e3bf9c647e7b6220c6371f1d9ffa2c6
4
- data.tar.gz: 8376acd100932d35bc4a3c0a58b74b62cbb395e6d2bf87ca07e48baf9c0bd017
3
+ metadata.gz: 07e136ae45032565eec301ae8ed9ad6e3fef788325a55f2320e61d5d4c421251
4
+ data.tar.gz: 553f5a65749ccfe5ddb96a70aa71d1682a2894c91056b4c29f19368dc8cdef10
5
5
  SHA512:
6
- metadata.gz: 5ceade72df2cb2876365da7d3b9599d7d0ad15c83630865f8fa7b845f61383a490c7a8c4ee965af251cd265e27309009e2d8718d2e94919aee152870a1623174
7
- data.tar.gz: '08f5d7dd7b8824ee59b20d168dc9d323f5972aa2adb0cf8f3ffc4e64794f741ee96523cf6195674310263711dc44e585ef868deb58dcbb0ef321c7d2888f9218'
6
+ metadata.gz: accd7dd026ccba821544eb29c3c2d72c5a3894977cf564b48b8cc96de1b6fb041e3a8876f056844f9bcf4a0b8790581674402eab6be63ee7992203bfe1b544b9
7
+ data.tar.gz: '028d74d81f74dcd289330c2cb2f72793c55f9f887c2bf7e5f73c2eb7c7c5ff8371b654725f2a18c5849a2f441c286f91fabe90b949bddbf79e6b05292128172a'
@@ -329,7 +329,7 @@ module Protocol
329
329
 
330
330
  close!
331
331
  else
332
- raise ProtocolError, "Cannot reset stream in state: #{@state}"
332
+ raise ProtocolError, "Cannot send reset stream (#{error_code}) in state: #{@state}"
333
333
  end
334
334
  end
335
335
 
@@ -370,7 +370,8 @@ module Protocol
370
370
 
371
371
  return process_headers(frame)
372
372
  else
373
- raise ProtocolError, "Cannot receive headers in state: #{@state}"
373
+ Async.logger.warn(self) {"Received headers in state: #{@state}!"}
374
+ self.send_reset_stream(Error::STREAM_CLOSED)
374
375
  end
375
376
  end
376
377
 
@@ -398,7 +399,9 @@ module Protocol
398
399
  close!
399
400
  end
400
401
  else
401
- raise ProtocolError, "Cannot receive data in state: #{@state}"
402
+ # If a DATA frame is received whose stream is not in "open" or "half-closed (local)" state, the recipient MUST respond with a stream error (Section 5.4.2) of type STREAM_CLOSED.
403
+ Async.logger.warn(self) {"Received data in state: #{@state}!"}
404
+ self.send_reset_stream(Error::STREAM_CLOSED)
402
405
  end
403
406
  end
404
407
 
@@ -422,14 +425,19 @@ module Protocol
422
425
  end
423
426
 
424
427
  def receive_reset_stream(frame)
425
- if @state != :idle and @state != :closed
426
- error_code = frame.unpack
427
-
428
- close!(error_code)
428
+ error_code = frame.unpack
429
+
430
+ if @state != :idle
431
+ if self.closed?
432
+ Async.logger.warn(self) {"Received reset stream (#{error_code}) in state: #{@state}!"}
433
+ else
434
+ close!(error_code)
435
+ end
429
436
 
430
437
  return error_code
431
438
  else
432
- raise ProtocolError, "Cannot reset stream in state: #{@state}"
439
+ # If a RST_STREAM frame identifying an idle stream is received, the recipient MUST treat this as a connection error (Section 5.4.1) of type PROTOCOL_ERROR.
440
+ raise ProtocolError, "Cannot receive reset stream (#{error_code}) in state: #{@state}!"
433
441
  end
434
442
  end
435
443
 
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Protocol
22
22
  module HTTP2
23
- VERSION = "0.8.0"
23
+ VERSION = "0.8.1"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams