~ubuntu-branches/ubuntu/precise/crossroads/precise

« back to all changes in this revision

Viewing changes to xr/httpbuffer/httpbuffer

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ritter
  • Date: 2010-07-05 16:27:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100705162700-0g08tfav8ee9y51u
Tags: upstream-2.65
ImportĀ upstreamĀ versionĀ 2.65

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _HTTPBUFFER_
 
2
#define _HTTPBUFFER_
 
3
 
 
4
#include "sys/sys"
 
5
#include "netbuffer/netbuffer"
 
6
#include "config/config"
 
7
#include "profiler/profiler"
 
8
 
 
9
class Httpbuffer: public Netbuffer {
 
10
public:
 
11
 
 
12
    // Recognized request methods. Modify requestmethod.cc to add more.
 
13
    enum RequestMethod {
 
14
        m_get,
 
15
        m_other,
 
16
    };
 
17
    
 
18
    Httpbuffer();
 
19
 
 
20
    bool headersreceived();
 
21
    
 
22
    string headerval (string const &var);
 
23
    string &firstline();
 
24
    string url();
 
25
 
 
26
    bool setversion(char v);
 
27
 
 
28
    void setheader (string const &var, string const &val);
 
29
    void setheader (string const &h);
 
30
 
 
31
    void addheader (string const &var, string const &val);
 
32
    void addheader (string const &h);
 
33
 
 
34
    void replaceheader (string const &var, string const &val);
 
35
    void replaceheader (string const &h);
 
36
 
 
37
    string cookievalue (string var);
 
38
    string paramvalue(string var);
 
39
 
 
40
    RequestMethod requestmethod();
 
41
 
 
42
    string requesturi();
 
43
 
 
44
    void reset();
 
45
 
 
46
private:    
 
47
    unsigned findheader (string h);
 
48
    unsigned bodystart;
 
49
    string first_line;
 
50
};
 
51
 
 
52
#endif