Improve RsUrl

Fix a bug in RsUrl::fromString eating one character when parsing URL
  string with IPv6 host
Offer explicit conversion from sockaddr_storage
This commit is contained in:
Gioacchino Mazzurco 2019-11-11 11:14:28 +01:00
parent aabba04be9
commit 056904c90b
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
2 changed files with 32 additions and 8 deletions

View file

@ -22,6 +22,8 @@
#include "serialiser/rsserializable.h"
struct sockaddr_storage;
/**
* Very simplistic and minimal URL helper class for RetroShare, after looking
* for a small and self-contained C/C++ URL parsing and manipulation library,
@ -36,7 +38,8 @@
struct RsUrl : RsSerializable
{
RsUrl();
RsUrl(const std::string& urlStr);
explicit RsUrl(const std::string& urlStr);
explicit RsUrl(const sockaddr_storage& ssas);
RsUrl& fromString(const std::string& urlStr);
std::string toString() const;