From 026a417defcd13d0ae5e8a8ddb67c18ff02fa142 Mon Sep 17 00:00:00 2001 From: Julien Boeuf Date: Mon, 2 Feb 2015 18:36:37 -0800 Subject: Adding support for loading the SSL roots from an environment variable. - Had to add support for files and environment variables as well. - I can't compile on windows so I'm sure there will be some issues. - Tested end-to-end with the simple ssl fullstack test. --- vsprojects/vs2013/build_and_run_tests.bat | 16 ++++++++++++++++ vsprojects/vs2013/gpr.vcxproj | 12 ++++++++++++ vsprojects/vs2013/gpr.vcxproj.filters | 21 +++++++++++++++++++++ 3 files changed, 49 insertions(+) (limited to 'vsprojects') diff --git a/vsprojects/vs2013/build_and_run_tests.bat b/vsprojects/vs2013/build_and_run_tests.bat index 77000739bb..88d9b2f471 100644 --- a/vsprojects/vs2013/build_and_run_tests.bat +++ b/vsprojects/vs2013/build_and_run_tests.bat @@ -49,6 +49,22 @@ echo Running test gpr_log_test test_bin\gpr_log_test.exe || echo TEST FAILED: gpr_log_test && exit /b echo( +echo Building test gpr_file_test +cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\file_test.c +link.exe /OUT:"test_bin\gpr_file_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\file_test.obj +echo( +echo Running test gpr_file_test +test_bin\gpr_file_test.exe || echo TEST FAILED: gpr_file_test && exit /b +echo( + +echo Building test gpr_env_test +cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\env_test.c +link.exe /OUT:"test_bin\gpr_env_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\env_test.obj +echo( +echo Running test gpr_env_test +test_bin\gpr_env_test.exe || echo TEST FAILED: gpr_env_test && exit /b +echo( + echo Building test gpr_slice_buffer_test cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\slice_buffer_test.c link.exe /OUT:"test_bin\gpr_slice_buffer_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\slice_buffer_test.obj diff --git a/vsprojects/vs2013/gpr.vcxproj b/vsprojects/vs2013/gpr.vcxproj index f71b586aff..da8ab6bbf2 100644 --- a/vsprojects/vs2013/gpr.vcxproj +++ b/vsprojects/vs2013/gpr.vcxproj @@ -100,6 +100,8 @@ + + @@ -115,6 +117,16 @@ + + + + + + + + + + diff --git a/vsprojects/vs2013/gpr.vcxproj.filters b/vsprojects/vs2013/gpr.vcxproj.filters index 013ed4b3c9..72b620a9fe 100644 --- a/vsprojects/vs2013/gpr.vcxproj.filters +++ b/vsprojects/vs2013/gpr.vcxproj.filters @@ -16,6 +16,21 @@ src\core\support + + src\core\support + + + src\core\support + + + src\core\support + + + src\core\support + + + src\core\support + src\core\support @@ -158,6 +173,12 @@ src\core\support + + src\core\support + + + src\core\support + src\core\support -- cgit v1.2.3 From 7413f108325d7965de44837704567e7ecb4f836a Mon Sep 17 00:00:00 2001 From: Julien Boeuf Date: Wed, 4 Feb 2015 17:00:08 -0800 Subject: Adding linux specific env implementation. --- Makefile | 2 ++ build.json | 1 + include/grpc/support/port_platform.h | 2 +- src/core/support/env_posix.c | 7 +------ vsprojects/vs2013/gpr.vcxproj | 2 ++ vsprojects/vs2013/gpr.vcxproj.filters | 3 +++ 6 files changed, 10 insertions(+), 7 deletions(-) (limited to 'vsprojects') diff --git a/Makefile b/Makefile index 7f4c7dc262..2447aebc35 100644 --- a/Makefile +++ b/Makefile @@ -1216,6 +1216,7 @@ LIBGPR_SRC = \ src/core/support/cmdline.c \ src/core/support/cpu_linux.c \ src/core/support/cpu_posix.c \ + src/core/support/env_linux.c \ src/core/support/env_posix.c \ src/core/support/env_win32.c \ src/core/support/file.c \ @@ -1310,6 +1311,7 @@ objs/$(CONFIG)/src/core/support/cancellable.o: objs/$(CONFIG)/src/core/support/cmdline.o: objs/$(CONFIG)/src/core/support/cpu_linux.o: objs/$(CONFIG)/src/core/support/cpu_posix.o: +objs/$(CONFIG)/src/core/support/env_linux.o: objs/$(CONFIG)/src/core/support/env_posix.o: objs/$(CONFIG)/src/core/support/env_win32.o: objs/$(CONFIG)/src/core/support/file.o: diff --git a/build.json b/build.json index ea75e42a47..704c1bd36d 100644 --- a/build.json +++ b/build.json @@ -241,6 +241,7 @@ "src/core/support/cmdline.c", "src/core/support/cpu_linux.c", "src/core/support/cpu_posix.c", + "src/core/support/env_linux.c", "src/core/support/env_posix.c", "src/core/support/env_win32.c", "src/core/support/file.c", diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index 4ffadde450..e99099c651 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -76,7 +76,7 @@ #define GPR_LINUX_EVENTFD 1 #define GPR_POSIX_SOCKET 1 #define GPR_POSIX_SOCKETADDR 1 -#define GPR_POSIX_ENV 1 +#define GPR_LINUX_ENV 1 #define GPR_POSIX_FILE 1 #define GPR_POSIX_STRING 1 #define GPR_POSIX_SYNC 1 diff --git a/src/core/support/env_posix.c b/src/core/support/env_posix.c index 79b8fcd7d7..bcbff9a177 100644 --- a/src/core/support/env_posix.c +++ b/src/core/support/env_posix.c @@ -31,11 +31,6 @@ * */ -/* for secure_getenv. */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - #include #ifdef GPR_POSIX_ENV @@ -49,7 +44,7 @@ #include "src/core/support/string.h" char *gpr_getenv(const char *name) { - char *result = secure_getenv(name); + char *result = getenv(name); return result == NULL ? result : gpr_strdup(result); } diff --git a/vsprojects/vs2013/gpr.vcxproj b/vsprojects/vs2013/gpr.vcxproj index da8ab6bbf2..3cbbfc24e8 100644 --- a/vsprojects/vs2013/gpr.vcxproj +++ b/vsprojects/vs2013/gpr.vcxproj @@ -117,6 +117,8 @@ + + diff --git a/vsprojects/vs2013/gpr.vcxproj.filters b/vsprojects/vs2013/gpr.vcxproj.filters index 72b620a9fe..eb79b8d5ca 100644 --- a/vsprojects/vs2013/gpr.vcxproj.filters +++ b/vsprojects/vs2013/gpr.vcxproj.filters @@ -16,6 +16,9 @@ src\core\support + + src\core\support + src\core\support -- cgit v1.2.3