diff options
author | Florent Le Coz <louiz@louiz.org> | 2014-02-28 01:14:38 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2014-02-28 01:14:38 +0100 |
commit | 86d4347af8532ef85472e47c01d645fa5ad1b3b1 (patch) | |
tree | ddc9e019b89b216bed33911a2e2aeb03c668443c /src/xmpp/xmpp_component.hpp | |
parent | df774d45a9754274a1701d801e4a42e71d38c97c (diff) | |
download | biboumi-86d4347af8532ef85472e47c01d645fa5ad1b3b1.tar.gz biboumi-86d4347af8532ef85472e47c01d645fa5ad1b3b1.tar.bz2 biboumi-86d4347af8532ef85472e47c01d645fa5ad1b3b1.tar.xz biboumi-86d4347af8532ef85472e47c01d645fa5ad1b3b1.zip |
Avoid unnecessary copies by recv()ing data directly into the expat buffer
Diffstat (limited to 'src/xmpp/xmpp_component.hpp')
-rw-r--r-- | src/xmpp/xmpp_component.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/xmpp/xmpp_component.hpp b/src/xmpp/xmpp_component.hpp index bc2b518..0c040f4 100644 --- a/src/xmpp/xmpp_component.hpp +++ b/src/xmpp/xmpp_component.hpp @@ -23,7 +23,7 @@ public: void on_connection_failed(const std::string& reason) override final; void on_connected() override final; void on_connection_close() override final; - void parse_in_buffer() override final; + void parse_in_buffer(const size_t size) override final; /** * Send a "close" message to all our connected peers. That message * depends on the protocol used (this may be a QUIT irc message, or a @@ -142,7 +142,11 @@ private: * if none already exist. */ Bridge* get_user_bridge(const std::string& user_jid); - + /** + * Return a buffer provided by the XML parser, to read data directly into + * it, and avoiding some unnecessary copy. + */ + void* get_receive_buffer(const size_t size) const override final; XmppParser parser; std::string stream_id; std::string served_hostname; |