wandenberg/nginx-push-stream-module

*.b* as backtrace should really be stricter => (\.b[0-9]+)?$

Closed this issue · 2 comments

Hi Wanderberg,

How is it going?
I just have a query/problem about the backtrace option in the channel name.

My problem is that currently any '.b' in the channel name gets interpreted as backtrace parameter and so it breaks when the channel name has a '.b' that is not a backtrace parameter like 'room.beautiful' or 'room.beautiful.b43'

I understand we cannot change the '.b' option for backward compatibility but we can make the detection of the '.b' for backtrace more strict:

  • must be followed by digits [0-9]+
  • must be at the end of the message $

-> in perl regex (?:.b[0-9]+)?

This way it would minimise the chances of channel name being interpreted as backtrace option.

Thank you for your consideration

Hi Matt,

Everything is ok.

Following your suggestion I changed the parser to use regular expression,
not the one you send me, but another more complete.
Now you can use channels names like 'room.beautiful' or
'room.b18.beautiful' to create the channel and retrieve old messages using
'room.beautiful.b43' or 'room.b18.beautiful.b89' as example.
Only .b followed by numbers on the end of text or followed by a slash will
be treated as a backtrack option.

Check if this solution is ok to you.

Regards,
Wandenberg

On Thu, Mar 29, 2012 at 8:34 PM, Matt Lohier <
reply@reply.github.com

wrote:

Hi Wanderberg,

How is it going?
I just have a query/problem about the backtrace option in the channel name.

My problem is that currently any '.b' in the channel name gets interpreted
as backtrace parameter and so it breaks when the channel name has a '.b'
that is not a backtrace parameter like 'room.beautiful' or
'room.beautiful.b43'

I understand we cannot change the '.b' option for backward compatibility
but we can make the detection of the '.b' for backtrace more strict:

  • must be followed by digits [0-9]+
  • must be at the end of the message $

-> in perl regex (?:.b[0-9]+)?

This way it would minimise the chances of channel name being interpreted
as backtrace option.

Thank you for your consideration


Reply to this email directly or view it on GitHub:
#21

It's perfect! I just tested it quickly and it works as you said.

Thanks a lot!!
Matt

On 2 April 2012 10:52, Wandenberg Peixoto <
reply@reply.github.com

wrote:

Hi Matt,

Everything is ok.

Following your suggestion I changed the parser to use regular expression,
not the one you send me, but another more complete.
Now you can use channels names like 'room.beautiful' or
'room.b18.beautiful' to create the channel and retrieve old messages using
'room.beautiful.b43' or 'room.b18.beautiful.b89' as example.
Only .b followed by numbers on the end of text or followed by a slash will
be treated as a backtrack option.

Check if this solution is ok to you.

Regards,
Wandenberg

On Thu, Mar 29, 2012 at 8:34 PM, Matt Lohier <
reply@reply.github.com

wrote:

Hi Wanderberg,

How is it going?
I just have a query/problem about the backtrace option in the channel
name.

My problem is that currently any '.b' in the channel name gets
interpreted
as backtrace parameter and so it breaks when the channel name has a '.b'
that is not a backtrace parameter like 'room.beautiful' or
'room.beautiful.b43'

I understand we cannot change the '.b' option for backward compatibility
but we can make the detection of the '.b' for backtrace more strict:

  • must be followed by digits [0-9]+
  • must be at the end of the message $

-> in perl regex (?:.b[0-9]+)?

This way it would minimise the chances of channel name being interpreted
as backtrace option.

Thank you for your consideration


Reply to this email directly or view it on GitHub:
#21


Reply to this email directly or view it on GitHub:

#21 (comment)