[Spice-commits] 7 commits - client/application.cpp client/red_channel.cpp client/red_channel.h client/red_client.cpp client/red_peer.cpp client/red_peer.h client/x11 server/reds.c

Christophe Fergau teuf at kemper.freedesktop.org
Mon Jul 18 09:17:08 PDT 2011


 client/application.cpp  |    4 ++--
 client/red_channel.cpp  |   32 ++++++++++++++++----------------
 client/red_channel.h    |    6 +++---
 client/red_client.cpp   |   28 ++++++++++++++++++++--------
 client/red_peer.cpp     |   26 ++++++++++++++++++--------
 client/red_peer.h       |    5 +++--
 client/x11/platform.cpp |   10 +++++++---
 server/reds.c           |   16 ++++++++--------
 8 files changed, 77 insertions(+), 50 deletions(-)

New commits:
commit c4d6f9791a7c5664843ad08bbb674b96d6dee594
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Mon Jul 4 14:27:11 2011 +0200

    Fix spice-server/qemu channel version checks
    
    When qemu creates a channel, reds.c contains code to check the
    minor/major channel versions known to QEMU (ie the ones that were
    current in spice-server when QEMU was compiled) and to compare these
    versions against the current ones the currently installed spice-server
    version.
    
    According to kraxel [1], the rules for these interface numbers are:
    
    "The purpose of the versions is exactly to avoid the need for a new
    soname.  The rules are basically:
    
       (1) You add stuff to the interface, strictly append-only to not break
           binary compatibility.
       (2) You bump the minor version of the interface.
       (3) You check the minor version at runtime to figure whenever the
           added fields contain valid stuff or not.
    
    An example is here (core interface, minor goes from 2 to 3, new
    channel_event callback):
    
    http://cgit.freedesktop.org/spice/spice/commit/?id=97f33fa86aa6edd25111b173dc0d9599ac29f879
    "
    
    The code currently refuses to create a channel if QEMU minor version is
    less than the current spice-server version. This does not correspond
    to the intended behaviour, this patch changes to fail is qemu was compiled
    with a spice-server that is *newer* than the one currently installed. This
    case is something we cannot support nicely.
    
    [1] http://lists.freedesktop.org/archives/spice-devel/2011-July/004440.html

