[Libevent-users] evhttp_dispatch_callback fix (so
'/some?this=that' does not match '/something')
Niels Provos
provos at citi.umich.edu
Sat Aug 4 22:15:27 EDT 2007
Thank you. I love unit tests :-) Submitted to trunk.
Niels.
On 8/2/07, Elliot Foster <elliotf-libevent at gratuitous.net> wrote:
> Here's a follow-up with a regression test (attached.)
>
> Elliot
>
> Elliot Foster wrote:
> > Another quick fix for the dispatch callback, for when it goes through
> > available callbacks looking for a match. The problem is that if the
> > request URI has an argument, the comparison is done on the bytes before
> > the url parameter separator. The result is that the lookup will result
> > in mismatches, especially for a request URI like '/?some_arg=some_val'
> > that will match the first callback found.
> >
> > Two potential fixes are attached, one that modifies the string to
> > replace the argument separator with a null char before the strcmp, and
> > another that checks for a null char in the potential match (at the same
> > offset as the argument separator.)
> >
> > Thanks,
> >
> > Elliot
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Libevent-users mailing list
> > Libevent-users at monkey.org
> > http://monkey.org/mailman/listinfo/libevent-users
>
>
>
> _______________________________________________
> Libevent-users mailing list
> Libevent-users at monkey.org
> http://monkey.org/mailman/listinfo/libevent-users
>
>
>
More information about the Libevent-users
mailing list