Previous Next

Thread: SetHeader in HTTP_FILTER_AUTH_COMPLETE_INFO

Last post 04-15-2008 12:50 PM by cheeso. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 04-15-2008, 12:33 PM

    • cheeso
    • Not Ranked
    • Joined on 12-10-2002, 10:42 AM
    • Posts 6
    • cheeso

    SetHeader in HTTP_FILTER_AUTH_COMPLETE_INFO

    I read the doc (http://msdn2.microsoft.com/en-us/library/ms525099(VS.85).aspx), but there's something I'm not clear on.

    When i call SetHeader(), does the lpszValue get copied as a pointer?  or does the content of lpszValue get copied to a buffer that is maintained by IIS? 

    In my filter, I allocate a buffer during the request, call SetHeader() using that allocated string pointer, and then before the request ends, I call free().  Is this a bug? 

    Would it be better if I did AllocMem() and then allowed the memory to be automatically freed?

    A related question - is it ever wise to use malloc/free within the context of a filter, or should I just always use AllocMem() and get the free "for free" ?

    thanks!

    Tags:
  • 04-15-2008, 12:42 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 988
    • anilr

    Re: SetHeader in HTTP_FILTER_AUTH_COMPLETE_INFO

    The contents of lpszValue get copied to a buffer maintained by IIS - one issue with using AllocMem rather than malloc/free is that memory allocated by AllocMem is not freed until that connection goes away which can cause the memory usage to grow a lot in case of many keep-alive requests.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 04-15-2008, 12:50 PM In reply to

    • cheeso
    • Not Ranked
    • Joined on 12-10-2002, 10:42 AM
    • Posts 6
    • cheeso

    Re: SetHeader in HTTP_FILTER_AUTH_COMPLETE_INFO

    Thanks for the speedy reply, Anil.

    Is it worth updating the doc to clarify that point?

Page 1 of 1 (3 items)
Page view counter