protocol-http2 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/protocol/http2/stream.rb +16 -8
- data/lib/protocol/http2/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07e136ae45032565eec301ae8ed9ad6e3fef788325a55f2320e61d5d4c421251
|
4
|
+
data.tar.gz: 553f5a65749ccfe5ddb96a70aa71d1682a2894c91056b4c29f19368dc8cdef10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz: '
|
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
|
-
|
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
|
-
|
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
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
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
|
-
|
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
|
|