Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[http] buffer size overflow with larger JSON #9389

Closed
binderth opened this issue Dec 15, 2020 · 2 comments · Fixed by #9391
Closed

[http] buffer size overflow with larger JSON #9389

binderth opened this issue Dec 15, 2020 · 2 comments · Fixed by #9391
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@binderth
Copy link

Trying to receive a JSON from Mowas (https://warnung.bund.de/bbk.mowas/gefahrendurchsagen.json), I get the following WARN in log and the channel is still NULL:

2020-12-15 13:34:33.920 [WARN ] [p.internal.http.HttpResponseListener] - Requesting 'https://warnung.bund.de/bbk.mowas/gefahrendurchsagen.json' (method='GET', content='null') failed: Buffering capacity 2097152 exceeded

The binding doesn't seem to give me the opportunity to define the buffer size.

My Thing and channel definition:

UID: http:url:mowas
label: HTTP Gefahren MoWas
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: false
  baseURL: https://warnung.bund.de/bbk.mowas/gefahrendurchsagen.json
  refresh: 600
  commandMethod: GET
  contentType: application/json
  timeout: 3000
channels:
  - id: mowasJSON
    channelTypeUID: http:string
    label: JSON von Mowas
    description: ""
    configuration: {}

Expected Behavior

Having a attribute for the binding regarding buffer size if too small

Current Behavior

Binding breaks with a WARN in the log

Possible Solution

Steps to Reproduce (for Bugs)

  1. use the URL above as it is currently pretty big JSON response
  2. see in log

Context

I try to get the whole JSON to filter out the messages I'd like to use in OH3

Your Environment

  • OH3.RC1 on Raspberry PI 3B+
  • openHABIAN 1.6
@binderth binderth added the bug An unexpected problem or unintended behavior of an add-on label Dec 15, 2020
@J-N-K J-N-K changed the title [HTTP OH3] buffer size overflow with larger JSON [http] buffer size overflow with larger JSON Dec 15, 2020
@J-N-K J-N-K self-assigned this Dec 15, 2020
@MHerbst
Copy link
Contributor

MHerbst commented Dec 15, 2020

As far as I can see, the binding uses a blocking call. This method does not support larger buffers. The Jetty call can be changed to a non-blocking call and then larger buffers are supported. I had a similar problem in the Homematic binding.

@J-N-K
Copy link
Member

J-N-K commented Dec 15, 2020

Nope, not a blocking call, real async processing. For „BufferingResponseListener“ the buffer size is configurable. It was not exposed, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants