ostinelli / apnotic

A Ruby APNs HTTP/2 gem able to provide instant feedback.
MIT License
477 stars 94 forks source link

Streams unavailable after connection error #58

Closed ta222 closed 6 years ago

ta222 commented 6 years ago

After the Errno::ECONNRESET - Connection reset by peer error the remote_max_concurrent_streams changed to 0 (the @client.remote_settings[:settings_max_concurrent_streams] == 0x7fffffff) and the request enters into an infinite loop.

def delayed_push_async(push) until streams_available? do sleep 0.001 end @client.call_async(push.http2_request) end

def streams_available? remote_max_concurrent_streams - @client.stream_count > 0 end