From e4dd931306fd55246cffa1cff1493b24aaa3f7e7 Mon Sep 17 00:00:00 2001 From: Mingmin Chen Date: Mon, 13 Feb 2017 14:51:04 -0800 Subject: [PATCH 1/3] Fixing example21 warning --- autogen.sh | 5 +++++ examples/example21.cpp | 12 ------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/autogen.sh b/autogen.sh index 833eaf3..7067e30 100755 --- a/autogen.sh +++ b/autogen.sh @@ -23,6 +23,7 @@ findtool(){ #-------------------------------------------------------------------------- # autoconf 2.57 or newer # +echo "Starting autoconf check" need_autoconf="2.57" ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|head -1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` if test -z "$ac_version"; then @@ -30,6 +31,7 @@ if test -z "$ac_version"; then echo " You need autoconf version $need_autoconf or newer installed." exit 1 fi +echo "Pass buildconf check" IFS=.; set $ac_version; IFS=' ' if test "$1" = "2" -a "$2" -lt "57" || test "$1" -lt "2"; then echo "buildconf: autoconf version $ac_version found." @@ -39,12 +41,14 @@ if test "$1" = "2" -a "$2" -lt "57" || test "$1" -lt "2"; then echo " AUTOCONF environment variable." exit 1 fi +echo "Pass autoconf check" echo "buildconf: autoconf version $ac_version (ok)" #-------------------------------------------------------------------------- # autoheader 2.50 or newer # +echo "Starting autoheader check" ah_version=`${AUTOHEADER:-autoheader} --version 2>/dev/null|head -1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` if test -z "$ah_version"; then echo "buildconf: autoheader not found." @@ -89,6 +93,7 @@ echo "buildconf: automake version $am_version (ok)" #-------------------------------------------------------------------------- # libtool check # +echo "Starting libtool check" LIBTOOL_WANTED_MAJOR=1 LIBTOOL_WANTED_MINOR=4 LIBTOOL_WANTED_PATCH=2 diff --git a/examples/example21.cpp b/examples/example21.cpp index 2bd7c4a..a6f1b73 100644 --- a/examples/example21.cpp +++ b/examples/example21.cpp @@ -43,18 +43,6 @@ anonymous namespace to prevent name clash in case other examples using the same global entities would be compiled in the same project */ -namespace -{ - -char *data = NULL; - -size_t readData(char *buffer, size_t size, size_t nitems) -{ - strncpy(buffer, data, size * nitems); - return size * nitems; -} - -} // namespace int main(int argc, char *argv[]) { From 289abf6583b7bf39a9229013c64dca269c382cdb Mon Sep 17 00:00:00 2001 From: Mingmin Chen Date: Thu, 23 Feb 2017 16:41:42 -0800 Subject: [PATCH 2/3] support byte array in post payload --- examples/example12.cpp | 2 +- examples/example16.cpp | 2 +- include/curlpp/Options.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/example12.cpp b/examples/example12.cpp index f59a30c..ba09eaf 100644 --- a/examples/example12.cpp +++ b/examples/example12.cpp @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) request.setOpt(new curlpp::options::HttpHeader(header)); - request.setOpt(new curlpp::options::PostFields("abcd")); + request.setOpt(new curlpp::options::PostFields((const void*)"abcd")); request.setOpt(new curlpp::options::PostFieldSize(5)); request.perform(); diff --git a/examples/example16.cpp b/examples/example16.cpp index 13557a3..3a93be5 100644 --- a/examples/example16.cpp +++ b/examples/example16.cpp @@ -60,7 +60,7 @@ int main(int argc, char *argv[]) request.setOpt(new curlpp::options::HttpHeader(header)); - request.setOpt(new curlpp::options::PostFields("abcd")); + request.setOpt(new curlpp::options::PostFields((const void*)"abcd")); request.setOpt(new curlpp::options::PostFieldSize(5)); request.setOpt(new curlpp::options::UserPwd("user:password")); diff --git a/include/curlpp/Options.hpp b/include/curlpp/Options.hpp index 701311b..037acf5 100644 --- a/include/curlpp/Options.hpp +++ b/include/curlpp/Options.hpp @@ -251,7 +251,7 @@ namespace options typedef curlpp::OptionTrait Put; typedef curlpp::OptionTrait Upload; typedef curlpp::OptionTrait Post; - typedef curlpp::OptionTrait PostFields; + typedef curlpp::OptionTrait PostFields; typedef curlpp::OptionTrait PostFieldSize; typedef curlpp::OptionTrait PostFieldSizeLarge; typedef curlpp::OptionTrait HttpPost; From 3be8d968dd6be377c7690a49e6b36ec04c4c9668 Mon Sep 17 00:00:00 2001 From: Mingmin Chen Date: Thu, 23 Feb 2017 17:01:45 -0800 Subject: [PATCH 3/3] remove unnecessary echo --- autogen.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/autogen.sh b/autogen.sh index 7067e30..833eaf3 100755 --- a/autogen.sh +++ b/autogen.sh @@ -23,7 +23,6 @@ findtool(){ #-------------------------------------------------------------------------- # autoconf 2.57 or newer # -echo "Starting autoconf check" need_autoconf="2.57" ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|head -1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` if test -z "$ac_version"; then @@ -31,7 +30,6 @@ if test -z "$ac_version"; then echo " You need autoconf version $need_autoconf or newer installed." exit 1 fi -echo "Pass buildconf check" IFS=.; set $ac_version; IFS=' ' if test "$1" = "2" -a "$2" -lt "57" || test "$1" -lt "2"; then echo "buildconf: autoconf version $ac_version found." @@ -41,14 +39,12 @@ if test "$1" = "2" -a "$2" -lt "57" || test "$1" -lt "2"; then echo " AUTOCONF environment variable." exit 1 fi -echo "Pass autoconf check" echo "buildconf: autoconf version $ac_version (ok)" #-------------------------------------------------------------------------- # autoheader 2.50 or newer # -echo "Starting autoheader check" ah_version=`${AUTOHEADER:-autoheader} --version 2>/dev/null|head -1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` if test -z "$ah_version"; then echo "buildconf: autoheader not found." @@ -93,7 +89,6 @@ echo "buildconf: automake version $am_version (ok)" #-------------------------------------------------------------------------- # libtool check # -echo "Starting libtool check" LIBTOOL_WANTED_MAJOR=1 LIBTOOL_WANTED_MINOR=4 LIBTOOL_WANTED_PATCH=2