diff --git a/server/reds.c b/server/reds.c
index ca6cf4d..ee24e87 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3270,7 +3270,7 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s,
     if (strcmp(interface->type, SPICE_INTERFACE_KEYBOARD) == 0) {
         red_printf("SPICE_INTERFACE_KEYBOARD");
         if (interface->major_version != SPICE_INTERFACE_KEYBOARD_MAJOR ||
-            interface->minor_version < SPICE_INTERFACE_KEYBOARD_MINOR) {
+            interface->minor_version > SPICE_INTERFACE_KEYBOARD_MINOR) {
             red_printf("unsupported keyboard interface");
             return -1;
         }
@@ -3280,7 +3280,7 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s,
     } else if (strcmp(interface->type, SPICE_INTERFACE_MOUSE) == 0) {
         red_printf("SPICE_INTERFACE_MOUSE");
         if (interface->major_version != SPICE_INTERFACE_MOUSE_MAJOR ||
-            interface->minor_version < SPICE_INTERFACE_MOUSE_MINOR) {
+            interface->minor_version > SPICE_INTERFACE_MOUSE_MINOR) {
             red_printf("unsupported mouse interface");
             return -1;
         }
@@ -3292,7 +3292,7 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s,
 
         red_printf("SPICE_INTERFACE_QXL");
         if (interface->major_version != SPICE_INTERFACE_QXL_MAJOR ||
-            interface->minor_version < SPICE_INTERFACE_QXL_MINOR) {
+            interface->minor_version > SPICE_INTERFACE_QXL_MINOR) {
             red_printf("unsupported qxl interface");
             return -1;
         }
@@ -3305,7 +3305,7 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s,
     } else if (strcmp(interface->type, SPICE_INTERFACE_TABLET) == 0) {
         red_printf("SPICE_INTERFACE_TABLET");
         if (interface->major_version != SPICE_INTERFACE_TABLET_MAJOR ||
-            interface->minor_version < SPICE_INTERFACE_TABLET_MINOR) {
+            interface->minor_version > SPICE_INTERFACE_TABLET_MINOR) {
             red_printf("unsupported tablet interface");
             return -1;
         }
@@ -3320,7 +3320,7 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s,
     } else if (strcmp(interface->type, SPICE_INTERFACE_PLAYBACK) == 0) {
         red_printf("SPICE_INTERFACE_PLAYBACK");
         if (interface->major_version != SPICE_INTERFACE_PLAYBACK_MAJOR ||
-            interface->minor_version < SPICE_INTERFACE_PLAYBACK_MINOR) {
+            interface->minor_version > SPICE_INTERFACE_PLAYBACK_MINOR) {
             red_printf("unsupported playback interface");
             return -1;
         }
@@ -3329,7 +3329,7 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s,
     } else if (strcmp(interface->type, SPICE_INTERFACE_RECORD) == 0) {
         red_printf("SPICE_INTERFACE_RECORD");
         if (interface->major_version != SPICE_INTERFACE_RECORD_MAJOR ||
-            interface->minor_version < SPICE_INTERFACE_RECORD_MINOR) {
+            interface->minor_version > SPICE_INTERFACE_RECORD_MINOR) {
             red_printf("unsupported record interface");
             return -1;
         }
@@ -3337,7 +3337,7 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s,
 
     } else if (strcmp(interface->type, SPICE_INTERFACE_CHAR_DEVICE) == 0) {
         if (interface->major_version != SPICE_INTERFACE_CHAR_DEVICE_MAJOR ||
-            interface->minor_version < SPICE_INTERFACE_CHAR_DEVICE_MINOR) {
+            interface->minor_version > SPICE_INTERFACE_CHAR_DEVICE_MINOR) {
             red_printf("unsupported char device interface");
             return -1;
         }
@@ -3352,7 +3352,7 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s,
             return -1;
         }
         if (interface->major_version != SPICE_INTERFACE_NET_WIRE_MAJOR ||
-            interface->minor_version < SPICE_INTERFACE_NET_WIRE_MINOR) {
+            interface->minor_version > SPICE_INTERFACE_NET_WIRE_MINOR) {
             red_printf("unsupported net wire interface");
             return -1;
         }
commit 082431ba8dbdbf990a146e7109876d6318f0f7b9
Author: Uri Lublin <uril at redhat.com>
Date:   Fri Jul 8 13:24:34 2011 +0200

    client: rename connect_unsecure to connect_to_peer
    
    Both connect_secure() and connect_unsecure() call connect_to_peer().
    
    Prior to this commit spicec.log reported all connections as unsecure,
    as connect_secure() called connect_unsecure() to make the connection.
    This fixes RH bug #653545

diff --git a/client/red_peer.cpp b/client/red_peer.cpp
index de0817d..17fcb45 100644
--- a/client/red_peer.cpp
+++ b/client/red_peer.cpp
@@ -68,7 +68,7 @@ void RedPeer::cleanup()
     }
 }
 
-void RedPeer::connect_unsecure(const char* host, int portnr)
+void RedPeer::connect_to_peer(const char* host, int portnr)
 {
     struct addrinfo ai, *result = NULL, *e;
     char uaddr[INET6_ADDRSTRLEN+1];
@@ -104,7 +104,8 @@ void RedPeer::connect_unsecure(const char* host, int portnr)
             getnameinfo((struct sockaddr*)e->ai_addr, e->ai_addrlen,
                         uaddr,INET6_ADDRSTRLEN, uport,32,
                         NI_NUMERICHOST | NI_NUMERICSERV);
-            LOG_INFO("Trying %s %s", uaddr, uport);
+            DBG(0, "Trying %s %s", uaddr, uport);
+
             if (::connect(_peer, e->ai_addr, e->ai_addrlen) == SOCKET_ERROR) {
                 err = sock_error();
                 LOG_INFO("Connect failed: %s (%d)",
@@ -113,7 +114,7 @@ void RedPeer::connect_unsecure(const char* host, int portnr)
                 _peer = INVALID_SOCKET;
                 continue;
             }
-            LOG_INFO("Connected to %s %s", uaddr, uport);
+            DBG(0, "Connected to %s %s", uaddr, uport);
             break;
         }
         lock.unlock();
@@ -130,14 +131,23 @@ void RedPeer::connect_unsecure(const char* host, int portnr)
     }
 }
 
