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

Add retryAfterSeconds/maxRequests - Disable HTTPS from UPnP action calls #128

Closed
wants to merge 2 commits into from

Conversation

morph166955
Copy link

@morph166955 morph166955 commented Jan 15, 2021

Code written by: lolodomo - Merged together and submitted by morph166955

Disable all UPnP action calls based on HTTPS - Fixed #109

From openhab/openhab-addons#5892

Mentioned in https://community.openhab.org/t/panasonictv-oh3/108124
https://community.openhab.org/t/too-much-time-before-a-sonos-thing-becomes-definitively-online/62214

New setting retryAfterSeconds

New setting maxRequests to trigger an automatic restart of the router after a certain number of executed requests

Get the stack trace in DEBUG or TRACE level

JAR available at https://github.com/morph166955/jupnp/releases/tag/2.6.0

Signed-off-by: morph166955 rosenblumb@gmail.com

lolodomo and others added 2 commits April 23, 2020 20:28
New setting etryAfterSeconds

New setting maxRequests to trigger an automatic restart of the router after a certain number of executed requests

Get the stack trace in DEBUG or TRACE level

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Disable all UPnP action calls based on HTTPS

New setting retryAfterSeconds

New setting maxRequests to trigger an automatic restart of the router after a certain number of executed requests

Get the stack trace in DEBUG or TRACE level

Signed-off-by: morph166955 <rosenblumb@gmail.com>
@morph166955
Copy link
Author

To be clear up front, I'm only submitting this for the merge, not looking to take credit for the code work. There are still bindings being impacted by some of these issues. I've pulled them all together and submitted one cohesive PR to hopefully resolve these issues.

@morph166955
Copy link
Author

As a note, the Travis build failure I believe is unrelated to this PR. I get the same error when I try to compile the master in it's current state. The OGSi Test Common Library fails. The jar is however created successfully before the failure.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project jupnp-osgi-tests-common: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project jupnp-osgi-tests-common: Compilation failure
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:749)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:118)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)

@morph166955
Copy link
Author

@kaikreuzer given the impending release of OH3.1.0, would it be possible to merge this in and update/release given that there is still a part of the community that is still having issues that this will help mitigate?

@maggu2810
Copy link

maggu2810 commented Feb 2, 2021

Without digging further into the changes:
Is this code change for the downstream project openHAB only?
Doesn't it break the communication to all UPnP stations using valid https?
At least tue topic headlines looks like.

Is https forbidden by the UPnP spec?
It is a while ago I read it.

@morph166955
Copy link
Author

Yes, this was a byproduct of errors found in the logs when used with openhab. I'm considering splitting this in half as I'm preparing a second PR to add some options to the threading to resolve other issues that have conflicts with this PR.

@morph166955
Copy link
Author

Closing this as I've refactored a bunch of the code and this conflicts with that branch. I will reopen with a new PR from that branch.

@morph166955 morph166955 closed this Feb 3, 2021
@morph166955 morph166955 deleted the retryAfterSeconds branch March 21, 2021 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPE if https scheme is used by a UPnP device in the network
3 participants