diff options
Diffstat (limited to 'src/http/mime.h')
| -rw-r--r-- | src/http/mime.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/src/http/mime.h b/src/http/mime.h new file mode 100644 index 0000000..85200cc --- /dev/null +++ b/src/http/mime.h | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | /************************************************************************* | ||
| 2 | * | ||
| 3 | * HTCd - Copyright (C) 1998-2006 Henrik Rydberg | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef MIMEHTTPH | ||
| 21 | #define MIMEHTTPH | ||
| 22 | |||
| 23 | #include <mime/mime.h> | ||
| 24 | #include <mt/dates.h> | ||
| 25 | |||
| 26 | // Entity Headers | ||
| 27 | const mstring allow_tag="Allow"; | ||
| 28 | const mstring accept_tag="Accept"; | ||
| 29 | const mstring accept_charset_tag="Accept-Charset"; | ||
| 30 | const mstring accept_enc_tag="Accept-Encoding"; | ||
| 31 | const mstring accept_lang_tag="Accept-Language"; | ||
| 32 | const mstring accept_range_tag="Accept-Ranges"; | ||
| 33 | const mstring cont_enc_tag="Content-Encoding"; | ||
| 34 | const mstring cont_lang_tag="Content-Language"; | ||
| 35 | const mstring cont_location_tag="Content-Location"; | ||
| 36 | const mstring cont_md5_tag="Content-MD5"; | ||
| 37 | const mstring cont_range_tag="Content-Range"; | ||
| 38 | const mstring expires_tag="Expires"; | ||
| 39 | const mstring lastmod_tag="Last-Modified"; | ||
| 40 | // General headers | ||
| 41 | const mstring cache_tag="Cache-Control"; | ||
| 42 | const mstring connect_tag="Connection"; | ||
| 43 | const mstring date_tag="Date"; | ||
| 44 | const mstring pragma_tag="Pragma"; | ||
| 45 | const mstring trailer_tag="Trailer"; | ||
| 46 | const mstring trans_enc_tag="Transfer-Encoding"; | ||
| 47 | const mstring upgrade_tag="Upgrade"; | ||
| 48 | const mstring via_tag="Via"; | ||
| 49 | const mstring warning_tag="Warning"; | ||
| 50 | // Request headers | ||
| 51 | const mstring auth_tag="Authorization"; | ||
| 52 | const mstring expect_tag="Expect"; | ||
| 53 | const mstring host_tag="Host"; | ||
| 54 | const mstring if_match_tag="If-Match"; | ||
| 55 | const mstring if_mod_tag="If-Modified-Since"; | ||
| 56 | const mstring if_none_tag="If-None-Match"; | ||
| 57 | const mstring if_range_tag="If-Range"; | ||
| 58 | const mstring if_unmod_tag="If-Unmodified-Since"; | ||
| 59 | const mstring max_forwards_tag="Max-Forwards"; | ||
| 60 | const mstring proxy_tag="Proxy-Authorization"; | ||
| 61 | const mstring range_tag="Range"; | ||
| 62 | const mstring referer_tag="Referer"; | ||
| 63 | const mstring te_tag="TE"; | ||
| 64 | const mstring user_agent_tag="User-Agent"; | ||
| 65 | const mstring cookie_tag="Cookie"; | ||
| 66 | // Response headers | ||
| 67 | const mstring age_tag="Age"; | ||
| 68 | const mstring etag_tag="ETag"; | ||
| 69 | const mstring location_tag="Location"; | ||
| 70 | const mstring proxy_authent_tag="Proxy-Authenticate"; | ||
| 71 | const mstring retry_tag="Retry-After"; | ||
| 72 | const mstring server_tag="Server"; | ||
| 73 | const mstring vary_tag="Vary"; | ||
| 74 | const mstring authent_tag="WWW-Authenticate"; | ||
| 75 | const mstring set_cookie_tag="Set-Cookie"; | ||
| 76 | |||
| 77 | class HTTP : public Mime { | ||
| 78 | public: | ||
| 79 | HTTP(); | ||
| 80 | HTTP(const sref& msg) { Init(msg); } | ||
| 81 | |||
| 82 | mstring cache,connect,date,pragma; | ||
| 83 | mstring trailer,trans_enc,upgrade,via,warning; | ||
| 84 | mstring allow,cont_enc,cont_lang,cont_location; | ||
| 85 | mstring cont_md5,cont_range,expires,lastmod; | ||
| 86 | mstring accept,accept_charset,accept_enc,accept_lang,accept_range; | ||
| 87 | |||
| 88 | time_t idate; | ||
| 89 | void putHead(mstream& out) const; | ||
| 90 | protected: | ||
| 91 | int Special(sref line); | ||
| 92 | int Handle(const sref& name, | ||
| 93 | const sref& rawval, | ||
| 94 | const sref& val, | ||
| 95 | const rrpile& opts); | ||
| 96 | }; | ||
| 97 | |||
| 98 | #endif | ||
| 99 | |||
