| 1709 | } |
| 1710 | |
| 1711 | void buffer::list::decode_base64(buffer::list& e) |
| 1712 | { |
| 1713 | bufferptr bp(4 + ((e.length() * 3) / 4)); |
| 1714 | int l = ceph_unarmor(bp.c_str(), bp.c_str() + bp.length(), e.c_str(), e.c_str() + e.length()); |
| 1715 | if (l < 0) { |
| 1716 | std::ostringstream oss; |
| 1717 | oss << "decode_base64: decoding failed:\n"; |
| 1718 | hexdump(oss); |
| 1719 | throw buffer::malformed_input(oss.str().c_str()); |
| 1720 | } |
| 1721 | ceph_assert(l <= (int)bp.length()); |
| 1722 | bp.set_length(l); |
| 1723 | push_back(std::move(bp)); |
| 1724 | } |
| 1725 | |
| 1726 | ssize_t buffer::list::pread_file(const char *fn, uint64_t off, uint64_t len, std::string *error) |
| 1727 | { |