[Spice-devel] [PATCH 1/5] client: s/recive/receive
Christophe Fergeau
cfergeau at redhat.com
Fri Jul 8 03:17:28 PDT 2011
---
client/red_channel.cpp | 32 ++++++++++++++++----------------
client/red_channel.h | 6 +++---
client/red_peer.cpp | 8 ++++----
client/red_peer.h | 4 ++--
4 files changed, 25 insertions(+), 25 deletions(-)
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:
--
1.7.6
More information about the Spice-devel
mailing list