Commit 0630ae1e authored by gejun's avatar gejun

Patch svn r35206 & fix compilation of tools

parent 8d4e0d81
This diff is collapsed.
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/epoll.h> #include <sys/epoll.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/epoll.h> #include <sys/epoll.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <gtest/gtest.h> #include <gtest/gtest.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/ioctl.h> #include <sys/ioctl.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/epoll.h> #include <sys/epoll.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/epoll.h> #include <sys/epoll.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: 2017/04/25 00:23:12 // Date: 2017/04/25 00:23:12
#include <gtest/gtest.h> #include <gtest/gtest.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date 2014/10/24 16:44:30 // Date 2014/10/24 16:44:30
#include <gtest/gtest.h> #include <gtest/gtest.h>
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// File test_http_parser.cpp // File test_http_parser.cpp
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date 2014/10/22 09:58:14 // Date 2014/10/22 09:58:14
#include <gtest/gtest.h> #include <gtest/gtest.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/ioctl.h> #include <sys/ioctl.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// File: test_http_status_code.cpp // File: test_http_status_code.cpp
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: 2014/11/04 18:33:39 // Date: 2014/11/04 18:33:39
#include <gtest/gtest.h> #include <gtest/gtest.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/ioctl.h> #include <sys/ioctl.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/epoll.h> #include <sys/epoll.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/epoll.h> #include <sys/epoll.h>
......
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Thu Jun 11 14:30:07 CST 2015 // Date: Thu Jun 11 14:30:07 CST 2015
#include <iostream> #include <iostream>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Thu Oct 15 21:08:31 CST 2015 // Date: Thu Oct 15 21:08:31 CST 2015
#include <sys/ioctl.h> #include <sys/ioctl.h>
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// File test_baidu_naming_service.cpp // File test_baidu_naming_service.cpp
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date 2014/10/20 13:50:10 // Date 2014/10/20 13:50:10
#include <stdio.h> #include <stdio.h>
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// File test_baidu_naming_service.cpp
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date 2014/10/20 13:50:10 // Date 2014/10/20 13:50:10
#include <stdio.h> #include <stdio.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/ioctl.h> #include <sys/ioctl.h>
......
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: 2015/03/31 14:50:20 // Date: 2015/03/31 14:50:20
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/ioctl.h> #include <sys/ioctl.h>
......
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Thu Jun 11 14:30:07 CST 2015 // Date: Thu Jun 11 14:30:07 CST 2015
#include <iostream> #include <iostream>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2016 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Fri May 20 15:52:22 CST 2016 // Date: Fri May 20 15:52:22 CST 2016
#include <sys/ioctl.h> #include <sys/ioctl.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/epoll.h> #include <sys/epoll.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: 2015/01/20 19:01:06 // Date: 2015/01/20 19:01:06
#include <gtest/gtest.h> #include <gtest/gtest.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <gtest/gtest.h> #include <gtest/gtest.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/epoll.h> #include <sys/epoll.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
#include <sys/ioctl.h> #include <sys/ioctl.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Baidu RPC - A framework to host and access services throughout Baidu.
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date: 2015/10/22 16:28:44 // Date: 2015/10/22 16:28:44
#include <gtest/gtest.h> #include <gtest/gtest.h>
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors
// File test_uri.cpp // File test_uri.cpp
// Author: The baidu-rpc authors (pbrpc@baidu.com)
// Date 2014/10/27 14:19:35 // Date 2014/10/27 14:19:35
#include <gtest/gtest.h> #include <gtest/gtest.h>
......
CC=gcc BRPC_PATH = ../../
CXX=g++ include $(BRPC_PATH)/config.mk
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -Wno-deprecated -Wno-unused-parameter -D__const__= CXXFLAGS = -std=c++0x -g -DNDEBUG -O2 -D__const__= -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-unused-parameter
CXXFLAGS=$(CPPFLAGS) HDRPATHS = -I$(BRPC_PATH)/output/include $(addprefix -I, $(HDRS))
CFLAGS=$(CPPFLAGS) LIBPATHS = -L$(BRPC_PATH)/output/lib $(addprefix -L, $(LIBS))
GFLAGS_PATH=../../../../../third-64/gflags STATIC_LINKINGS += -lbrpc
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
CLIENT_SOURCES = parallel_http.cpp SOURCES = $(wildcard *.cpp)
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES))) OBJS = $(addsuffix .o, $(basename $(SOURCES)))
.PHONY:all .PHONY:all
all: parallel_http all: parallel_http
...@@ -29,16 +14,16 @@ all: parallel_http ...@@ -29,16 +14,16 @@ all: parallel_http
.PHONY:clean .PHONY:clean
clean: clean:
@echo "Cleaning" @echo "Cleaning"
@rm -rf parallel_http $(CLIENT_OBJS) @rm -rf parallel_http $(OBJS)
parallel_http:$(CLIENT_OBJS) parallel_http:$(OBJS)
@echo "Linking $@" @echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@ @$(CXX) $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS) -o $@
%.o:%.cpp %.o:%.cpp
@echo "Compiling $@" @echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@ @$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
%.o:%.cc %.o:%.cc
@echo "Compiling $@" @echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@ @$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2016 baidu-rpc authors.
// Copyright (c) 2016 Baidu.com, Inc. All Rights Reserved //
// // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Access many http servers in parallel, much faster than curl (even called in batch) // Access many http servers in parallel, much faster than curl (even called in batch)
#include <gflags/gflags.h> #include <gflags/gflags.h>
......
CC=gcc BRPC_PATH = ../../
CXX=g++ include $(BRPC_PATH)/config.mk
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -Wno-deprecated -Wno-unused-parameter -D__const__= CXXFLAGS = -std=c++0x -g -DNDEBUG -O2 -D__const__= -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-unused-parameter
CXXFLAGS=$(CPPFLAGS) HDRPATHS = -I$(BRPC_PATH)/output/include $(addprefix -I, $(HDRS))
CFLAGS=$(CPPFLAGS) LIBPATHS = -L$(BRPC_PATH)/output/lib $(addprefix -L, $(LIBS))
GFLAGS_PATH=../../../../../third-64/gflags STATIC_LINKINGS += -lbrpc
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
SOURCES = $(wildcard *.cpp) SOURCES = $(wildcard *.cpp)
OBJS = $(addsuffix .o, $(basename $(SOURCES))) OBJS = $(addsuffix .o, $(basename $(SOURCES)))
...@@ -33,12 +18,12 @@ clean: ...@@ -33,12 +18,12 @@ clean:
rpc_press:$(OBJS) rpc_press:$(OBJS)
@echo "Linking $@" @echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@ @$(CXX) $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS) -o $@
%.o:%.cpp %.o:%.cpp
@echo "Compiling $@" @echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@ @$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
%.o:%.cc %.o:%.cc
@echo "Compiling $@" @echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@ @$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2014 baidu-rpc authors.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved //
// // Licensed under the Apache License, Version 2.0 (the "License");
// If you have any problem, contact us: // you may not use this file except in compliance with the License.
// Baidu Hi : group 1296497 // You may obtain a copy of the License at
// Email : pbrpc@baidu.com //
// Wiki : http://wiki.baidu.com/display/RPC/baidu-rpc // http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "info_thread.h" #include "info_thread.h"
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2014 baidu-rpc authors.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved //
// // Licensed under the Apache License, Version 2.0 (the "License");
// If you have any problem, contact us: // you may not use this file except in compliance with the License.
// Baidu Hi : group 1296497 // You may obtain a copy of the License at
// Email : pbrpc@baidu.com //
// Wiki : http://wiki.baidu.com/display/RPC/baidu-rpc // http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef BRPC_RPC_REPLAY_INFO_THREAD_H #ifndef BRPC_RPC_REPLAY_INFO_THREAD_H
#define BRPC_RPC_REPLAY_INFO_THREAD_H #define BRPC_RPC_REPLAY_INFO_THREAD_H
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2014 baidu-rpc authors.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved //
// Licensed under the Apache License, Version 2.0 (the "License");
// Author: The baidu-rpc authors (pbrpc@baidu.com) // you may not use this file except in compliance with the License.
// Date: 2014-10-29 14:20 // You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <algorithm> #include <algorithm>
#include <base/logging.h> #include <base/logging.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2014 baidu-rpc authors.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved //
// Licensed under the Apache License, Version 2.0 (the "License");
// Author: The baidu-rpc authors (pbrpc@baidu.com) // you may not use this file except in compliance with the License.
// Date: 2014-10-29 14:20 // You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef BRPC_JSON_LOADER_H #ifndef BRPC_JSON_LOADER_H
#define BRPC_JSON_LOADER_H #define BRPC_JSON_LOADER_H
......
/*********************************************************** // Copyright (c) 2014 baidu-rpc authors.
* //
* Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Licensed under the Apache License, Version 2.0 (the "License");
* // you may not use this file except in compliance with the License.
* Author: tiankui01@baidu.com // You may obtain a copy of the License at
* //
* Last modified: 2014-10-29 14:20 // http://www.apache.org/licenses/LICENSE-2.0
* //
* Filename: pb_util.cpp // Unless required by applicable law or agreed to in writing, software
* // distributed under the License is distributed on an "AS IS" BASIS,
* Description: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* // See the License for the specific language governing permissions and
**********************************************************/ // limitations under the License.
#include <base/logging.h> #include <base/logging.h>
#include "pb_util.h" #include "pb_util.h"
......
/*********************************************************** // Copyright (c) 2014 baidu-rpc authors.
* //
* Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Licensed under the Apache License, Version 2.0 (the "License");
* // you may not use this file except in compliance with the License.
* Author: tiankui01@baidu.com // You may obtain a copy of the License at
* //
* Last modified: 2014-10-29 14:20 // http://www.apache.org/licenses/LICENSE-2.0
* //
* Filename: pb_util.h // Unless required by applicable law or agreed to in writing, software
* // distributed under the License is distributed on an "AS IS" BASIS,
* Description: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* // See the License for the specific language governing permissions and
**********************************************************/ // limitations under the License.
#ifndef UTIL_PB_UTIL_H #ifndef UTIL_PB_UTIL_H
#define UTIL_PB_UTIL_H #define UTIL_PB_UTIL_H
#include "google/protobuf/message.h" #include "google/protobuf/message.h"
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2015 baidu-rpc authors.
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved //
// Licensed under the Apache License, Version 2.0 (the "License");
// Author: The baidu-rpc authors (pbrpc@baidu.com) // you may not use this file except in compliance with the License.
// Date: 2015-08-13 19:36:09 // You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <gflags/gflags.h> #include <gflags/gflags.h>
#include <google/protobuf/dynamic_message.h> #include <google/protobuf/dynamic_message.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2015 baidu-rpc authors.
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved //
// Licensed under the Apache License, Version 2.0 (the "License");
// Author: The baidu-rpc authors (pbrpc@baidu.com) // you may not use this file except in compliance with the License.
// Date: 2015-08-13 19:36:09 // You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <stdio.h> #include <stdio.h>
#include <pthread.h> #include <pthread.h>
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2015 baidu-rpc authors.
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved //
// Licensed under the Apache License, Version 2.0 (the "License");
// Author: The baidu-rpc authors (pbrpc@baidu.com) // you may not use this file except in compliance with the License.
// Date: 2015-08-13 19:36:09 // You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PBRPCPRESS_PBRPC_PRESS_H #ifndef PBRPCPRESS_PBRPC_PRESS_H
#define PBRPCPRESS_PBRPC_PRESS_H #define PBRPCPRESS_PBRPC_PRESS_H
......
CC=gcc BRPC_PATH = ../../
CXX=g++ include $(BRPC_PATH)/config.mk
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -Wno-deprecated -Wno-unused-parameter -D__const__= CXXFLAGS = -std=c++0x -g -DNDEBUG -O2 -D__const__= -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer -Wno-unused-parameter
CXXFLAGS=$(CPPFLAGS) HDRPATHS = -I$(BRPC_PATH)/output/include $(addprefix -I, $(HDRS))
CFLAGS=$(CPPFLAGS) LIBPATHS = -L$(BRPC_PATH)/output/lib $(addprefix -L, $(LIBS))
GFLAGS_PATH=../../../../../third-64/gflags STATIC_LINKINGS += -lbrpc
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
SOURCES = $(wildcard *.cpp) SOURCES = $(wildcard *.cpp)
OBJS = $(addsuffix .o, $(basename $(SOURCES))) OBJS = $(addsuffix .o, $(basename $(SOURCES)))
...@@ -33,12 +18,12 @@ clean: ...@@ -33,12 +18,12 @@ clean:
rpc_replay:$(OBJS) rpc_replay:$(OBJS)
@echo "Linking $@" @echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@ @$(CXX) $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS) -o $@
%.o:%.cpp %.o:%.cpp
@echo "Compiling $@" @echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@ @$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
%.o:%.cc %.o:%.cc
@echo "Compiling $@" @echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@ @$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2014 baidu-rpc authors.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved //
// // Licensed under the Apache License, Version 2.0 (the "License");
// If you have any problem, contact us: // you may not use this file except in compliance with the License.
// Baidu Hi : group 1296497 // You may obtain a copy of the License at
// Email : pbrpc@baidu.com //
// Wiki : http://wiki.baidu.com/display/RPC/baidu-rpc // http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "info_thread.h" #include "info_thread.h"
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2014 baidu-rpc authors.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved //
// // Licensed under the Apache License, Version 2.0 (the "License");
// If you have any problem, contact us: // you may not use this file except in compliance with the License.
// Baidu Hi : group 1296497 // You may obtain a copy of the License at
// Email : pbrpc@baidu.com //
// Wiki : http://wiki.baidu.com/display/RPC/baidu-rpc // http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef BRPC_RPC_REPLAY_INFO_THREAD_H #ifndef BRPC_RPC_REPLAY_INFO_THREAD_H
#define BRPC_RPC_REPLAY_INFO_THREAD_H #define BRPC_RPC_REPLAY_INFO_THREAD_H
......
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2014 baidu-rpc authors.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved //
// // Licensed under the Apache License, Version 2.0 (the "License");
// If you have any problem, contact us: // you may not use this file except in compliance with the License.
// Baidu Hi : group 1296497 // You may obtain a copy of the License at
// Email : pbrpc@baidu.com //
// Wiki : http://wiki.baidu.com/display/RPC/baidu-rpc // http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <gflags/gflags.h> #include <gflags/gflags.h>
#include <base/logging.h> #include <base/logging.h>
......
CC=gcc BRPC_PATH = ../../
CXX=g++ include $(BRPC_PATH)/config.mk
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -Wno-deprecated -Wno-unused-parameter -D__const__= # Notes on the flags:
CXXFLAGS=$(CPPFLAGS) # 1. Added -fno-omit-frame-pointer: perf/tcmalloc-profiler use frame pointers by default
CFLAGS=$(CPPFLAGS) # 2. Added -D__const__= : Avoid over-optimizations of TLS variables by GCC>=4.8
GFLAGS_PATH=../../../../../third-64/gflags CXXFLAGS = -std=c++0x -g -DNDEBUG -O2 -D__const__= -pipe -W -Wall -Werror -Wno-unused-parameter -fPIC -fno-omit-frame-pointer
LEVELDB_PATH=../../../../../third-64/leveldb HDRPATHS = -I$(BRPC_PATH)/output/include $(addprefix -I, $(HDRS))
PROTOBUF_PATH=../../../../../third-64/protobuf LIBPATHS = -L$(BRPC_PATH)/output/lib $(addprefix -L, $(LIBS))
BRPC_PATH=../../output STATIC_LINKINGS += -lbrpc
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread \
-lrt \
-lssl \
-lcrypto \
-ldl \
-lz
CLIENT_SOURCES = rpc_view.cpp CLIENT_SOURCES = rpc_view.cpp
PROTOS = view.proto PROTOS = $(wildcard *.proto)
PROTO_OBJS = $(addsuffix .pb.o, $(basename $(PROTOS))) PROTO_OBJS = $(PROTOS:.proto=.pb.o)
PROTO_GENS = $(addsuffix .pb.h, $(basename $(PROTOS))) $(addsuffix .pb.cc, $(basename $(PROTOS))) PROTO_GENS = $(PROTOS:.proto=.pb.h) $(PROTOS:.proto=.pb.cc)
CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES))) CLIENT_OBJS = $(addsuffix .o, $(basename $(CLIENT_SOURCES)))
.PHONY:all .PHONY:all
all: rpc_view all: rpc_view
.PHONY:clean .PHONY:clean
clean: clean:
...@@ -42,16 +25,16 @@ clean: ...@@ -42,16 +25,16 @@ clean:
rpc_view:$(PROTO_OBJS) $(CLIENT_OBJS) rpc_view:$(PROTO_OBJS) $(CLIENT_OBJS)
@echo "Linking $@" @echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@ $(CXX) $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS) -o $@
%.pb.cc:%.proto %.pb.cc %.pb.h:%.proto
@echo "Generating $@" @echo "Generating $@"
@$(PROTOC) --cpp_out=. --proto_path=. $< @$(PROTOC) --cpp_out=. --proto_path=. $(PROTOC_EXTRA_ARGS) $<
%.o:%.cpp %.o:%.cpp
@echo "Compiling $@" @echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@ @$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
%.o:%.cc %.o:%.cc
@echo "Compiling $@" @echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@ @$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2014 baidu-rpc authors.
// Copyright (c) 2016 Baidu.com, Inc. All Rights Reserved //
// // Licensed under the Apache License, Version 2.0 (the "License");
// If you have any problem, contact us: // you may not use this file except in compliance with the License.
// Baidu Hi : group 1296497 // You may obtain a copy of the License at
// Email : pbrpc@baidu.com //
// Wiki : http://wiki.baidu.com/display/RPC/baidu-rpc // http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <gflags/gflags.h> #include <gflags/gflags.h>
#include <base/logging.h> #include <base/logging.h>
......
CC=gcc BRPC_PATH = ../../
CXX=g++ include $(BRPC_PATH)/config.mk
CPPFLAGS=-std=c++0x -g -DNDEBUG -O2 -pipe -W -Wall -Werror -fPIC -Wno-deprecated -Wno-unused-parameter -D__const__= CXXFLAGS = -std=c++0x -g -DNDEBUG -O2 -D__const__= -pipe -W -Wall -Werror -fPIC -fno-omit-frame-pointer
CXXFLAGS=$(CPPFLAGS) HDRPATHS = -I$(BRPC_PATH)/output/include $(addprefix -I, $(HDRS))
CFLAGS=$(CPPFLAGS) LIBPATHS = -L$(BRPC_PATH)/output/lib $(addprefix -L, $(LIBS))
GFLAGS_PATH=../../../../../third-64/gflags STATIC_LINKINGS += -lbrpc
LEVELDB_PATH=../../../../../third-64/leveldb
PROTOBUF_PATH=../../../../../third-64/protobuf
BRPC_PATH=../../output
INCPATH=-I$(BRPC_PATH)/include -I$(GFLAGS_PATH)/include -I$(LEVELDB_PATH)/include -I$(PROTOBUF_PATH)/include
PROTOC=$(PROTOBUF_PATH)/bin/protoc
LIBS=$(BRPC_PATH)/lib/libbase.a \
$(BRPC_PATH)/lib/libbrpc.a \
$(BRPC_PATH)/lib/libbthread.a \
$(BRPC_PATH)/lib/libbvar.a \
$(BRPC_PATH)/lib/libjson2pb.a \
$(BRPC_PATH)/lib/libmcpack2pb.a \
$(GFLAGS_PATH)/lib/libgflags.a \
$(LEVELDB_PATH)/lib/libleveldb.a \
$(PROTOBUF_PATH)/lib/libprotobuf.a \
-lpthread -lrt -lssl -lcrypto -ldl -lz
SOURCES = $(wildcard *.cpp) SOURCES = $(wildcard *.cpp)
OBJS = $(addsuffix .o, $(basename $(SOURCES))) OBJS = $(addsuffix .o, $(basename $(SOURCES)))
...@@ -33,12 +18,12 @@ clean: ...@@ -33,12 +18,12 @@ clean:
trackme_server:$(OBJS) trackme_server:$(OBJS)
@echo "Linking $@" @echo "Linking $@"
@$(CXX) -Xlinker "-(" $^ $(LIBS) -Xlinker "-)" -o $@ @$(CXX) $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS) -o $@
%.o:%.cpp %.o:%.cpp
@echo "Compiling $@" @echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@ @$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
%.o:%.cc %.o:%.cc
@echo "Compiling $@" @echo "Compiling $@"
@$(CXX) -c $(INCPATH) $(CXXFLAGS) $< -o $@ @$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@
// Baidu RPC - A framework to host and access services throughout Baidu. // Copyright (c) 2014 baidu-rpc authors.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved //
// // Licensed under the Apache License, Version 2.0 (the "License");
// If you have any problem, contact us: // you may not use this file except in compliance with the License.
// Baidu Hi : group 1296497 // You may obtain a copy of the License at
// Email : pbrpc@baidu.com //
// Wiki : http://wiki.baidu.com/display/RPC/baidu-rpc // http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// A server to receive TrackMeRequest and send back TrackMeResponse. // A server to receive TrackMeRequest and send back TrackMeResponse.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment