Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions pink/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
CLEAN_FILES = # deliberately empty, so we can append below.
CXX=g++
LDFLAGS= -lpthread -lrt
CXXFLAGS= -g -std=c++11 -fno-builtin-memcmp -msse -msse4.2 -pipe -fPIC
CXX?=g++
LDFLAGS+= -lpthread -lrt
CXXFLAGS= -g -std=c++11 -fno-builtin-memcmp -pipe -fPIC
ARCH:=$(shell uname -p)
ifeq ($(ARCH), aarch64)
CXXFLAGS+=-march=armv8-a+crc+crypto -moutline-atomics
endif
ifeq ($(ARCH), x86_64)
CXXFLAGS+=-msse -msse4.2
endif
PROFILING_FLAGS=-pg
ARFLAGS = rs
OPT=
Expand Down
9 changes: 8 additions & 1 deletion pink/examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
CXX=g++
LDFLAGS= -lpthread -lrt -lprotobuf
CXXFLAGS=-O2 -std=c++11 -fno-builtin-memcmp -msse -msse4.2
CXXFLAGS=-O2 -std=c++11 -fno-builtin-memcmp
ARCH:=$(shell uname -p)
ifeq ($(ARCH), aarch64)
CXXFLAGS+=-march=armv8-a+crc+crypto -moutline-atomics
endif
ifeq ($(ARCH), x86_64)
CXXFLAGS+=-msse -msse4.2
endif

.PHONY: clean all

Expand Down
3 changes: 3 additions & 0 deletions pink/src/pink_conn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ PinkConn::PinkConn(const int fd,
ssl_(nullptr),
#endif
thread_(thread),
is_writable_(false),
close_(false),
flags_(1),
pink_epoll_(pink_epoll) {
gettimeofday(&last_interaction_, nullptr);
}
Expand Down
2 changes: 1 addition & 1 deletion pink/src/redis_conn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ WriteStatus RedisConn::SendReply() {
}
}
if (nwritten == -1) {
if (errno == EAGAIN) {
if (errno == EAGAIN || errno == EWOULDBLOCK) {
return kWriteHalf;
} else {
// Here we should close the connection
Expand Down