~ubuntu-branches/ubuntu/utopic/dovecot/utopic-proposed

« back to all changes in this revision

Viewing changes to src/lib-http/http-parser.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-08 09:35:49 UTC
  • mfrom: (4.1.35 sid)
  • Revision ID: package-import@ubuntu.com-20140108093549-i72o93pux8p0dlaf
Tags: 1:2.2.9-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + Use the autotools-dev dh addon to update config.guess/config.sub for
    arm64.
* Dropped changes, included in Debian:
  - Update Dovecot name to reflect distribution in login greeting.
  - Update Drac plugin for >= 2.0.0 support.
* d/control: Drop dovecot-postfix package as its no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef HTTP_PARSER_H
 
2
#define HTTP_PARSER_H
 
3
 
 
4
/*
 
5
 * Character definitions
 
6
 */
 
7
 
 
8
extern const unsigned char _http_token_char_mask;
 
9
extern const unsigned char _http_value_char_mask;
 
10
extern const unsigned char _http_text_char_mask;
 
11
extern const unsigned char _http_qdtext_char_mask;
 
12
extern const unsigned char _http_ctext_char_mask;
 
13
 
 
14
extern const unsigned char _http_char_lookup[256];
 
15
 
 
16
static inline bool http_char_is_token(unsigned char ch) {
 
17
        return (_http_char_lookup[ch] & _http_token_char_mask) != 0;
 
18
}
 
19
 
 
20
static inline bool http_char_is_value(unsigned char ch) {
 
21
        return (_http_char_lookup[ch] & _http_value_char_mask) != 0;
 
22
}
 
23
 
 
24
static inline bool http_char_is_text(unsigned char ch) {
 
25
        return (_http_char_lookup[ch] & _http_text_char_mask) != 0;
 
26
}
 
27
 
 
28
static inline bool http_char_is_qdtext(unsigned char ch) {
 
29
        return (_http_char_lookup[ch] & _http_qdtext_char_mask) != 0;
 
30
}
 
31
 
 
32
static inline bool http_char_is_ctext(unsigned char ch) {
 
33
        return (_http_char_lookup[ch] & _http_ctext_char_mask) != 0;
 
34
}
 
35
 
 
36
/*
 
37
 * HTTP value parsing
 
38
 */
 
39
 
 
40
struct http_parser {
 
41
        const unsigned char *begin, *cur, *end;
 
42
};
 
43
 
 
44
void http_parser_init(struct http_parser *parser,
 
45
                        const unsigned char *data, size_t size);
 
46
 
 
47
void http_parse_ows(struct http_parser *parser);
 
48
 
 
49
int http_parse_token(struct http_parser *parser, const char **token_r);
 
50
int http_parse_token_list_next(struct http_parser *parser,
 
51
        const char **token_r);
 
52
 
 
53
int http_parse_quoted_string(struct http_parser *parser, const char **str_r);
 
54
int http_parse_word(struct http_parser *parser, const char **word_r);
 
55
 
 
56
#endif