Skip to content

Commit 3d200bf

Browse files
committed
Removed the last commit..
Tracking of memory in use should be done through the share ptr's destructor
1 parent d964486 commit 3d200bf

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed

include/WS_Lite.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ namespace WS_LITE {
167167
virtual bool is_v4() const = 0;
168168
virtual bool is_v6() const = 0;
169169
virtual bool is_loopback() const = 0;
170-
// this will return the amount of data queued up but has not yet been submitted to the OS to be sent
171-
virtual size_t get_DataPending() const = 0;
172170
virtual void send(const WSMessage &msg, bool compressmessage) = 0;
173171
// send a close message and close the socket
174172
virtual void close(unsigned short code = 1000, const std::string &msg = "") = 0;
@@ -188,8 +186,6 @@ namespace WS_LITE {
188186
virtual void set_WriteTimeout(std::chrono::seconds seconds) = 0;
189187
// get the current write timeout in seconds
190188
virtual std::chrono::seconds get_WriteTimeout() = 0;
191-
// this will return the amount of data queued up but has not yet been submitted to the OS to be sent
192-
virtual size_t get_DataPending() const = 0;
193189
};
194190
class WS_LITE_EXTERN IWSListener_Configuration {
195191
public:

include/internal/DataStructures.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ namespace WS_LITE {
104104
std::chrono::seconds WriteTimeout = std::chrono::seconds(30);
105105
size_t MaxPayload = 1024 * 1024 * 20; // 20 MB
106106
bool TLSEnabled = false;
107-
size_t DataPending = 0;
108107

109108
std::function<void(const std::shared_ptr<IWSocket> &, const std::unordered_map<std::string, std::string> &)> onConnection;
110109
std::function<void(const std::shared_ptr<IWSocket> &, const WSMessage &)> onMessage;
@@ -164,7 +163,6 @@ namespace WS_LITE {
164163
sendclosemessage<isServer>(p, self, code, msg);
165164
}
166165
}
167-
virtual size_t get_DataPending() const override { return DataPending; }
168166
void canceltimers()
169167
{
170168
std::error_code ec;
@@ -189,7 +187,6 @@ namespace WS_LITE {
189187
asio::basic_waitable_timer<std::chrono::steady_clock> write_deadline;
190188
asio::strand strand;
191189
std::deque<SendQueueItem> SendMessageQueue;
192-
size_t DataPending = 0;
193190
};
194191

195192
} // namespace WS_LITE

include/internal/WebSocketProtocol.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ namespace WS_LITE {
202202
if (msg.code == OpCode::CLOSE) {
203203
socket->SocketStatus_ = SocketStatus::CLOSING;
204204
}
205-
socket->DataPending += msg.len;
206-
socket->Parent->DataPending += msg.len;
207205
socket->SendMessageQueue.emplace_back(SendQueueItem{msg, compressmessage});
208206
SL::WS_LITE::startwrite<isServer>(parent, socket);
209207
}
@@ -257,10 +255,7 @@ namespace WS_LITE {
257255
return handleclose(parent, socket, 1002, "write header failed " + ec.message());
258256
}
259257
assert(msg.len == bytes_transferred);
260-
socket->DataPending -= msg.len;
261-
socket->Parent->DataPending -= msg.len;
262258
startwrite<isServer>(parent, socket);
263-
264259
}));
265260
}
266261

@@ -557,7 +552,6 @@ namespace WS_LITE {
557552
virtual std::chrono::seconds get_ReadTimeout() override;
558553
virtual void set_WriteTimeout(std::chrono::seconds seconds) override;
559554
virtual std::chrono::seconds get_WriteTimeout() override;
560-
virtual size_t get_DataPending() const override { return Impl_->DataPending; }
561555
};
562556
class WSListener : public IWSHub {
563557
std::shared_ptr<WSContextImpl> Impl_;
@@ -571,7 +565,6 @@ namespace WS_LITE {
571565
virtual std::chrono::seconds get_ReadTimeout() override;
572566
virtual void set_WriteTimeout(std::chrono::seconds seconds) override;
573567
virtual std::chrono::seconds get_WriteTimeout() override;
574-
virtual size_t get_DataPending() const override { return Impl_->DataPending; }
575568
};
576569

577570
class WSListener_Configuration : public IWSListener_Configuration {

0 commit comments

Comments
 (0)