/************************************************************************* * * HTCd - Copyright (C) 1998-2006 Henrik Rydberg * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include const mstring tag="T."; const mstring ncookie_tag="ncookie"; const mstring multipart_tag="multipart"; const mstring body_tag="T.body"; static mstring Tag(const sref& in) { mstring name=in; for(int i=0;ibody; nb.append(1,' '); nb+=b; Const(map,s,nb,tok_t::PUBLIC,1); } else Const(map,s,b,tok_t::PUBLIC); } static void PushMultipart(tokmap& map,const Mime& root) throw(merror_t) { rpile part; if(root.Multipart(part)) { for(int i=0;idata),msg.body); else if(eqn(msg.cont_trans_enc,trans_quote)) decodeQP(via(tok->data),msg.body); else via(tok->data)<first,tok_t::PUBLIC); Const(map,val,p->second,tok_t::PUBLIC); n++; } if(req.arg.nempty()) PushWWWForm(map,req.arg); } void envAddForm(tokmap& map,const httpReq& req) { if(req.method==HTTP_POST) { if(req.cont_type.find(multipart_tag,cset_lcase)>=0) PushMultipart(map,req); else PushWWWForm(map,req.body); } else if(req.method==HTTP_PUT) { Const(map,body_tag,req.body,tok_t::PUBLIC); } }