[PATCH spice-server 06/23] websocket: Make websocket function more ABI compatibles with RedStream

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use same argument types as red_stream_* functions.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/websocket.c | 8 ++++----
 server/websocket.h | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/server/websocket.c b/server/websocket.c
index 145d829f4..b0ea867e6 100644
--- a/server/websocket.c
+++ b/server/websocket.c
@@ -226,7 +226,7 @@ static int relay_data(uint8_t* buf, size_t size, websocket_frame_t *frame)
     return n;
 }
 
-int websocket_read(RedsWebSocket *ws, uint8_t *buf, int size)
+int websocket_read(RedsWebSocket *ws, uint8_t *buf, size_t size)
 {
     int n = 0;
     int rc;
@@ -342,7 +342,7 @@ static void constrain_iov(struct iovec *iov, int iovcnt,
 
 
 /* Write a WebSocket frame with the enclosed data out. */
-int websocket_writev(RedsWebSocket *ws, struct iovec *iov, int iovcnt)
+int websocket_writev(RedsWebSocket *ws, const struct iovec *iov, int iovcnt)
 {
     uint8_t header[WEBSOCKET_MAX_HEADER_SIZE];
     uint64_t len;
@@ -360,7 +360,7 @@ int websocket_writev(RedsWebSocket *ws, struct iovec *iov, int iovcnt)
         return -1;
     }
     if (*remainder > 0) {
-        constrain_iov(iov, iovcnt, &iov_out, &iov_out_cnt, *remainder);
+        constrain_iov((struct iovec *) iov, iovcnt, &iov_out, &iov_out_cnt, *remainder);
         rc = writev_cb(opaque, iov_out, iov_out_cnt);
         if (iov_out != iov) {
             g_free(iov_out);
@@ -401,7 +401,7 @@ int websocket_writev(RedsWebSocket *ws, struct iovec *iov, int iovcnt)
     return rc;
 }
 
-int websocket_write(RedsWebSocket *ws, const uint8_t *buf, int len)
+int websocket_write(RedsWebSocket *ws, const void *buf, size_t len)
 {
     uint8_t header[WEBSOCKET_MAX_HEADER_SIZE];
     int rc;
diff --git a/server/websocket.h b/server/websocket.h
index f65b4e3d0..e3a610006 100644
--- a/server/websocket.h
+++ b/server/websocket.h
@@ -48,7 +48,7 @@ typedef struct {
 
 bool websocket_is_start(char *buf);
 void websocket_create_reply(char *buf, char *outbuf);
-int websocket_read(RedsWebSocket *ws, uint8_t *buf, int len);
-int websocket_write(RedsWebSocket *ws, const uint8_t *buf, int len);
-int websocket_writev(RedsWebSocket *ws, struct iovec *iov, int iovcnt);
 void websocket_ack_close(void *opaque, websocket_write_cb_t write_cb);
+int websocket_read(RedsWebSocket *ws, uint8_t *buf, size_t len);
+int websocket_write(RedsWebSocket *ws, const void *buf, size_t len);
+int websocket_writev(RedsWebSocket *ws, const struct iovec *iov, int iovcnt);
-- 
2.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]