mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-02 08:17:13 +00:00
misc fixes
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "network_utilities.hpp"
|
||||
#include "websocket_constants.hpp"
|
||||
|
||||
#include <sstream>
|
||||
#include "md5/md5.h"
|
||||
@@ -153,7 +154,7 @@ bool websocketpp::ws_uri::parse(const std::string& uri) {
|
||||
host = what[2];
|
||||
|
||||
if (what[3] == "") {
|
||||
port = (secure ? 443 : 80);
|
||||
port = (secure ? DEFAULT_SECURE_PORT : DEFAULT_PORT);
|
||||
} else {
|
||||
unsigned int t_port = atoi(std::string(what[3]).substr(1).c_str());
|
||||
|
||||
@@ -182,7 +183,7 @@ std::string websocketpp::ws_uri::base() {
|
||||
|
||||
s << "ws" << (secure ? "s" : "") << "://" << host;
|
||||
|
||||
if (port != (secure ? 443 : 80)) {
|
||||
if (port != (secure ? DEFAULT_SECURE_PORT : DEFAULT_PORT)) {
|
||||
s << ":" << port;
|
||||
}
|
||||
|
||||
@@ -190,6 +191,19 @@ std::string websocketpp::ws_uri::base() {
|
||||
return s.str();
|
||||
}
|
||||
|
||||
std::string websocketpp::ws_uri::str() {
|
||||
std::stringstream s;
|
||||
|
||||
s << "ws" << (secure ? "s" : "") << "://" << host;
|
||||
|
||||
if (port != (secure ? DEFAULT_SECURE_PORT : DEFAULT_PORT)) {
|
||||
s << ":" << port;
|
||||
}
|
||||
|
||||
s << resource;
|
||||
return s.str();
|
||||
}
|
||||
|
||||
void md5_hash_string(char *string,char *hash) {
|
||||
md5_state_t state;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user