aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-registry
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-08-24 16:01:34 +0200
committerMattias Andrée <maandree@operamail.com>2014-08-24 16:01:34 +0200
commitced31fb2be1cdcc0dfc8da2b9b00105c3ad903cb (patch)
treee6544671f170bac8258e946f515dfde471125cbf /src/mds-registry
parentdoc protocol stuff except message passing related stuff (diff)
downloadmds-ced31fb2be1cdcc0dfc8da2b9b00105c3ad903cb.tar.gz
mds-ced31fb2be1cdcc0dfc8da2b9b00105c3ad903cb.tar.bz2
mds-ced31fb2be1cdcc0dfc8da2b9b00105c3ad903cb.tar.xz
message id is unsigned 32-bit
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-registry/globals.c2
-rw-r--r--src/mds-registry/globals.h2
-rw-r--r--src/mds-registry/reexec.c6
-rw-r--r--src/mds-registry/registry.c6
-rw-r--r--src/mds-registry/slave.c6
5 files changed, 11 insertions, 11 deletions
diff --git a/src/mds-registry/globals.c b/src/mds-registry/globals.c
index e275eb7..2e0252f 100644
--- a/src/mds-registry/globals.c
+++ b/src/mds-registry/globals.c
@@ -22,7 +22,7 @@
/**
* Value of the ‘Message ID’ header for the next message
*/
-int32_t message_id = 2;
+uint32_t message_id = 2;
/**
* Buffer for received messages
diff --git a/src/mds-registry/globals.h b/src/mds-registry/globals.h
index 21f3b3e..bd83ff4 100644
--- a/src/mds-registry/globals.h
+++ b/src/mds-registry/globals.h
@@ -35,7 +35,7 @@
/**
* Value of the ‘Message ID’ header for the next message
*/
-extern int32_t message_id;
+extern uint32_t message_id;
/**
* Buffer for received messages
diff --git a/src/mds-registry/reexec.c b/src/mds-registry/reexec.c
index 6e34db8..6247e18 100644
--- a/src/mds-registry/reexec.c
+++ b/src/mds-registry/reexec.c
@@ -42,7 +42,7 @@
*/
size_t marshal_server_size(void)
{
- size_t i, rc = 2 * sizeof(int) + sizeof(int32_t) + 4 * sizeof(size_t);
+ size_t i, rc = 2 * sizeof(int) + sizeof(uint32_t) + 4 * sizeof(size_t);
hash_entry_t* entry;
ssize_t node;
@@ -82,7 +82,7 @@ int marshal_server(char* state_buf)
buf_set_next(state_buf, int, MDS_REGISTRY_VARS_VERSION);
buf_set_next(state_buf, int, connected);
- buf_set_next(state_buf, int32_t, message_id);
+ buf_set_next(state_buf, uint32_t, message_id);
buf_set_next(state_buf, size_t, n);
mds_message_marshal(&received, state_buf);
state_buf += n / sizeof(char);
@@ -145,7 +145,7 @@ int unmarshal_server(char* state_buf)
/* buf_get_next(state_buf, int, MDS_REGISTRY_VARS_VERSION); */
buf_next(state_buf, int, 1);
buf_get_next(state_buf, int, connected);
- buf_get_next(state_buf, int32_t, message_id);
+ buf_get_next(state_buf, uint32_t, message_id);
buf_get_next(state_buf, size_t, n);
fail_if (mds_message_unmarshal(&received, state_buf));
state_buf += n / sizeof(char);
diff --git a/src/mds-registry/registry.c b/src/mds-registry/registry.c
index d2a9c10..726d361 100644
--- a/src/mds-registry/registry.c
+++ b/src/mds-registry/registry.c
@@ -377,7 +377,7 @@ static int list_registry(const char* recv_client_id, const char* recv_message_id
/* Make sure the message headers can fit the send buffer. */
i = strlen(recv_message_id) + strlen(recv_client_id) + 10 + 19;
- i += strlen("To: %s\nIn response to: %s\nMessage ID: %" PRIi32 "\nLength: %" PRIu64 "\n\n");
+ i += strlen("To: %s\nIn response to: %s\nMessage ID: %" PRIu32 "\nLength: %" PRIu64 "\n\n");
while (ptr + i >= send_buffer_size)
if (growalloc(old, send_buffer, send_buffer_size, char))
@@ -385,11 +385,11 @@ static int list_registry(const char* recv_client_id, const char* recv_message_id
/* Construct message headers. */
- sprintf(send_buffer + ptr, "To: %s\nIn response to: %s\nMessage ID: %" PRIi32 "\nLength: %" PRIu64 "\n\n",
+ sprintf(send_buffer + ptr, "To: %s\nIn response to: %s\nMessage ID: %" PRIu32 "\nLength: %" PRIu64 "\n\n",
recv_client_id, recv_message_id, message_id, ptr);
/* Increase message ID. */
- with_mutex (slave_mutex, message_id = message_id == INT32_MAX ? 0 : (message_id + 1););
+ with_mutex (slave_mutex, message_id = message_id == UINT32_MAX ? 0 : (message_id + 1););
/* Send message. */
if (full_send(send_buffer + ptr, strlen(send_buffer + ptr)))
diff --git a/src/mds-registry/slave.c b/src/mds-registry/slave.c
index 5e714d4..f98dc20 100644
--- a/src/mds-registry/slave.c
+++ b/src/mds-registry/slave.c
@@ -40,15 +40,15 @@
*/
static int slave_notify_client(slave_t* slave)
{
- char buf[sizeof("To: %s\nIn response to: %s\nMessage ID: %" PRIi32 "\n\n") / sizeof(char) + 40];
+ char buf[sizeof("To: %s\nIn response to: %s\nMessage ID: %" PRIu32 "\n\n") / sizeof(char) + 40];
size_t ptr = 0, sent, left;
/* Construct message headers. */
- sprintf(buf, "To: %s\nIn response to: %s\nMessage ID: %" PRIi32 "\n\n",
+ sprintf(buf, "To: %s\nIn response to: %s\nMessage ID: %" PRIu32 "\n\n",
slave->client_id, slave->message_id, message_id);
/* Increase message ID. */
- message_id = message_id == INT32_MAX ? 0 : (message_id + 1);
+ message_id = message_id == UINT32_MAX ? 0 : (message_id + 1);
/* Send message to client. */
left = strlen(buf);