@@ -278,7 +278,7 @@ static void http_request_cb(struct evhttp_request* req, void* arg)
278
278
static void http_reject_request_cb (struct evhttp_request * req, void *)
279
279
{
280
280
LogPrint (BCLog::HTTP, " Rejecting request while shutting down\n " );
281
- evhttp_send_error (req, HTTP_SERVUNAVAIL, NULL );
281
+ evhttp_send_error (req, HTTP_SERVUNAVAIL, nullptr );
282
282
}
283
283
/* * Event dispatcher thread */
284
284
static bool ThreadHTTP (struct event_base * base, struct evhttp * http)
@@ -319,7 +319,7 @@ static bool HTTPBindAddresses(struct evhttp* http)
319
319
// Bind addresses
320
320
for (std::vector<std::pair<std::string, uint16_t > >::iterator i = endpoints.begin (); i != endpoints.end (); ++i) {
321
321
LogPrint (BCLog::HTTP, " Binding RPC on address %s port %i\n " , i->first , i->second );
322
- evhttp_bound_socket *bind_handle = evhttp_bind_socket_with_handle (http, i->first .empty () ? NULL : i->first .c_str (), i->second );
322
+ evhttp_bound_socket *bind_handle = evhttp_bind_socket_with_handle (http, i->first .empty () ? nullptr : i->first .c_str (), i->second );
323
323
if (bind_handle) {
324
324
CNetAddr addr;
325
325
if (i->first .empty () || (LookupHost (i->first , addr, false ) && addr.IsBindAny ())) {
@@ -393,7 +393,7 @@ bool InitHTTPServer()
393
393
evhttp_set_timeout (http, gArgs .GetArg (" -rpcservertimeout" , DEFAULT_HTTP_SERVER_TIMEOUT));
394
394
evhttp_set_max_headers_size (http, MAX_HEADERS_SIZE);
395
395
evhttp_set_max_body_size (http, MAX_SIZE);
396
- evhttp_set_gencb (http, http_request_cb, NULL );
396
+ evhttp_set_gencb (http, http_request_cb, nullptr );
397
397
398
398
if (!HTTPBindAddresses (http)) {
399
399
LogPrintf (" Unable to bind any endpoint for RPC server\n " );
@@ -451,7 +451,7 @@ void InterruptHTTPServer()
451
451
for (evhttp_bound_socket *socket : boundSockets) {
452
452
evhttp_del_accept_socket (eventHTTP, socket);
453
453
}
454
- evhttp_set_gencb (eventHTTP, http_reject_request_cb, NULL );
454
+ evhttp_set_gencb (eventHTTP, http_reject_request_cb, nullptr );
455
455
}
456
456
if (workQueue)
457
457
workQueue->Interrupt ();
@@ -521,7 +521,7 @@ HTTPEvent::~HTTPEvent()
521
521
}
522
522
void HTTPEvent::trigger (struct timeval * tv)
523
523
{
524
- if (tv == NULL )
524
+ if (tv == nullptr )
525
525
event_active (ev, 0 , 0 ); // immediately trigger event in main thread
526
526
else
527
527
evtimer_add (ev, tv); // trigger after timeval passed
@@ -564,7 +564,7 @@ std::string HTTPRequest::ReadBody()
564
564
* abstraction to consume the evbuffer on the fly in the parsing algorithm.
565
565
*/
566
566
const char * data = (const char *)evbuffer_pullup (buf, size);
567
- if (!data) // returns NULL in case of empty buffer
567
+ if (!data) // returns nullptr in case of empty buffer
568
568
return " " ;
569
569
std::string rv (data, size);
570
570
evbuffer_drain (buf, size);
@@ -673,7 +673,7 @@ void UnregisterHTTPHandler(const std::string &prefix, bool exactMatch)
673
673
std::string urlDecode (const std::string &urlEncoded) {
674
674
std::string res;
675
675
if (!urlEncoded.empty ()) {
676
- char *decoded = evhttp_uridecode (urlEncoded.c_str (), false , NULL );
676
+ char *decoded = evhttp_uridecode (urlEncoded.c_str (), false , nullptr );
677
677
if (decoded) {
678
678
res = std::string (decoded);
679
679
free (decoded);
0 commit comments