+void RedPeer::connect_unsecure(const char* host, int portnr)
+{
+    connect_to_peer(host, portnr);
+    ASSERT(_ctx == NULL && _ssl == NULL && _peer != INVALID_SOCKET);
+    LOG_INFO("Connected to %s %d", host, portnr);
+}
+
 void RedPeer::connect_secure(const ConnectionOptions& options, const char* host)
 {
     int return_code;
     SPICE_SSL_VERIFY_OP auth_flags;
     SpiceOpenSSLVerify* verify = NULL;
+    int portnr = options.secure_port;
 
-    connect_unsecure(host, options.secure_port);
+    connect_to_peer(host, portnr);
     ASSERT(_ctx == NULL && _ssl == NULL && _peer != INVALID_SOCKET);
+    LOG_INFO("Connected to %s %d", host, portnr);
 
     try {
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
diff --git a/client/red_peer.h b/client/red_peer.h
index 0279f0d..8932357 100644
--- a/client/red_peer.h
+++ b/client/red_peer.h
@@ -123,6 +123,7 @@ protected:
     void cleanup();
 
 private:
+    void connect_to_peer(const char* host, int port);
     void shutdown();
 
 private:
commit 492f7a9b84c60e3638c182cb7d0c5b62effbe1bd
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Wed Jul 6 16:26:01 2011 +0200

    client: don't crash when agent is missing WAN support
    
    If you try to connect to a linux guest with WAN options, SPICE window opens up
    and is blank - it then fails with vdagent timeout message.  It should give a
    warning that this is only applicable for windows guest and still connect to
    guest.
    
    It all starts in RedClient::handle_init
    This function checks whether we have an agent or not, because if we have an
    agent, there will be some kind of handshake to check both sides capabilities
    before all the spice channels are created.
    
    When there is no agent running, the startup process goes on with
    SPICE_MSGC_MAIN_ATTACH_CHANNELS
    
    When there is a windows agent running, VD_AGENT_ANNOUNCE_CAPABILITIES and
    VD_AGENT_DISPLAY_CONFIG messages are sent to the agent, and when processing the
    agent answer to the VD_AGENT_DISPLAY_CONFIG message,
    SPICE_MSGC_MAIN_ATTACH_CHANNELS will be sent and the startup process will go
    on.
    
    However, when there is no agent running but --color-depth was used, handle_init
    won't send the SPICE_MSGC_MAIN_ATTACH_CHANNELS message but will wait for the
    agent handshake to proceed to its end, which won't happen, so it will timeout
    waiting for agent answers.
    
    Similarly, the linux agent handles VD_AGENT_ANNOUNCE_CAPABILITIES messages, but
    it doesn't handle VD_AGENT_DISPLAY_CONFIG messages, so we'll never reach the
    point where a SPICE_MSGC_MAIN_ATTACH_CHANNELS will be sent.
    
    This commit fixes this in 2 places:
    - unconditionnally send SPICE_MSGC_ATTACH_CHANNELS when no agent is running in
    handle_init
    - send SPICE_MSGC_MAIN_ATTACH_CHANNELS in
    RedClient::on_agent_announce_capabilities if the agent doesn't have the
    VD_AGENT_CAP_DISPLAY_CONFIG capability
    
    This fixes RH bug #712938

diff --git a/client/red_client.cpp b/client/red_client.cpp
index 8918e4f..67690e9 100644
--- a/client/red_client.cpp
+++ b/client/red_client.cpp
@@ -966,19 +966,20 @@ void RedClient::handle_init(RedPeer::InMessage* message)
         agent_start.num_tokens = ~0;
         _marshallers->msgc_main_agent_start(msg->marshaller(), &agent_start);
         post_message(msg);
-    }
-
-    if (_agent_connected) {
         send_agent_announce_capabilities(true);
         if (_auto_display_res) {
            send_agent_monitors_config();
         }
-    }
-
-    if (!_auto_display_res && _display_setting.is_empty()) {
-        post_message(new Message(SPICE_MSGC_MAIN_ATTACH_CHANNELS));
+        if (_auto_display_res || !_display_setting.is_empty()) {
+            _application.activate_interval_timer(*_agent_timer, AGENT_TIMEOUT);
+        } else {
+            post_message(new Message(SPICE_MSGC_MAIN_ATTACH_CHANNELS));
+        }
     } else {
-        _application.activate_interval_timer(*_agent_timer, AGENT_TIMEOUT);
+        if (_auto_display_res || !_display_setting.is_empty()) {
+            LOG_WARN("no agent running, display options have been ignored");
+        }
+        post_message(new Message(SPICE_MSGC_MAIN_ATTACH_CHANNELS));
     }
 }
 
