summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2013-10-02 18:42:24 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2013-10-08 19:07:41 +0200
commit394fd0e6b76a8b4b0662d4445b4f961fa5798e74 (patch)
tree830309ac84b8e8269a9cdad1d8b13b968c897ce8
parentb18d867b319b3077d12e853897ce30be09924045 (diff)
downloadspice-394fd0e6b76a8b4b0662d4445b4f961fa5798e74.tar.gz
spice-394fd0e6b76a8b4b0662d4445b4f961fa5798e74.tar.xz
spice-394fd0e6b76a8b4b0662d4445b4f961fa5798e74.zip
Namespace RECEIVE_BUF_SIZE
-rw-r--r--server/main_channel.h4
-rw-r--r--server/red_worker.c8
-rw-r--r--server/snd_worker.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/server/main_channel.h b/server/main_channel.h
index 29eb8d41..c8e9ade2 100644
--- a/server/main_channel.h
+++ b/server/main_channel.h
@@ -30,12 +30,12 @@
#define REDS_NUM_INTERNAL_AGENT_MESSAGES 1
// approximate max receive message size for main channel
-#define RECEIVE_BUF_SIZE \
+#define MAIN_CHANNEL_RECEIVE_BUF_SIZE \
(4096 + (REDS_AGENT_WINDOW_SIZE + REDS_NUM_INTERNAL_AGENT_MESSAGES) * SPICE_AGENT_MAX_DATA_SIZE)
typedef struct MainChannel {
RedChannel base;
- uint8_t recv_buf[RECEIVE_BUF_SIZE];
+ uint8_t recv_buf[MAIN_CHANNEL_RECEIVE_BUF_SIZE];
RedsMigSpice mig_target; // TODO: add refs and release (afrer all clients completed migration in one way or the other?)
int num_clients_mig_wait;
} MainChannel;
diff --git a/server/red_worker.c b/server/red_worker.c
index 8763c8e7..451c8abf 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -383,7 +383,7 @@ typedef struct LocalCursor {
} LocalCursor;
#define MAX_PIPE_SIZE 50
-#define RECIVE_BUF_SIZE 1024
+#define CHANNEL_RECIVE_BUF_SIZE 1024
#define WIDE_CLIENT_ACK_WINDOW 40
#define NARROW_CLIENT_ACK_WINDOW 20
@@ -654,7 +654,7 @@ typedef struct GlzSharedDictionary {
typedef struct CommonChannel {
RedChannel base; // Must be the first thing
struct RedWorker *worker;
- uint8_t recv_buf[RECIVE_BUF_SIZE];
+ uint8_t recv_buf[CHANNEL_RECIVE_BUF_SIZE];
uint32_t id_alloc; // bitfield. TODO - use this instead of shift scheme.
int during_target_migrate; /* TRUE when the client that is associated with the channel
is during migration. Turned off when the vm is started.
@@ -1591,8 +1591,8 @@ static uint8_t *common_alloc_recv_buf(RedChannelClient *rcc, uint16_t type, uint
return spice_malloc(size);
}
- if (size > RECIVE_BUF_SIZE) {
- spice_critical("unexpected message size %u (max is %d)", size, RECIVE_BUF_SIZE);
+ if (size > CHANNEL_RECIVE_BUF_SIZE) {
+ spice_critical("unexpected message size %u (max is %d)", size, CHANNEL_RECIVE_BUF_SIZE);
return NULL;
}
return common->recv_buf;
diff --git a/server/snd_worker.c b/server/snd_worker.c
index ebddfcd9..19171e37 100644
--- a/server/snd_worker.c
+++ b/server/snd_worker.c
@@ -42,7 +42,7 @@
#define IOV_MAX 1024
#endif
-#define RECIVE_BUF_SIZE (16 * 1024 * 2)
+#define SND_RECIVE_BUF_SIZE (16 * 1024 * 2)
#define FRAME_SIZE 256
#define PLAYBACK_BUF_SIZE (FRAME_SIZE * 4)
@@ -50,7 +50,7 @@
#define CELT_BIT_RATE (64 * 1024)
#define CELT_COMPRESSED_FRAME_BYTES (FRAME_SIZE * CELT_BIT_RATE / SPICE_INTERFACE_PLAYBACK_FREQ / 8)
-#define RECORD_SAMPLES_SIZE (RECIVE_BUF_SIZE >> 2)
+#define RECORD_SAMPLES_SIZE (SND_RECIVE_BUF_SIZE >> 2)
enum PlaybackeCommand {
SND_PLAYBACK_MIGRATE,
@@ -112,7 +112,7 @@ struct SndChannel {
} send_data;
struct {
- uint8_t buf[RECIVE_BUF_SIZE];
+ uint8_t buf[SND_RECIVE_BUF_SIZE];
uint8_t *message_start;
uint8_t *now;
uint8_t *end;