Skip to content

Commit

Permalink
fixed some magic numbers.
Browse files Browse the repository at this point in the history
git-svn-id: https://subversion.cs.uiuc.edu/svn/bang/eoh2009@133 69d76c3e-0761-0410-948c-9895a8bb34fc
  • Loading branch information
nbysani2 committed Mar 8, 2009
1 parent 6ab2c99 commit 37e03d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/base/bang-routing.c
Expand Up @@ -75,11 +75,11 @@ static peer_or_module *new_pom_peer_route(int peer_id, char *module_name, unsign
}

static BANG_request* create_request(enum BANG_request_types request, uuid_t authority, uuid_t peer) {
int request_length = 40;
int request_length = sizeof(uuid_t) * 2;
void *request_data = malloc(request_length);

memcpy(request_data,authority,16);
memcpy(request_data + 16,peer,16);
memcpy(request_data,authority,sizeof(uuid_t));
memcpy(request_data + sizeof(uuid_t),peer,sizeof(uuid_t));

return new_BANG_request(request,request_data,request_length);
}
Expand All @@ -90,7 +90,7 @@ static BANG_request* create_request_with_message(enum BANG_request_types request

static BANG_request* create_request_with_job(enum BANG_request_types request, uuid_t authority, uuid_t peer, BANG_job *job) {
int metadata_length = sizeof(uuid_t) * 2 + 4 + LENGTH_OF_LENGTHS;
int request_length = job->length + 40;
int request_length = job->length + metadata_length;
void *request_data = malloc(request_length);

memcpy(request_data, authority, sizeof(uuid_t));
Expand Down

0 comments on commit 37e03d8

Please sign in to comment.