summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-07-19 14:10:16 +0200
committerAlexander Larsson <alexl@redhat.com>2010-07-19 16:28:22 +0200
commit12b08f2c3e07cea617255bedfd97b2eedf0f180f (patch)
tree9a35ebbc31d6b61e94d3fbcd72feb70f0e9b9858 /server
parent2962bdaea056d7069303badc3d73ed9530fdbb15 (diff)
downloadspice-12b08f2c3e07cea617255bedfd97b2eedf0f180f.tar.gz
spice-12b08f2c3e07cea617255bedfd97b2eedf0f180f.tar.xz
spice-12b08f2c3e07cea617255bedfd97b2eedf0f180f.zip
codegen: Various cleanups
Remove all uses of @end in the marshaller, instead just using the C struct array-at-end-of-struct. To make this work we also remove all use of @end for switches (making them C unions). We drop the zero member of the notify message so that we can avoid this use of @end for a primitive in the marshaller (plus its useless to send over the wire). We change the offsets and stuff in the migration messages to real pointers.
Diffstat (limited to 'server')
-rw-r--r--server/red_tunnel_worker.c11
-rw-r--r--server/reds.c10
2 files changed, 8 insertions, 13 deletions
diff --git a/server/red_tunnel_worker.c b/server/red_tunnel_worker.c
index fea45460..6092a76f 100644
--- a/server/red_tunnel_worker.c
+++ b/server/red_tunnel_worker.c
@@ -1123,21 +1123,21 @@ static void tunnel_worker_free_print_service(TunnelWorker *worker, TunnelPrintSe
}
static TunnelPrintService *tunnel_worker_add_print_service(TunnelWorker *worker,
- SpiceMsgcTunnelAddPrintService *redc_service)
+ SpiceMsgcTunnelAddGenericService *redc_service)
{
TunnelPrintService *service;
service = (TunnelPrintService *)tunnel_worker_add_service(worker, sizeof(TunnelPrintService),
- &redc_service->base);
+ redc_service);
if (!service) {
return NULL;
}
- if (redc_service->ip.type == SPICE_TUNNEL_IP_TYPE_IPv4) {
- memcpy(service->ip, redc_service->ip.data, sizeof(SpiceTunnelIPv4));
+ if (redc_service->type == SPICE_TUNNEL_IP_TYPE_IPv4) {
+ memcpy(service->ip, redc_service->u.ip.data, sizeof(SpiceTunnelIPv4));
} else {
- red_printf("unexpected ip type=%d", redc_service->ip.type);
+ red_printf("unexpected ip type=%d", redc_service->type);
tunnel_worker_free_print_service(worker, service);
return NULL;
}
@@ -1154,7 +1154,6 @@ static int tunnel_channel_handle_service_add(TunnelChannel *channel,
TunnelService *out_service = NULL;
if (service_msg->type == SPICE_TUNNEL_SERVICE_TYPE_IPP) {
out_service = &tunnel_worker_add_print_service(channel->worker,
- (SpiceMsgcTunnelAddPrintService *)
service_msg)->base;
} else if (service_msg->type == SPICE_TUNNEL_SERVICE_TYPE_GENERIC) {
out_service = tunnel_worker_add_service(channel->worker, sizeof(TunnelService),
diff --git a/server/reds.c b/server/reds.c
index 97a47ae8..cf2d6abd 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3189,22 +3189,18 @@ static void reds_mig_continue(void)
RedsMigSpice *s = reds->mig_spice;
SpiceMsgMainMigrationBegin migrate;
RedsOutItem *item;
- int host_len;
red_printf("");
- host_len = strlen(s->host) + 1;
item = new_out_item(SPICE_MSG_MAIN_MIGRATE_BEGIN);
migrate.port = s->port;
migrate.sport = s->sport;
- migrate.host_offset = sizeof(SpiceMsgMainMigrationBegin);
- migrate.host_size = host_len;
+ migrate.host_size = strlen(s->host) + 1;
+ migrate.host_data = (uint8_t *)s->host;
migrate.pub_key_type = s->cert_pub_key_type;
- migrate.pub_key_offset = sizeof(SpiceMsgMainMigrationBegin) + host_len;
migrate.pub_key_size = s->cert_pub_key_len;
+ migrate.pub_key_data = s->cert_pub_key;
spice_marshall_msg_main_migrate_begin(item->m, &migrate);
- spice_marshaller_add(item->m, (uint8_t *)s->host, host_len);
- spice_marshaller_add(item->m, s->cert_pub_key, s->cert_pub_key_len);
reds_push_pipe_item(item);