-rw-r--r-- | lib/consumer.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/consumer.cc b/lib/consumer.cc index f9212ea..d578546 100644 --- a/lib/consumer.cc +++ b/lib/consumer.cc | |||
@@ -1,34 +1,35 @@ | |||
1 | #include <algorithm> | 1 | #include <algorithm> |
2 | #include <cassert> | 2 | #include <cassert> |
3 | #include <cstring> | ||
3 | #include <opkele/util.h> | 4 | #include <opkele/util.h> |
4 | #include <opkele/exception.h> | 5 | #include <opkele/exception.h> |
5 | #include <opkele/data.h> | 6 | #include <opkele/data.h> |
6 | #include <opkele/consumer.h> | 7 | #include <opkele/consumer.h> |
7 | #include <openssl/sha.h> | 8 | #include <openssl/sha.h> |
8 | #include <openssl/hmac.h> | 9 | #include <openssl/hmac.h> |
9 | #include <curl/curl.h> | 10 | #include <curl/curl.h> |
10 | 11 | ||
11 | #include <iostream> | 12 | #include <iostream> |
12 | 13 | ||
13 | #include "config.h" | 14 | #include "config.h" |
14 | 15 | ||
15 | #include <pcre.h> | 16 | #include <pcre.h> |
16 | 17 | ||
17 | namespace opkele { | 18 | namespace opkele { |
18 | using namespace std; | 19 | using namespace std; |
19 | 20 | ||
20 | class pcre_matches_t { | 21 | class pcre_matches_t { |
21 | public: | 22 | public: |
22 | int *_ov; | 23 | int *_ov; |
23 | int _s; | 24 | int _s; |
24 | 25 | ||
25 | pcre_matches_t() : _ov(0), _s(0) { } | 26 | pcre_matches_t() : _ov(0), _s(0) { } |
26 | pcre_matches_t(int s) : _ov(0), _s(s) { | 27 | pcre_matches_t(int s) : _ov(0), _s(s) { |
27 | if(_s&1) ++_s; | 28 | if(_s&1) ++_s; |
28 | _s += _s>>1; | 29 | _s += _s>>1; |
29 | _ov = new int[_s]; | 30 | _ov = new int[_s]; |
30 | } | 31 | } |
31 | ~pcre_matches_t() throw() { if(_ov) delete[] _ov; } | 32 | ~pcre_matches_t() throw() { if(_ov) delete[] _ov; } |
32 | 33 | ||
33 | int begin(int i) const { return _ov[i<<1]; } | 34 | int begin(int i) const { return _ov[i<<1]; } |
34 | int end(int i) const { return _ov[(i<<1)+1]; } | 35 | int end(int i) const { return _ov[(i<<1)+1]; } |