Fixed invalid read bug in socket library, added some static accessors

This commit is contained in:
Thulinma 2020-09-14 10:44:25 +02:00
parent ef1ee853b9
commit 66dff82144
2 changed files with 21 additions and 2 deletions

View file

@ -63,6 +63,7 @@ namespace Socket{
void prepend(const char *newdata, const unsigned int newdatasize);
std::string &get();
bool available(unsigned int count);
bool available(unsigned int count) const;
std::string remove(unsigned int count);
std::string copy(unsigned int count);
void clear();
@ -141,6 +142,7 @@ namespace Socket{
bool spool(); ///< Updates the downbufferinternal variables.
bool peek(); ///< Clears the downbuffer and fills it with peek
Buffer &Received(); ///< Returns a reference to the download buffer.
const Buffer &Received() const; ///< Returns a reference to the download buffer.
void SendNow(const std::string &data); ///< Will not buffer anything but always send right away. Blocks.
void SendNow(const char *data); ///< Will not buffer anything but always send right away. Blocks.
void SendNow(const char *data,