On Mon, 11 Aug 2003 20:52:24 -0700 Lamont Lucas <[EMAIL PROTECTED]> wrote:
> Hi. I've been happily using flood for almost a year now and I wanted > to ask about perhaps either adding a feature or finding a > new way to do what I'm looking for. > > Specifically, I have a urllist that needs cookies preloaded > to determine behavior. I know I can work around this by > including urls in my urllist that go to a different page that simply > loads the cookie I need for the next request, but that is pretty > messy. > > What I'm looking for is an element in <url>, something like > "cookie-payload" that has all or most of a cookie to be presented > for that url. I don't know if it makes sense to do it as one string > that has the version, header and value in it (along with the > secure setting and whatever else I'm forgetting) or > as seperate subparts in there. Well... <url> element is really bloated with all the attributes, which makes configuration hard to write/read/maintain. So the best way would be to have separate XML block like this: <cookies> <cookie> <host>www.example.com</host> <name>foo</name> <content>bar</content> <path>/</path> <secure>no</secure> <expires>some date</expires> </cookie> </cookies> Then, in get_next_url, we could see what cookies match current host and path, and sent them if apropriate. However that requires a bit of work, and probably ain't going to happen any time soon, as we're a bit busy at the moment with other things. So a simple: <url sendcookie="name=value">http://www.example.com</url> would be nice, until we decide to have a better cookie support. > Would that be possible, or even reasonable? Yup. > I tried adding it myself > but was daunted by the size of the task. Before I start it I > was hoping for a sanity check that what I was asking for was > reasonable and maybe some pointers as to where to start. Just look at flood_round_robin.c. You have a definition of cookie_t type there. You just could define another attribute in url (yuck!) (see config.h.in), parse it at parse_xml_url_info() (see flood_round_robin.c), and add it to profile_t->cookie->next. Your cookie will be included in request as you can see from the code in round_robin_create_req (flood_round_robin.c again). regards, Jacek Prucia