mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-11-30 10:57:34 +08:00
commit
e26bc4b350
@ -1,102 +0,0 @@
|
||||
SHELL = /bin/sh
|
||||
CC = gcc
|
||||
|
||||
CFLAGS = -c -g -W -Wall -Wcast-qual -Wcast-align \
|
||||
-Waggregate-return -Wmissing-prototypes \
|
||||
-Wpointer-arith -Werror -Wshadow -pedantic -O2 \
|
||||
-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_USE_FAST_MACRO \
|
||||
-Wno-long-long
|
||||
###########################################################
|
||||
#Check system:
|
||||
# Linux, SunOS, Solaris, BSD variants, AIX, HP-UX
|
||||
SYSLIB =
|
||||
CHECKSYSRES = @echo "Unknow system type!";exit 1
|
||||
UNIXNAME = $(shell uname -sm)
|
||||
|
||||
# For FreeBSD
|
||||
ifeq ($(findstring FreeBSD, $(UNIXNAME)), FreeBSD)
|
||||
ifeq ($(findstring gcc, $(CC)), gcc)
|
||||
CFLAGS += -Wstrict-prototypes
|
||||
endif
|
||||
CFLAGS += -DFREEBSD -D_REENTRANT -pedantic
|
||||
SYSLIB = -lpthread
|
||||
endif
|
||||
|
||||
#Path for Linux
|
||||
ifeq ($(findstring Linux, $(UNIXNAME)), Linux)
|
||||
ifeq ($CC, "gcc")
|
||||
CFLAGS += -Wstrict-prototypes
|
||||
endif
|
||||
CFLAGS += -DLINUX2
|
||||
SYSLIB = -lcrypt -lpthread
|
||||
endif
|
||||
|
||||
#Path for SunOS
|
||||
ifeq ($(findstring SunOS, $(UNIXNAME)), SunOS)
|
||||
ifeq ($(findstring 86, $(UNIXNAME)), 86)
|
||||
SYSLIB = -lsocket -lnsl -lrt
|
||||
endif
|
||||
ifeq ($(findstring sun4u, $(UNIXNAME)), sun4u)
|
||||
SYSLIB = -lsocket -lnsl -lrt
|
||||
endif
|
||||
ifeq ($CC, "gcc")
|
||||
CFLAGS += -Wstrict-prototypes
|
||||
endif
|
||||
CFLAGS += -DSUNOS5
|
||||
endif
|
||||
|
||||
#Path for HP-UX
|
||||
ifeq ($(findstring HP-UX, $(UNIXNAME)), HP-UX)
|
||||
ifeq ($CC, "gcc")
|
||||
CFLAGS += -Wstrict-prototypes
|
||||
endif
|
||||
SYSLIB = -lpthread
|
||||
CFLAGS += -DHP_UX -DHPUX11
|
||||
PLAT_NAME=hp-ux
|
||||
endif
|
||||
|
||||
#Find system type.
|
||||
ifneq ($(SYSPATH),)
|
||||
CHECKSYSRES = @echo "System is $(shell uname -sm)"
|
||||
endif
|
||||
###########################################################
|
||||
|
||||
ACL_PATH = ../../../lib_acl
|
||||
ACL_LIB = $(ACL_PATH)/lib
|
||||
ACL_INC = $(ACL_PATH)/include
|
||||
|
||||
CFLAGS += -I. -I$(ACL_INC)
|
||||
COMPILE = $(CC) $(CFLAGS)
|
||||
|
||||
EXTLIBS =
|
||||
LDFLAGS = -Wl,-rpath,/opt/inc365/lib -Wl,-rpath, -L$(ACL_LIB) -l_acl $(EXTLIBS) $(SYSLIB)
|
||||
LINKS = $(CC) -o $(PROG) $(OBJS) $(LDFLAGS)
|
||||
|
||||
OUT_PATH = ./
|
||||
OBJ_PATH = $(OUT_PATH)
|
||||
|
||||
#Project's objs
|
||||
SRCS = $(wildcard *.c)
|
||||
OBJS = $(patsubst %.c,$(OBJ_PATH)%.o,$(SRCS))
|
||||
|
||||
###########################################################
|
||||
|
||||
.PHONY = all RM clean
|
||||
|
||||
PROG =
|
||||
|
||||
all: RM $(PROG)
|
||||
|
||||
RM:
|
||||
rm -f $(PROG)
|
||||
|
||||
all: $(OBJS)
|
||||
$(LINKS)
|
||||
|
||||
$(OBJ_PATH)%.o: %.c *.h
|
||||
$(COMPILE) -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(PROG)
|
||||
|
||||
rebuild: clean all
|
@ -75,17 +75,17 @@ bool WebsocketServlet_impl::doPost(acl::HttpServletRequest& req,
|
||||
return res.write(buf) && res.write(NULL, 0);
|
||||
}
|
||||
|
||||
bool WebsocketServlet_impl::on_ping(const char *buf, unsigned long long len)
|
||||
bool WebsocketServlet_impl::on_ping(const char *, unsigned long long)
|
||||
{
|
||||
return send_pong();
|
||||
}
|
||||
|
||||
|
||||
bool WebsocketServlet_impl::on_pong(const char *buf, unsigned long long len)
|
||||
bool WebsocketServlet_impl::on_pong(const char *, unsigned long long)
|
||||
{
|
||||
return send_ping();
|
||||
}
|
||||
bool WebsocketServlet_impl::on_message(char *data, unsigned long long len, bool text)
|
||||
bool WebsocketServlet_impl::on_message(char *data, unsigned long long len, bool)
|
||||
{
|
||||
switch (step_)
|
||||
{
|
||||
@ -99,7 +99,7 @@ bool WebsocketServlet_impl::on_message(char *data, unsigned long long len, bool
|
||||
case 1:
|
||||
{
|
||||
printf("FileSize:%s\n", data);
|
||||
filesize_ = std::strtol(data, 0, 10);
|
||||
filesize_ = strtol(data, 0, 10);
|
||||
step_++;
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user