summaryrefslogtreecommitdiff
path: root/src/base/vnc/vncserver.hh
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2017-05-10 00:35:43 -0700
committerGabe Black <gabeblack@google.com>2017-05-12 09:43:20 +0000
commitc6a6fbe9fdf3b7d586f83d50522ce2b91b3f2ba9 (patch)
treee5ae99393389e1443366342049ded28503a25bea /src/base/vnc/vncserver.hh
parent7c94dc236389a9c3bbb656e2666496c060e38334 (diff)
downloadgem5-c6a6fbe9fdf3b7d586f83d50522ce2b91b3f2ba9.tar.xz
base: Make the VNC server more resilient.
If the client does something bad, don't kill the whole simulation, just complain, drop the client and keep going. Change-Id: I824f2d121e2fe03cdf4323a25c192b68e0370acc Reviewed-on: https://gem5-review.googlesource.com/3200 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/base/vnc/vncserver.hh')
-rw-r--r--src/base/vnc/vncserver.hh18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/base/vnc/vncserver.hh b/src/base/vnc/vncserver.hh
index a52850323..99f4b5fe1 100644
--- a/src/base/vnc/vncserver.hh
+++ b/src/base/vnc/vncserver.hh
@@ -216,9 +216,9 @@ class VncServer : public VncInput
/** Read some data from the client
* @param buf the data to read
* @param len the amount of data to read
- * @return length read
+ * @return whether the read was successful
*/
- size_t read(uint8_t *buf, size_t len);
+ bool read(uint8_t *buf, size_t len);
/** Read len -1 bytes from the client into the buffer provided + 1
* assert that we read enough bytes. This function exists to handle
@@ -226,35 +226,35 @@ class VncServer : public VncInput
* the first byte which describes which one we're reading
* @param buf the address of the buffer to add one to and read data into
* @param len the amount of data + 1 to read
- * @return length read
+ * @return whether the read was successful.
*/
- size_t read1(uint8_t *buf, size_t len);
+ bool read1(uint8_t *buf, size_t len);
/** Templated version of the read function above to
* read simple data to the client
* @param val data to recv from the client
*/
- template <typename T> size_t read(T* val);
+ template <typename T> bool read(T* val);
/** Write a buffer to the client.
* @param buf buffer to send
* @param len length of the buffer
- * @return number of bytes sent
+ * @return whether the write was successful
*/
- size_t write(const uint8_t *buf, size_t len);
+ bool write(const uint8_t *buf, size_t len);
/** Templated version of the write function above to
* write simple data to the client
* @param val data to send to the client
*/
- template <typename T> size_t write(T* val);
+ template <typename T> bool write(T* val);
/** Send a string to the client
* @param str string to transmit
*/
- size_t write(const char* str);
+ bool write(const char* str);
/** Check the client's protocol verion for compatibility and send
* the security types we support