- More fixes.

master
Asim Jamshed 2017-03-01 19:07:54 +09:00
parent 5d2a94045e
commit 93e39de28f
4 changed files with 10 additions and 2 deletions

View File

@ -335,6 +335,7 @@ InitializeServerThread(int core)
ctx->mctx = mtcp_create_context(core);
if (!ctx->mctx) {
TRACE_ERROR("Failed to create mtcp context!\n");
free(ctx);
return NULL;
}
@ -351,6 +352,9 @@ InitializeServerThread(int core)
ctx->svars = (struct server_vars *)
calloc(MAX_FLOW_NUM, sizeof(struct server_vars));
if (!ctx->svars) {
mtcp_close(ctx->mctx, ctx->ep);
mtcp_destroy_context(ctx->mctx);
free(ctx);
TRACE_ERROR("Failed to create server_vars struct!\n");
return NULL;
}

View File

@ -712,7 +712,7 @@ main(int argc, char **argv)
strncpy(url, strchr(argv[1], '/'), MAX_URL_LEN);
} else {
strncpy(host, argv[1], MAX_IP_STR_LEN);
strncpy(url, "/", 1);
strncpy(url, "/", 2);
}
daddr = inet_addr(host);

View File

@ -525,11 +525,15 @@ mtcp_listen(mctx_t mctx, int sockid, int backlog)
listener->socket = &mtcp->smap[sockid];
if (pthread_cond_init(&listener->accept_cond, NULL)) {
/* errno set internally */
perror("pthread_cond_init of ctx->accept_cond\n");
free(listener);
return -1;
}
if (pthread_mutex_init(&listener->accept_lock, NULL)) {
/* errno set internally */
perror("pthread_mutex_init of ctx->accept_lock\n");
free(listener);
return -1;
}

View File

@ -141,7 +141,6 @@ SetInterfaceInfo(char* dev_name_list)
} else {
perror("SIOCGIFFLAGS");
}
close(sock);
}
num_queues = GetNumQueues();
if (num_queues <= 0) {
@ -152,6 +151,7 @@ SetInterfaceInfo(char* dev_name_list)
TRACE_CONFIG("Too many NIC queues available.\n");
return -1;
}
close(sock);
} else if (current_iomodule_func == &dpdk_module_func) {
#ifndef DISABLE_DPDK
int cpu = CONFIG.num_cores;