~ubuntu-branches/ubuntu/wily/cxxtools/wily-proposed

« back to all changes in this revision

Viewing changes to src/http/messageheader.cpp

  • Committer: Package Import Robot
  • Author(s): Kari Pahula
  • Date: 2012-04-28 10:30:29 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120428103029-qc8v0sb4yb8h1542
Tags: 2.1-1
* New upstream release (SONAME 8)
  - Removed patch gcc4.7_ftbfs_fix since upstream source is GCC 4.7 safe.
  - Patches iconvstream_size_t_fix, configure.in_fixes and
    arm_gcc4.6_ftbfs_fix removed since they have been implemented in
    upstream source.
* Standards-Version 3.9.3.
* Use dh-autoreconf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
namespace http
43
43
{
44
44
 
45
 
int MessageHeader::StringLessIgnoreCase::compare
46
 
    (const char* s1, const char* s2)
 
45
namespace
 
46
{
 
47
 
 
48
int compareIgnoreCase(const char* s1, const char* s2)
47
49
{
48
50
    const char* it1 = s1;
49
51
    const char* it2 = s2;
66
68
                : *it2 ? -1 : 0;
67
69
}
68
70
 
69
 
const unsigned MessageHeader::MAXHEADERSIZE;
 
71
 
72
 
70
73
 
71
74
const char* MessageHeader::getHeader(const char* key) const
72
75
{
73
76
    for (const_iterator it = begin(); it != end(); ++it)
74
77
    {
75
 
        if (StringLessIgnoreCase::compare(key, it->first) == 0)
 
78
        if (compareIgnoreCase(key, it->first) == 0)
76
79
            return it->second;
77
80
    }
78
81
 
84
87
    const char* h = getHeader(key);
85
88
    if (h == 0)
86
89
        return false;
87
 
    return StringLessIgnoreCase::compare(h, value) == 0;
 
90
    return compareIgnoreCase(h, value) == 0;
88
91
}
89
92
 
90
93
void MessageHeader::clear()
131
134
    const_iterator it = begin();
132
135
    while (it != end())
133
136
    {
134
 
        if (StringLessIgnoreCase::compare(key, it->first) == 0)
 
137
        if (compareIgnoreCase(key, it->first) == 0)
135
138
        {
136
139
            unsigned slen = it->second - it->first + std::strlen(it->second) + 1;
137
140
 
177
180
        return httpVersionMajor() == 1
178
181
            && httpVersionMinor() >= 1;
179
182
    else
180
 
        return StringLessIgnoreCase().compare(ch, "keep-alive") == 0;
 
183
        return compareIgnoreCase(ch, "keep-alive") == 0;
181
184
}
182
185
 
183
186
char* MessageHeader::htdateCurrent(char* buffer)
190
193
    unsigned sec = 0;
191
194
    unsigned msec = 0;
192
195
 
193
 
    cxxtools::DateTime dt = cxxtools::Clock::getSystemTime();
 
196
    DateTime dt = Clock::getSystemTime();
194
197
    dt.get(year, month, day, hour, min, sec, msec);
195
198
    unsigned dayOfWeek = dt.date().dayOfWeek();
196
199