@@ -1046,6 +1047,17 @@ void RedClient::on_agent_announce_capabilities(
         // not sending the color depth through send_agent_monitors_config, since
         // it applies only for attached screens.
         send_agent_display_config();
+    } else if (!_auto_display_res) {
+        /* some agents don't support monitors/displays agent messages, so
+         * we'll never reach on_agent_reply which sends this
+         * ATTACH_CHANNELS message which is needed for client startup to go
+         * on.
+         */
+        if (!_display_setting.is_empty()) {
+            LOG_WARN("display options have been requested, but the agent doesn't support these options");
+        }
+        post_message(new Message(SPICE_MSGC_MAIN_ATTACH_CHANNELS));
+        _application.deactivate_interval_timer(*_agent_timer);
     }
 }
 
commit 44073d1b38e29beb6076c7c1340625ecfb78ff2d
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Jul 7 10:09:04 2011 +0200

    client: improve WAN option description
    
    The WAN options (--color-depth and --disable-effects) need
    support from the guest agent to be working. Currently they are
    only supported on Windows. While I don't want to explicitly
    mention Windows in --help output, we can hint that it won't
    work with all guests in --help. This fixes RH bug #712941

diff --git a/client/application.cpp b/client/application.cpp
index 8e9fd8a..18101a5 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -2276,11 +2276,11 @@ bool Application::process_cmd_line(int argc, char** argv, bool &full_screen)
     parser.add(SPICE_OPT_CANVAS_TYPE, "canvas-type", "set rendering canvas", "canvas_type", true);
     parser.set_multi(SPICE_OPT_CANVAS_TYPE, ',');
 
-    parser.add(SPICE_OPT_DISPLAY_COLOR_DEPTH, "color-depth", "guest display color depth",
+    parser.add(SPICE_OPT_DISPLAY_COLOR_DEPTH, "color-depth", "guest display color depth (if supported by the guest vdagent)"
                "16/32", true);
 
     parser.add(SPICE_OPT_DISABLE_DISPLAY_EFFECTS, "disable-effects",
-               "disable guest display effects", "wallpaper/font-smooth/animation/all", true);
+               "disable guest display effects (if supported by the guest vdagent)", "wallpaper/font-smooth/animation/all", true);
     parser.set_multi(SPICE_OPT_DISABLE_DISPLAY_EFFECTS, ',');
 
     parser.add(SPICE_OPT_CONTROLLER, "controller", "enable external controller");
commit 933ca15ff4bebd5346e99aefe0b4ba1ea77985c5
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Jul 7 16:13:27 2011 +0200

    x11: don't return freed memory from get_clipboard
    
    There is a double free in client/x11/platform.cpp.
    In get_selection(), in the exit: case with ret_val == -1 and data != NULL,
    *data_ret (which is returned to the caller) has already been
    assigned "data", so it will be pointing to freed memory when "data" is
    XFree'd'. Then in handle_selection_notify, get_selection_free is called on
    this pointer, which causes a double free.
    When the length of the read data = 0, set the returned value to NULL,
    this way subsequent free attempts will be a noop.
    Fixes RH bug #710461

diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 910d61e..fe98eae 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -2575,8 +2575,12 @@ static int get_selection(XEvent &event, Atom type, Atom prop, int format,
         }
         len = clipboard_data_size;
         *data_ret = clipboard_data;
-    } else
-        *data_ret = data;
+    } else {
+        if (len > 0)
+            *data_ret = data;
+        else
+            *data_ret = NULL;
+    }
 
     if (len > 0)
         ret_val = len;
commit 40043d3bc2878fced8773a653660c428df013eb3
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Jul 7 20:03:21 2011 +0200

    client: match delete[] with new[]
    
    vinfo in x11/platform.cpp is allocated using new[] so it needs to
    be freed with delete[]

diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 7c31058..910d61e 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -2881,7 +2881,7 @@ static void cleanup(void)
         for (i = 0; i < ScreenCount(x_display); ++i) {
             XFree(vinfo[i]);
         }
