diff options
author | Max Kellermann <max@duempel.org> | 2013-10-15 22:18:37 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-15 22:47:46 +0200 |
commit | 12ab556477d8ffc620a84d29ac8abfaefeb4985f (patch) | |
tree | 189a4507770628f430484d92a8e7524c9fbdee57 /src/event/BufferedSocket.hxx | |
parent | 509f8dab8946cfc311def89f62352c0881e73348 (diff) | |
download | mpd-12ab556477d8ffc620a84d29ac8abfaefeb4985f.tar.gz mpd-12ab556477d8ffc620a84d29ac8abfaefeb4985f.tar.xz mpd-12ab556477d8ffc620a84d29ac8abfaefeb4985f.zip |
event/BufferedSocket: pass writable pointer to OnSocketInput()
Remove the const_cast from HttpdClient.cxx, and avoid one allocation
in ClientRead.cxx.
Diffstat (limited to 'src/event/BufferedSocket.hxx')
-rw-r--r-- | src/event/BufferedSocket.hxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/event/BufferedSocket.hxx b/src/event/BufferedSocket.hxx index 31d6c3c57..db920f981 100644 --- a/src/event/BufferedSocket.hxx +++ b/src/event/BufferedSocket.hxx @@ -101,7 +101,15 @@ protected: CLOSED, }; - virtual InputResult OnSocketInput(const void *data, size_t length) = 0; + /** + * Data has been received on the socket. + * + * @param data a pointer to the beginning of the buffer; the + * buffer may be modified by the method while it processes the + * data + */ + virtual InputResult OnSocketInput(void *data, size_t length) = 0; + virtual void OnSocketError(Error &&error) = 0; virtual void OnSocketClosed() = 0; |