modify make connection in test

multi_ipaddr
YuQing 2019-10-14 20:25:56 +08:00
parent 96f276a218
commit 3bbd1dc727
5 changed files with 12 additions and 18 deletions

View File

@ -5,8 +5,8 @@ INC_PATH = -I/usr/local/include
LIB_PATH = -L/usr/local/lib -lfdfsclient -lfastcommon
TARGET_PATH = $(TARGET_PREFIX)/bin
#SHARED_OBJS = common_func.o dfs_func.o
SHARED_OBJS = common_func.o dfs_func_pc.o
SHARED_OBJS = common_func.o dfs_func.o
#SHARED_OBJS = common_func.o dfs_func_pc.o
ALL_OBJS = $(SHARED_OBJS)

View File

@ -49,7 +49,7 @@ int upload_file(const char *file_buff, const int file_size, char *file_id, char
return result;
}
if ((pStorageServer=tracker_connect_server(&storageServer, &result)) \
if ((pStorageServer=tracker_make_connection(&storageServer, &result)) \
== NULL)
{
tracker_close_connection(pTrackerServer);
@ -87,7 +87,7 @@ int download_file(const char *file_id, int *file_size, char *storage_ip)
return result;
}
if ((pStorageServer=tracker_connect_server(&storageServer, &result)) \
if ((pStorageServer=tracker_make_connection(&storageServer, &result)) \
== NULL)
{
tracker_close_connection(pTrackerServer);
@ -125,7 +125,7 @@ int delete_file(const char *file_id, char *storage_ip)
return result;
}
if ((pStorageServer=tracker_connect_server(&storageServer, &result)) \
if ((pStorageServer=tracker_make_connection(&storageServer, &result)) \
== NULL)
{
tracker_close_connection(pTrackerServer);

View File

@ -7,6 +7,7 @@
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "fastcommon/shared_func.h"
#include "fastcommon/logger.h"
#include "test_types.h"
#include "common_func.h"
@ -119,10 +120,7 @@ int main(int argc, char **argv)
}
#ifndef WIN32
if (daemon(1, 1) != 0)
{
return errno != 0 ? errno : EFAULT;
}
daemon_init(false);
#endif
/*

View File

@ -7,8 +7,9 @@
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "fastcommon/logger.h"
#include "fastcommon/common_define.h"
#include "fastcommon/shared_func.h"
#include "fastcommon/logger.h"
#include "test_types.h"
#include "common_func.h"
#include "dfs_func.h"
@ -127,10 +128,7 @@ int main(int argc, char **argv)
}
#ifndef WIN32
if (daemon(1, 1) != 0)
{
return errno != 0 ? errno : EFAULT;
}
daemon_init(false);
#endif
/*

View File

@ -9,6 +9,7 @@
#include <sys/stat.h>
#include <sys/mman.h>
#include "fastcommon/common_define.h"
#include "fastcommon/shared_func.h"
#include "fastcommon/logger.h"
#include "test_types.h"
#include "common_func.h"
@ -121,10 +122,7 @@ int main(int argc, char **argv)
}
#ifndef WIN32
if (daemon(1, 1) != 0)
{
return errno != 0 ? errno : EFAULT;
}
daemon_init(false);
#endif
memset(&storages, 0, sizeof(storages));