Branch: Tag:

2002-01-29

2002-01-29 21:51:41 by Martin Stjernholm <mast@lysator.liu.se>

Deprecated add_http_header. Fixed a couple of places where it was
used.

Rev: server/etc/modules/Roxen.pmod:1.130

1:   // This is a roxen pike module. Copyright © 1999 - 2001, Roxen IS.   // - // $Id: Roxen.pmod,v 1.129 2001/11/05 13:34:09 grubba Exp $ + // $Id: Roxen.pmod,v 1.130 2002/01/29 21:51:41 mast Exp $      #include <roxen.h>   #include <config.h>
184:   }      mapping add_http_header(mapping to, string name, string value) + //! Adds a header @[name] with value @[value] to the header style + //! mapping @[to] (which commonly is @tt{id->misc[" _extra_heads"]@}) + //! if no header with that value already exist. + //! + //! @note + //! This function doesn't notify the RXML p-code cache, which makes it + //! inappropriate to use for updating @tt{id->misc[" _extra_heads"]@} + //! in RXML tags (which has been its primary use). Use + //! @[RequestID.add_response_header] instead.   {    if(to[name]) {    if(arrayp(to[name])) {
3061:    if (!c) c = RXML_CONTEXT;    if(c->id->cookies[var]!=val) {    c->id->cookies[var]=val; -  add_http_header(c->misc[" _extra_heads"], "Set-Cookie", http_encode_cookie(var)+ +  c->id->add_response_header ( +  "Set-Cookie", http_encode_cookie(var)+    "="+http_encode_cookie( val )+    "; expires="+http_date(time(1)+(3600*24*365*2))+"; path=/");    }
3078:    if (!c) c = RXML_CONTEXT;    if(!c->id->cookies[var]) return;    predef::m_delete(c->id->cookies, var); -  add_http_header(c->misc[" _extra_heads"], "Set-Cookie", +  c->id->add_response_header ( +  "Set-Cookie",    http_encode_cookie(var)+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/");    }   
3356:    int|void expire_time_delta,    string|void domain,    int(1..1)|string|void path ) - //! Set the cookie specified by @[name] to @[value]. - //! Adds a Set-Cookie header to the id->misc->moreheads mapping. + //! Set the cookie specified by @[name] to @[value]. Adds a Set-Cookie + //! header in the response that will be made from @[id].   //!   //! @param expire_time_delta   //! If the expire_time_delta variable is -1, the cookie is set to
3383:       if( domain ) cookie += "; domain="+http_encode_cookie( domain );    if( path!=1 ) cookie += "; path="+http_encode_cookie( path||"" ); -  if(!id->misc->moreheads) -  id->misc->moreheads = ([]); -  add_http_header( id->misc->moreheads, "Set-Cookie",cookie ); +  id->add_response_header ("Set-Cookie", cookie);   }      void remove_cookie( RequestID id,