-        delete vinfo;
+        delete[] vinfo;
         vinfo = NULL;
     }
 #ifdef USE_OPENGL
commit 659499478eb03d7f7cba6c4363f97b379b7adc3b
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Jul 7 20:03:11 2011 +0200

    client: s/recive/receive

diff --git a/client/red_channel.cpp b/client/red_channel.cpp
index d8dcc42..5f8bd25 100644
--- a/client/red_channel.cpp
+++ b/client/red_channel.cpp
@@ -122,7 +122,7 @@ void RedChannelBase::link(uint32_t connection_id, const std::string& password,
     send(buffer, p - buffer);
     delete [] buffer;
 
-    recive((uint8_t*)&header, sizeof(header));
+    receive((uint8_t*)&header, sizeof(header));
 
     if (header.magic != SPICE_MAGIC) {
         THROW_ERR(SPICEC_ERROR_CODE_CONNECT_FAILED, "bad magic");
@@ -139,7 +139,7 @@ void RedChannelBase::link(uint32_t connection_id, const std::string& password,
     _remote_minor = header.minor_version;
 
     AutoArray<uint8_t> reply_buf(new uint8_t[header.size]);
-    recive(reply_buf.get(), header.size);
+    receive(reply_buf.get(), header.size);
 
     reply = (SpiceLinkReply *)reply_buf.get();
 
@@ -196,7 +196,7 @@ void RedChannelBase::link(uint32_t connection_id, const std::string& password,
 
     BIO_free(bioKey);
 
-    recive((uint8_t*)&link_res, sizeof(link_res));
+    receive((uint8_t*)&link_res, sizeof(link_res));
     if (link_res != SPICE_LINK_ERR_OK) {
         int error_code = (link_res == SPICE_LINK_ERR_PERMISSION_DENIED) ?
                                 SPICEC_ERROR_CODE_CONNECT_FAILED : SPICEC_ERROR_CODE_CONNECT_FAILED;
@@ -359,10 +359,10 @@ void RedChannel::post_message(RedChannel::OutMessage* message)
     _send_trigger.trigger();
 }
 
-RedPeer::CompoundInMessage *RedChannel::recive()
+RedPeer::CompoundInMessage *RedChannel::receive()
 {
-    CompoundInMessage *message = RedChannelBase::recive();
-    on_message_recived();
+    CompoundInMessage *message = RedChannelBase::receive();
+    on_message_received();
     return message;
 }
 
@@ -589,7 +589,7 @@ void RedChannel::on_send_trigger()
     send_messages();
 }
 
-void RedChannel::on_message_recived()
+void RedChannel::on_message_received()
 {
     if (_message_ack_count && !--_message_ack_count) {
         post_message(new Message(SPICE_MSGC_ACK));
@@ -604,10 +604,10 @@ void RedChannel::on_message_complition(uint64_t serial)
     _sync_info.condition->notify_all();
 }
 
-void RedChannel::recive_messages()
+void RedChannel::receive_messages()
 {
     for (;;) {
-        uint32_t n = RedPeer::recive((uint8_t*)&_incomming_header, sizeof(SpiceDataHeader));
+        uint32_t n = RedPeer::receive((uint8_t*)&_incomming_header, sizeof(SpiceDataHeader));
         if (n != sizeof(SpiceDataHeader)) {
             _incomming_header_pos = n;
             return;
@@ -616,13 +616,13 @@ void RedChannel::recive_messages()
                                                                  _incomming_header.type,
                                                                  _incomming_header.size,
                                                                  _incomming_header.sub_list));
-        n = RedPeer::recive((*message)->data(), (*message)->compound_size());
+        n = RedPeer::receive((*message)->data(), (*message)->compound_size());
         if (n != (*message)->compound_size()) {
             _incomming_message = message.release();
             _incomming_message_pos = n;
             return;
         }
-        on_message_recived();
+        on_message_received();
         _message_handler->handle_message(*(*message));
         on_message_complition((*message)->serial());
     }
@@ -642,7 +642,7 @@ void RedChannel::on_event()
     send_messages();
 
     if (_incomming_header_pos) {
-        _incomming_header_pos += RedPeer::recive(((uint8_t*)&_incomming_header) +
+        _incomming_header_pos += RedPeer::receive(((uint8_t*)&_incomming_header) +
                                                  _incomming_header_pos,
                                                  sizeof(SpiceDataHeader) - _incomming_header_pos);
         if (_incomming_header_pos != sizeof(SpiceDataHeader)) {
@@ -657,7 +657,7 @@ void RedChannel::on_event()
     }
 
     if (_incomming_message) {
-        _incomming_message_pos += RedPeer::recive(_incomming_message->data() +
+        _incomming_message_pos += RedPeer::receive(_incomming_message->data() +
                                                   _incomming_message_pos,
                                                   _incomming_message->compound_size() -
                                                   _incomming_message_pos);
@@ -666,11 +666,11 @@ void RedChannel::on_event()
         }
         AutoRef<CompoundInMessage> message(_incomming_message);
         _incomming_message = NULL;
-        on_message_recived();
+        on_message_received();
         _message_handler->handle_message(*(*message));
         on_message_complition((*message)->serial());
     }
-    recive_messages();
+    receive_messages();
 }
 
 void RedChannel::send_migrate_flush_mark()
@@ -705,7 +705,7 @@ void RedChannel::handle_migrate(RedPeer::InMessage* message)
     }
     AutoRef<CompoundInMessage> data_message;
     if (migrate->flags & SPICE_MIGRATE_NEED_DATA_TRANSFER) {
-        data_message.reset(recive());
+        data_message.reset(receive());
     }
     _client.migrate_channel(*this);
     if (migrate->flags & SPICE_MIGRATE_NEED_DATA_TRANSFER) {
diff --git a/client/red_channel.h b/client/red_channel.h
index a326680..6a5a9f6 100644
--- a/client/red_channel.h
+++ b/client/red_channel.h
@@ -126,7 +126,7 @@ public:
     virtual void disconnect();
     virtual bool abort();
 
-    virtual CompoundInMessage *recive();
+    virtual CompoundInMessage *receive();
 
     virtual void post_message(RedChannel::OutMessage* message);
     int get_connection_error() { return _error;}
@@ -154,10 +154,10 @@ private:
     void run();
     void send_migrate_flush_mark();
     void send_messages();
-    void recive_messages();
+    void receive_messages();
     void on_send_trigger();
     virtual void on_event();
-    void on_message_recived();
+    void on_message_received();
     void on_message_complition(uint64_t serial);
 
     static void* worker_main(void *);
diff --git a/client/red_peer.cpp b/client/red_peer.cpp
index 37ca2b8..de0817d 100644
--- a/client/red_peer.cpp
+++ b/client/red_peer.cpp
@@ -268,7 +268,7 @@ void RedPeer::swap(RedPeer* other)
     }
 }
 
-uint32_t RedPeer::recive(uint8_t *buf, uint32_t size)
+uint32_t RedPeer::receive(uint8_t *buf, uint32_t size)
 {
     uint8_t *pos = buf;
     while (size) {
@@ -325,14 +325,14 @@ uint32_t RedPeer::recive(uint8_t *buf, uint32_t size)
     return pos - buf;
 }
 
-RedPeer::CompoundInMessage* RedPeer::recive()
+RedPeer::CompoundInMessage* RedPeer::receive()
 {
     SpiceDataHeader header;
     AutoRef<CompoundInMessage> message;
 
-    recive((uint8_t*)&header, sizeof(SpiceDataHeader));
+    receive((uint8_t*)&header, sizeof(SpiceDataHeader));
     message.reset(new CompoundInMessage(header.serial, header.type, header.size, header.sub_list));
-    recive((*message)->data(), (*message)->compound_size());
+    receive((*message)->data(), (*message)->compound_size());
     return message.release();
 }
 
diff --git a/client/red_peer.h b/client/red_peer.h
index 7e3428b..0279f0d 100644
--- a/client/red_peer.h
+++ b/client/red_peer.h
@@ -110,11 +110,11 @@ public:
     void close();
     void enable() { _shut = false;}
 
-    virtual CompoundInMessage* recive();
+    virtual CompoundInMessage* receive();
     uint32_t do_send(OutMessage& message, uint32_t skip_bytes);
     uint32_t send(OutMessage& message);
 
-    uint32_t recive(uint8_t* buf, uint32_t size);
+    uint32_t receive(uint8_t* buf, uint32_t size);
     uint32_t send(uint8_t* buf, uint32_t size);
 
 protected:


More information about the Spice-commits mailing list