@ character in password causes the stream not to connect

Gareth

New Member
Hello,

We calling the flashphoner WCS in our application to start a stream and have noticed that the stream is failing to connect. On closer inspection once the url string is decoded if it has an @ character in the password it breaks.

See the error message in the log below:-

15:01:28,022 INFO RestApiRouter - HTTPS-pool-5-thread-340 Use controller class com.flashphoner.rest.server.rest_v2.RestRtspController with path /rest-api/rtsp/startup
15:01:28,023 INFO RestCallController - HTTPS-pool-5-thread-340 handleRequest /rest-api/rtsp/startup params: {uri=rtsp://admin:New@t1234!, localStreamName=9d972590-2db3-4acf-ae23-9e96d0c43c9f}
15:01:28,023 INFO NodeApi - HTTPS-pool-5-thread-340 Play failed cause - Bad URI
15:01:28,023 ERROR RtspAgents - HTTPS-pool-5-thread-340 Can't create rtspClient
com.flashphoner.server.commons.rmi.operations.exception.UrlConflictException: Bad URI
at com.flashphoner.server.remote.A.checkURI(Unknown Source)
at com.flashphoner.server.remote.E.A.C(Unknown Source)
at com.flashphoner.server.remote.E.A.createAgent(Unknown Source)
at com.flashphoner.server.remote.E.A(Unknown Source)
at com.flashphoner.server.remote.E.B(Unknown Source)
at com.flashphoner.server.remote.K.A(Unknown Source)
at com.flashphoner.server.remote.K.B(Unknown Source)
at com.flashphoner.rest.server.NodeApi.startupRtspAgent(Unknown Source)
at com.flashphoner.rest.server.rest_v2.RestRtspController.startup(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at com.flashphoner.rest.server.RestApiRouter.processRequest(Unknown Source)
at com.flashphoner.server.http.handlers.RestApiRequestHandler.process(Unknown Source)
at com.flashphoner.server.http.G.messageReceived(Unknown Source)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(Unknown Source)
at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(Unknown Source)
at org.jboss.netty.handler.codec.http.HttpChunkAggregator.messageReceived(Unknown Source)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(Unknown Source)
at org.jboss.netty.channel.Channels.fireMessageReceived(Unknown Source)
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(Unknown Source)
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(Unknown Source)
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(Unknown Source)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(Unknown Source)
at org.jboss.netty.channel.Channels.fireMessageReceived(Unknown Source)
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(Unknown Source)
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(Unknown Source)
at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(Unknown Source)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.Channels.fireMessageReceived(Unknown Source)
at org.jboss.netty.channel.Channels.fireMessageReceived(Unknown Source)
at org.jboss.netty.channel.socket.nio.NioWorker.read(Unknown Source)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(Unknown Source)
at org.jboss.netty.channel.socket.nio.DeadlockAwareNioWorker.run(Unknown Source)
at org.jboss.netty.util.ThreadRenamingRunnable.run(Unknown Source)
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
15:01:28,023 INFO NodeApi - HTTPS-pool-5-thread-340 Connection failed stream name - rtsp://admin:New@t1234!
15:01:28,023 INFO AgentFactory - HTTPS-pool-5-thread-340 Provide stream initialization result FAILED

Thanks,

Gareth
 

Max

Administrator
Staff member
Good day.
All the characters in a stream name, that are not allowed in URI, should be URI-encoded. For example,
Code:
rtsp://hostname/c@@lstream/channel1
should be set as
Code:
rtsp://hostname/c%40%40lstream/channel1
Please read here, p 6
 

Gareth

New Member
Thank you for the response. I was about to say we do urlencode the username and password but spotted that when we get the stream we split the username:password@streamdomain by the @ character. But with an @ character in the password we are then splitting the stream as username:pass@word. So the bug is with our code. I thought it might be useful to mention incase other developers have the same issue.
 
Top