Cleanups.

This commit is contained in:
JoelKatz
2012-01-01 02:58:30 -08:00
parent 0a8b9056b6
commit 3de74d1eb2
2 changed files with 8 additions and 3 deletions

View File

@@ -2,10 +2,12 @@
#include <iostream>
#include <stdlib.h>
#include <boost/asio.hpp>
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/algorithm/string.hpp>
#include <openssl/buffer.h>
#include <openssl/evp.h>
@@ -28,7 +30,7 @@ inline bool isSwitchChar(char c)
#endif
}
std::string EncodeBase64(std::string s)
std::string EncodeBase64(const std::string& s)
{ // FIXME: This performs terribly
BIO *b64, *bmem;
BUF_MEM *bptr;
@@ -38,7 +40,7 @@ std::string EncodeBase64(std::string s)
bmem = BIO_new(BIO_s_mem());
b64 = BIO_push(b64, bmem);
BIO_write(b64, s.c_str(), s.size());
BIO_flush(b64);
(void) BIO_flush(b64);
BIO_get_mem_ptr(b64, &bptr);
std::string result(bptr->data, bptr->length);

View File

@@ -1,4 +1,7 @@
#include <string>
#include "json/value.h"
extern int commandLineRPC(int argc, char *argv[]);
extern Json::Value callRPC(const std::string& strMethod, const Json::Value& params);
extern Json::Value callRPC(const std::string& strMethod, const Json::Value& params);