Re: Detecting potential regular expression matches?



On Sat, 1 Jul 2006, Fredderic wrote:

The problem, is what happens when I don't recognise the incoming data.
At the moment, the new connection handler checks the size of the
buffer, and dumps the connection if the buffer exceeds a certain size.
It also has a timeout going to dump the connection if it isn't
recognised in a certain time frame. What I would like to be able to
do, is start off with a list of all the known handlers, and knock them
off the list as they get ruled out. Then instead of having to fill a
buffer to a certain point or sit there waiting for a timeout
(which is what happens when someone telnets the server and messes up
their entry), I can dump the connection as soon as it runs out of
potential matches (the binary streams look like binary streams very
early on, so all non-matching text connections can be dumped at the
first end-of-line).

How compliated are the regular expressions in question? Do any use
alternation or positive/negative lookahead? Can you post a few examples?

Off the top of my head, I think one possible approach would be to
construct your regexps as a list of atoms/smaller patterns then you could
do [join $reList ""] to test w/regexp (or [lindex $reList 0] or [join
[lrange $reList 0 2] ""], etc.)

Thanks,

Michael
.



Relevant Pages

  • Re: Context of error messages with respect to BSD sockets
    ... under what circumstances will send or recv block? ... A 'connection mode' socket usually has an in-kernel send and ... receive buffer associated with it. ... this signifies that the connection has closed ...
    (comp.unix.programmer)
  • WMP9 Performance tab - Use it, or no?
    ... If I let WMP detect the connection speed, ... the audio plays a half second, breaks for a half second, plays for ... If I extend the buffer out to the max, I do get decent playback, ... Only 2 years ago NASA was using the older format ...
    (microsoft.public.windowsmedia.player)
  • Re: help out a boob? whats wrong with this? callback not firing when called recursively
    ... sender has not closed the connection. ... much as all of the rest of the data or the size of your buffer (whichever ... But just as you need to be able to reassemble ... Since reassembling delimiters isn't any different from reassembling the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: embedded tcp input only optimizations
    ... todays syn flood prevention algorithms in place I think ... interupt based on the timer and deal there with segment ... same time summarize it in a CPU register, then store it in your buffer ... stack should only deal with one connection at a time. ...
    (comp.arch.embedded)
  • Re: MFC Not Triggering OnReceive
    ... simple program that listens for a connection, ... program and i cannot get myonReceiveto trigger. ... when i send data to it the buffer receives the data but theonReceive ... the framework automatically calls the OnReceive function. ...
    (microsoft.public.vc.mfc)