aboutsummaryrefslogtreecommitdiff
path: root/src/rpcprotocol.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Split up util.cpp/hWladimir J. van der Laan2014-08-261-0/+3
| | | | | | | | | | | | | | | | Split up util.cpp/h into: - string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach) - money utilities (parsesmoney, formatmoney) - time utilities (gettime*, sleep, format date): - and the rest (logging, argument parsing, config file parsing) The latter is basically the environment and OS handling, and is stripped of all utility functions, so we may want to rename it to something else than util.cpp/h for clarity (Matt suggested osinterface). Breaks dependency of sha256.cpp on all the things pulled in by util.
* Move `*Version()` functions to version.h/cppWladimir J. van der Laan2014-08-261-0/+1
|
* Remove size limit in RPC client, keep it in serverWladimir J. van der Laan2014-08-061-2/+2
| | | | | | | | | | The size limit makes a lot of sense for the server, as it never has to accept very large data. The client, however, can request arbitrary amounts of data with `listtransactions` on a large wallet. Fixes #4604.
* Avoid a copy in RPC outputWladimir J. van der Laan2014-08-061-8/+15
| | | | | | | | Split up HTTPReply into HTTPReply and HTTPReplyHeader, so that the message data can be streamed directly. Also removes a c_str(), which would have prevented binary output with NUL characters in it.
* rpc: Prevent easy memory exhaustion attackWladimir J. van der Laan2014-07-041-2/+14
| | | | | | | Allocate memory for POST message data only as bytes come in, instead of all at once at the beginning. Fixes #4343.
* fix RPC error replieskazcw2014-06-281-19/+23
| | | | | | | | | | | | | After pull #4288, RPC messages indicating errors have a Content-Length unrelated to their actual contents, rendering bitcoin-cli and curl unable to decode the reply. This patch sets the Content-Length field based on the actual content returned. Additionally, pull #4288 clobbered the error descriptions provided in ErrorReply, which bitcoin-cli relies upon; this patch moves #4288 http-error descriptions to an HTTPError method, allowing HTTPReply to pass content on unchanged.
* Move AcceptedConnection class to rpcserver.h.Jeff Garzik2014-06-271-2/+2
| | | | Also, add parens to HTTPReply() to assist readability.
* RPC cleanup: Improve HTTP server repliesJeff Garzik2014-06-261-3/+14
| | | | | | | 1) support varying content types 2) support only sending the header 3) properly deliver error message as content, if HTTP error 4) move AcceptedConnection class to header, for wider use
* Replace non-threadsafe gmtime and setlocaleWladimir J. van der Laan2014-05-231-9/+1
| | | | | | | Make DateTimeStrFormat use boost::posix_time. Also re-enable the util_DateTimeStrFormat tests, as they are no longer platform specific.
* Remove dummy PRIszX macros for formattingWladimir J. van der Laan2014-05-061-1/+1
| | | | | | | | | Size specifiers are no longer needed now that we use typesafe tinyformat for string formatting, instead of the system's sprintf. No functional changes. This continues the work in #3735.
* Update moved and dead linksLuke Dashjr2014-03-241-1/+1
|
* Remove unused includes of boost lexical_castWladimir J. van der Laan2014-03-071-1/+0
| | | | We don't use lexical_cast anywhere, no need to include it.
* Copyright header updates s/2013/2014 on files whose last git commit was done ↵gubatron2014-02-091-1/+1
| | | | | | in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
* Remove redundant .c_str()sWladimir J. van der Laan2014-01-231-4/+4
| | | | | | | After the tinyformat switch sprintf() family functions support passing actual std::string objects. Remove unnecessary c_str calls (236 of them) in logging and formatting.
* Split up bitcoinrpc (code movement only)Wladimir J. van der Laan2013-11-271-0/+262
Split bitcoinrpc up into - rpcserver: bitcoind RPC server - rpcclient: bitcoin-cli RPC client - rpcprotocol: shared common HTTP/JSON-RPC protocol code One step towards making bitcoin-cli independent from the rest of the code, and thus a smaller executable that doesn't have to be linked against leveldb. This commit only does code movement, there are no functional changes.