- More fixes.
parent
5d2a94045e
commit
93e39de28f
|
@ -335,6 +335,7 @@ InitializeServerThread(int core)
|
||||||
ctx->mctx = mtcp_create_context(core);
|
ctx->mctx = mtcp_create_context(core);
|
||||||
if (!ctx->mctx) {
|
if (!ctx->mctx) {
|
||||||
TRACE_ERROR("Failed to create mtcp context!\n");
|
TRACE_ERROR("Failed to create mtcp context!\n");
|
||||||
|
free(ctx);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,6 +352,9 @@ InitializeServerThread(int core)
|
||||||
ctx->svars = (struct server_vars *)
|
ctx->svars = (struct server_vars *)
|
||||||
calloc(MAX_FLOW_NUM, sizeof(struct server_vars));
|
calloc(MAX_FLOW_NUM, sizeof(struct server_vars));
|
||||||
if (!ctx->svars) {
|
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");
|
TRACE_ERROR("Failed to create server_vars struct!\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -712,7 +712,7 @@ main(int argc, char **argv)
|
||||||
strncpy(url, strchr(argv[1], '/'), MAX_URL_LEN);
|
strncpy(url, strchr(argv[1], '/'), MAX_URL_LEN);
|
||||||
} else {
|
} else {
|
||||||
strncpy(host, argv[1], MAX_IP_STR_LEN);
|
strncpy(host, argv[1], MAX_IP_STR_LEN);
|
||||||
strncpy(url, "/", 1);
|
strncpy(url, "/", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
daddr = inet_addr(host);
|
daddr = inet_addr(host);
|
||||||
|
|
|
@ -525,11 +525,15 @@ mtcp_listen(mctx_t mctx, int sockid, int backlog)
|
||||||
listener->socket = &mtcp->smap[sockid];
|
listener->socket = &mtcp->smap[sockid];
|
||||||
|
|
||||||
if (pthread_cond_init(&listener->accept_cond, NULL)) {
|
if (pthread_cond_init(&listener->accept_cond, NULL)) {
|
||||||
|
/* errno set internally */
|
||||||
perror("pthread_cond_init of ctx->accept_cond\n");
|
perror("pthread_cond_init of ctx->accept_cond\n");
|
||||||
|
free(listener);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (pthread_mutex_init(&listener->accept_lock, NULL)) {
|
if (pthread_mutex_init(&listener->accept_lock, NULL)) {
|
||||||
|
/* errno set internally */
|
||||||
perror("pthread_mutex_init of ctx->accept_lock\n");
|
perror("pthread_mutex_init of ctx->accept_lock\n");
|
||||||
|
free(listener);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,6 @@ SetInterfaceInfo(char* dev_name_list)
|
||||||
} else {
|
} else {
|
||||||
perror("SIOCGIFFLAGS");
|
perror("SIOCGIFFLAGS");
|
||||||
}
|
}
|
||||||
close(sock);
|
|
||||||
}
|
}
|
||||||
num_queues = GetNumQueues();
|
num_queues = GetNumQueues();
|
||||||
if (num_queues <= 0) {
|
if (num_queues <= 0) {
|
||||||
|
@ -152,6 +151,7 @@ SetInterfaceInfo(char* dev_name_list)
|
||||||
TRACE_CONFIG("Too many NIC queues available.\n");
|
TRACE_CONFIG("Too many NIC queues available.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
close(sock);
|
||||||
} else if (current_iomodule_func == &dpdk_module_func) {
|
} else if (current_iomodule_func == &dpdk_module_func) {
|
||||||
#ifndef DISABLE_DPDK
|
#ifndef DISABLE_DPDK
|
||||||
int cpu = CONFIG.num_cores;
|
int cpu = CONFIG.num_cores;
|
||||||
|
|
Loading…
Reference in New Issue