nifi-minifi-cpp git commit: MINIFI-354 Reverting default config.yml to minimal configuration.

2017-07-31 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 46158ceac -> 7ecdafa98


MINIFI-354 Reverting default config.yml to minimal configuration.

This closes #120.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/7ecdafa9
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/7ecdafa9
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/7ecdafa9

Branch: refs/heads/master
Commit: 7ecdafa987080e9e85516338e78ec685949678ef
Parents: 46158ce
Author: Aldrin Piri 
Authored: Thu Jul 27 14:01:24 2017 -0400
Committer: Marc Parisi 
Committed: Mon Jul 31 09:27:21 2017 -0400

--
 conf/config.yml | 54 +---
 1 file changed, 5 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/7ecdafa9/conf/config.yml
--
diff --git a/conf/config.yml b/conf/config.yml
index b714197..0f7f2a5 100644
--- a/conf/config.yml
+++ b/conf/config.yml
@@ -14,52 +14,8 @@
 # limitations under the License.
 
 Flow Controller:
-id: 471deef6-2a6e-4a7d-912a-81cc17e3a205
-name: MiNiFi Flow
-
-Processors:
-- name: GetFile
-  id: 471deef6-2a6e-4a7d-912a-81cc17e3a206
-  class: org.apache.nifi.processors.standard.GetFile
-  max concurrent tasks: 1
-  scheduling strategy: TIMER_DRIVEN
-  scheduling period: 1 sec
-  penalization period: 30 sec
-  yield period: 10 sec
-  run duration nanos: 0
-  auto-terminated relationships list:
-  Properties:
-  Input Directory: /tmp/getfile
-  Keep Source File: true
-
-Connections:
-- name: GenerateFlowFileS2S
-  id: 471deef6-2a6e-4a7d-912a-81cc17e3a207
-  source id: 471deef6-2a6e-4a7d-912a-81cc17e3a206 
-  source relationship name: success
-  destination id: 471deef6-2a6e-4a7d-912a-81cc17e3a204
-  max work queue size: 0
-  max work queue data size: 1 MB
-  flowfile expiration: 60 sec
-  queue prioritizer class: 
org.apache.nifi.prioritizer.NewestFlowFileFirstPrioritizer
-
-Remote Processing Groups:
-- name: NiFi Flow
-  id: 471deef6-2a6e-4a7d-912a-81cc17e3a208
-  url: https://localhost:9443/nifi
-  timeout: 30 secs
-  yield period: 10 sec
-  Input Ports:
-  - id: 471deef6-2a6e-4a7d-912a-81cc17e3a204
-name: From Node A
-max concurrent tasks: 1
-use compression: false
-Properties: # Deviates from spec and will later be removed when 
this is autonegotiated
-Port UUID: 471deef6-2a6e-4a7d-912a-81cc17e3a204
-
-Provenance Reporting:
-  scheduling strategy: TIMER_DRIVEN
-  scheduling period: 1 sec
-  url: https://localhost:9443/nifi
-  port uuid: 471deef6-2a6e-4a7d-912a-81cc17e3a204
-  batch size: 100
+  name: MiNiFi Flow
+Processors: []
+Connections: []
+Remote Processing Groups: []
+Provenance Reporting:
\ No newline at end of file



nifi-minifi-cpp git commit: MINIFI-357 fixing PutFile bug that caused all writes to fail

2017-07-31 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 6867106d3 -> 46158ceac


MINIFI-357 fixing PutFile bug that caused all writes to fail

This closes #121.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/46158cea
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/46158cea
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/46158cea

Branch: refs/heads/master
Commit: 46158ceac2c192d266ef3b3e7f39d4f45599c87f
Parents: 6867106
Author: Dustin Rodrigues 
Authored: Sun Jul 30 00:44:44 2017 -0700
Committer: Marc Parisi 
Committed: Mon Jul 31 08:36:18 2017 -0400

--
 libminifi/src/processors/PutFile.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/46158cea/libminifi/src/processors/PutFile.cpp
--
diff --git a/libminifi/src/processors/PutFile.cpp 
b/libminifi/src/processors/PutFile.cpp
index b425ae9..824c7d1 100644
--- a/libminifi/src/processors/PutFile.cpp
+++ b/libminifi/src/processors/PutFile.cpp
@@ -164,8 +164,8 @@ int64_t 
PutFile::ReadCallback::process(std::shared_ptr stream) {
 _tmpFileOs.write(reinterpret_cast(buffer), read);
 size += read;
   } while (size < stream->getSize());
-  return size;
   _writeSucceeded = true;
+  return size;
 }
 
 // Renames tmp file to final destination



nifi-minifi-cpp git commit: MINIFI-70: enhance site2site port negotiation

2017-07-20 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master b20da80eb -> 20622f6d1


MINIFI-70: enhance site2site port negotiation

This closes #119.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/20622f6d
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/20622f6d
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/20622f6d

Branch: refs/heads/master
Commit: 20622f6d13250b9562e3e30949639ae3402aa09d
Parents: b20da80
Author: Bin Qiu 
Authored: Tue Jul 18 10:24:35 2017 -0700
Committer: Marc Parisi 
Committed: Thu Jul 20 11:39:46 2017 -0400

--
 README.md   |  28 +-
 cmake/BuildTests.cmake  |   2 +
 conf/config.yml |  53 +++-
 conf/minifi-log.properties  |   2 +-
 conf/minifi.properties  |  26 +-
 libminifi/include/ConfigurationListener.h   |   9 +-
 libminifi/include/HttpConfigurationListener.h   |  12 +-
 libminifi/include/RemoteProcessorGroupPort.h|  49 +++-
 libminifi/include/Site2SiteClientProtocol.h |  11 +
 libminifi/include/core/FlowConfiguration.h  |   2 +
 .../SiteToSiteProvenanceReportingTask.h |   4 +-
 libminifi/include/properties/Configure.h|  15 +-
 libminifi/include/utils/HTTPUtils.h | 208 ++
 libminifi/src/ConfigurationListener.cpp |  40 ---
 libminifi/src/Configure.cpp |  24 +-
 libminifi/src/HttpConfigurationListener.cpp |  60 +---
 libminifi/src/RemoteProcessorGroupPort.cpp  | 198 --
 libminifi/src/Site2SiteClientProtocol.cpp   | 273 ++-
 libminifi/src/core/FlowConfiguration.cpp|   2 +-
 .../SiteToSiteProvenanceReportingTask.cpp   |   1 +
 libminifi/src/core/yaml/YamlConfiguration.cpp   |  47 ++--
 .../test/integration/Site2SiteRestTest.cpp  | 145 ++
 libminifi/test/resources/TestSite2SiteRest.yml  |  58 
 libminifi/test/unit/ProcessorTests.cpp  |   3 +-
 libminifi/test/unit/YamlConfigurationTests.cpp  |   2 +-
 25 files changed, 939 insertions(+), 335 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/20622f6d/README.md
--
diff --git a/README.md b/README.md
index b7f532c..ac2f97a 100644
--- a/README.md
+++ b/README.md
@@ -278,8 +278,6 @@ Additionally, users can utilize the MiNiFi Toolkit 
Converter (version 0.0.1 - sc
 name: From Node A
 max concurrent tasks: 1
 Properties:
-Port: 10001
-Host Name: localhost
 
 ### Site2Site Security Configuration
 
@@ -319,8 +317,7 @@ Additionally, users can utilize the MiNiFi Toolkit 
Converter (version 0.0.1 - sc
 Provenance Reporting:
   scheduling strategy: TIMER_DRIVEN
   scheduling period: 1 sec
-  port: 10001
-  host: localhost
+  url: http://localhost:8080/nifi
   port uuid: 471deef6-2a6e-4a7d-912a-81cc17e3a204
   batch size: 100
 
@@ -334,14 +331,27 @@ Additionally, users can utilize the MiNiFi Toolkit 
Converter (version 0.0.1 - sc
 nifi.configuration.listener.type=http
 nifi.configuration.listener.http.url=https://localhost:8080
 nifi.configuration.listener.pull.interval=1 sec
-nifi.configuration.listener.client.ca.certificate=./conf/nifi-cert.pem
 
 if you want to enable client certificate
-nifi.configuration.listener.need.ClientAuth=true
-nifi.configuration.listener.client.certificate=./conf/client.pem
-nifi.configuration.listener.client.private.key=./conf/client.key
-nifi.configuration.listener.client.pass.phrase=./conf/password
+nifi.https.need.ClientAuth=true
+nifi.https.client.certificate=./conf/client.pem
+nifi.https.client.private.key=./conf/client.key
+nifi.https.client.pass.phrase=./conf/password
+nifi.https.client.ca.certificate=./conf/nifi-cert.pem
 
+### REST API access
+
+Configure REST API user name and password
+nifi.rest.api.user.name=admin
+nifi.rest.api.password=password
+
+if you want to enable client certificate
+nifi.https.need.ClientAuth=true
+nifi.https.client.certificate=./conf/client.pem
+nifi.https.client.private.key=./conf/client.key
+nifi.https.client.pass.phrase=./conf/password
+nifi.https.client.ca.certificate=./conf/nifi-cert.pem
+  
 ### UID generation
 
 MiNiFi needs to generate many unique identifiers in the course of operations.  
There are a few different uid implementations available that can be configured 
in minifi-uid.properties.


nifi-minifi-cpp git commit: MINIFI-341: Introduce delimiter to TailFile to delimit incoming data appropriately.

2017-07-05 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 0a2d25c48 -> b20da80eb


MINIFI-341: Introduce delimiter to TailFile to delimit incoming data 
appropriately.

This closed #116.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/b20da80e
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/b20da80e
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/b20da80e

Branch: refs/heads/master
Commit: b20da80eb73d49286041ed3f7a2e04afb6b0a7f3
Parents: 0a2d25c
Author: Jeremy Dyer 
Authored: Thu Jun 22 22:29:21 2017 -0400
Committer: Marc Parisi 
Committed: Wed Jul 5 13:58:39 2017 -0400

--
 .gitignore|   3 +
 libminifi/include/core/ProcessSession.h   |   2 +
 libminifi/include/processors/TailFile.h   |  10 ++
 libminifi/src/core/ProcessSession.cpp |  85 
 libminifi/src/processors/TailFile.cpp |  68 +++---
 libminifi/test/resources/TestTailFile.txt |   2 +
 libminifi/test/unit/TailFileTests.cpp | 171 +
 7 files changed, 325 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b20da80e/.gitignore
--
diff --git a/.gitignore b/.gitignore
index 4a4c064..3032f38 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,9 @@
 # Ignore JetBrains project files
 .idea
 
+# Ignore JetBrains cLion project files.
+.project
+
 # Ignore kdevelop metadata
 nifi-minifi-cpp.kdev4
 .kdev4

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b20da80e/libminifi/include/core/ProcessSession.h
--
diff --git a/libminifi/include/core/ProcessSession.h 
b/libminifi/include/core/ProcessSession.h
index 4d20f59..ad79d12 100644
--- a/libminifi/include/core/ProcessSession.h
+++ b/libminifi/include/core/ProcessSession.h
@@ -123,6 +123,8 @@ class ProcessSession {
   void import(std::string source, std::shared_ptr &,
   bool keepSource = true,
   uint64_t offset = 0);
+  void import(std::string source, std::vector 
flows,
+  bool keepSource, uint64_t offset, char inputDelimiter);
 
 // Prevent default copy constructor and assignment operation
 // Only support pass by reference or pointer

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b20da80e/libminifi/include/processors/TailFile.h
--
diff --git a/libminifi/include/processors/TailFile.h 
b/libminifi/include/processors/TailFile.h
index 59cf224..5e166cf 100644
--- a/libminifi/include/processors/TailFile.h
+++ b/libminifi/include/processors/TailFile.h
@@ -54,10 +54,18 @@ class TailFile : public core::Processor {
   // Supported Properties
   static core::Property FileName;
   static core::Property StateFile;
+  static core::Property Delimiter;
   // Supported Relationships
   static core::Relationship Success;
 
  public:
+  /**
+   * Function that's executed when the processor is scheduled.
+   * @param context process context.
+   * @param sessionFactory process session factory that is used when creating
+   * ProcessSession objects.
+   */
+  void onSchedule(core::ProcessContext *context, core::ProcessSessionFactory 
*sessionFactory);
   // OnTrigger method, implemented by NiFi TailFile
   virtual void onTrigger(core::ProcessContext *context, core::ProcessSession 
*session);
   // Initialize, over write by NiFi TailFile
@@ -75,6 +83,8 @@ class TailFile : public core::Processor {
   std::string _stateFile;
   // State related to the tailed file
   std::string _currentTailFileName;
+  // Delimiter for the data incoming from the tailed file.
+  std::string _delimiter;
   // determine if state is recovered;
   bool _stateRecovered;
   uint64_t _currentTailFilePosition;

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b20da80e/libminifi/src/core/ProcessSession.cpp
--
diff --git a/libminifi/src/core/ProcessSession.cpp 
b/libminifi/src/core/ProcessSession.cpp
index 037660f..df21a34 100644
--- a/libminifi/src/core/ProcessSession.cpp
+++ b/libminifi/src/core/ProcessSession.cpp
@@ -626,6 +626,91 @@ bool keepSource,
   }
 }
 
+void ProcessSession::import(std::string source, 
std::vector flows,
+  bool keepSource, uint64_t offset, char inputDelimiter) {
+  std::shared_ptr claim;
+
+  std::shared_ptr flowFile;
+
+  char *buf = NULL;
+  int size = 4096;
+  buf = new char[size];
+
+  try {
+// Open the input file and seek to the appropriate location.
+std::ifstream input;
+

nifi-minifi-cpp git commit: MINIFI-367 port tests to use boost::filesystem vs. stat.h for better portability

2017-08-09 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 58c21e0bf -> e98ff6844


MINIFI-367 port tests to use boost::filesystem vs. stat.h for better portability

This closes #124.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/e98ff684
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/e98ff684
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/e98ff684

Branch: refs/heads/master
Commit: e98ff6844b059763d587b0151c016c466a330461
Parents: 58c21e0
Author: Andrew I. Christianson 
Authored: Tue Aug 8 13:16:19 2017 -0400
Committer: Marc Parisi 
Committed: Wed Aug 9 10:11:41 2017 -0400

--
 libminifi/CMakeLists.txt |  3 ++-
 libminifi/test/unit/PutFileTests.cpp | 22 ++
 2 files changed, 8 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/e98ff684/libminifi/CMakeLists.txt
--
diff --git a/libminifi/CMakeLists.txt b/libminifi/CMakeLists.txt
index a78fd8f..5e63a30 100644
--- a/libminifi/CMakeLists.txt
+++ b/libminifi/CMakeLists.txt
@@ -80,9 +80,10 @@ target_link_libraries (minifi ${ZLIB_LIBRARIES})
 
 if (NOT IOS)
 # Include Boost System
-find_package(Boost COMPONENTS system REQUIRED)
+find_package(Boost COMPONENTS system filesystem REQUIRED)
 find_package(CURL)
 target_link_libraries(minifi ${Boost_SYSTEM_LIBRARY})
+target_link_libraries(minifi ${Boost_FILESYSTEM_LIBRARY})
 
 if (CURL_FOUND)
 include_directories(${CURL_INCLUDE_DIRS})

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/e98ff684/libminifi/test/unit/PutFileTests.cpp
--
diff --git a/libminifi/test/unit/PutFileTests.cpp 
b/libminifi/test/unit/PutFileTests.cpp
index c18c72c..024b6fa 100644
--- a/libminifi/test/unit/PutFileTests.cpp
+++ b/libminifi/test/unit/PutFileTests.cpp
@@ -25,6 +25,8 @@
 #include 
 #include 
 
+#include 
+
 #include "../TestBase.h"
 #include "processors/ListenHTTP.h"
 #include "processors/LogAttribute.h"
@@ -45,18 +47,6 @@ TEST_CASE("Test Creation of PutFile", "[getfileCreate]") {
   REQUIRE(processor->getName() == "processorname");
 }
 
-uint64_t getModificationTime(std::string filename) {
-  struct stat result;
-  if (stat(filename.c_str(), ) == 0) {
-#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
-return result.st_mtimespec.tv_sec;
-#else
-return result.st_mtime;
-#endif
-  }
-  return 0;
-}
-
 TEST_CASE("PutFileTest", "[getfileputpfile]") {
   TestController testController;
 
@@ -231,7 +221,7 @@ TEST_CASE("PutFileTestFileExistsIgnore", 
"[getfileputpfile]") {
   file.open(movedFile.str(), std::ios::out);
   file << "tempFile";
   file.close();
-  uint64_t filemodtime = getModificationTime(movedFile.str());
+  auto filemodtime = boost::filesystem::last_write_time(movedFile.str());
 
   std::this_thread::sleep_for(std::chrono::milliseconds(1000));
   plan->reset();
@@ -252,7 +242,7 @@ TEST_CASE("PutFileTestFileExistsIgnore", 
"[getfileputpfile]") {
   // verify that the fle was moved
   REQUIRE(false == std::ifstream(ss.str()).good());
   REQUIRE(true == std::ifstream(movedFile.str()).good());
-  REQUIRE(filemodtime == getModificationTime(movedFile.str()));
+  REQUIRE(filemodtime == boost::filesystem::last_write_time(movedFile.str()));
   LogTestController::getInstance().reset();
 }
 
@@ -299,7 +289,7 @@ TEST_CASE("PutFileTestFileExistsReplace", 
"[getfileputpfile]") {
   file.open(movedFile.str(), std::ios::out);
   file << "tempFile";
   file.close();
-  uint64_t filemodtime = getModificationTime(movedFile.str());
+  auto filemodtime = boost::filesystem::last_write_time(movedFile.str());
 
   std::this_thread::sleep_for(std::chrono::milliseconds(1000));
   plan->reset();
@@ -320,7 +310,7 @@ TEST_CASE("PutFileTestFileExistsReplace", 
"[getfileputpfile]") {
   // verify that the fle was moved
   REQUIRE(false == std::ifstream(ss.str()).good());
   REQUIRE(true == std::ifstream(movedFile.str()).good());
-  REQUIRE(filemodtime != getModificationTime(movedFile.str()));
+  REQUIRE(filemodtime != boost::filesystem::last_write_time(movedFile.str()));
   LogTestController::getInstance().reset();
 }
 



nifi-minifi-cpp git commit: MINIFI-324 - More flexible uid generation

2017-06-23 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 1a1716dc6 -> 0a2d25c48


MINIFI-324 - More flexible uid generation

This closes #115.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/0a2d25c4
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/0a2d25c4
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/0a2d25c4

Branch: refs/heads/master
Commit: 0a2d25c481cfbf5b900f4208f661634fc3518d28
Parents: 1a1716d
Author: Bryan Rosander 
Authored: Wed Jun 21 14:29:03 2017 -0400
Committer: Marc Parisi 
Committed: Fri Jun 23 11:15:38 2017 -0400

--
 CMakeLists.txt  |   2 +-
 README.md   |  64 ---
 conf/minifi-uid.properties  |  28 +++
 libminifi/CMakeLists.txt|   4 +-
 libminifi/include/FlowController.h  |   2 +
 libminifi/include/FlowFileRecord.h  |   5 +-
 libminifi/include/ResourceClaim.h   |   9 +-
 libminifi/include/Site2SiteClientProtocol.h |   6 +-
 libminifi/include/core/Core.h   |   8 +-
 libminifi/include/core/FlowFile.h   |   4 +-
 libminifi/include/core/ProcessGroup.h   |   2 +
 .../include/core/logging/LoggerConfiguration.h  |   6 +-
 libminifi/include/core/yaml/YamlConfiguration.h |   4 +-
 libminifi/include/processors/InvokeHTTP.h   |   2 +
 libminifi/include/processors/PutFile.h  |   2 +
 libminifi/include/properties/Properties.h   |   3 +-
 libminifi/include/provenance/Provenance.h   |  24 +--
 libminifi/include/utils/Id.h|  77 
 libminifi/src/FlowController.cpp|   4 +-
 libminifi/src/FlowFileRecord.cpp|  11 +-
 libminifi/src/ResourceClaim.cpp |  18 +-
 libminifi/src/Site2SiteClientProtocol.cpp   |   5 +-
 libminifi/src/core/Core.cpp |   4 +
 libminifi/src/core/FlowFile.cpp |  10 +-
 libminifi/src/core/ProcessGroup.cpp |   4 +-
 .../src/core/logging/LoggerConfiguration.cpp|   2 +-
 libminifi/src/core/yaml/YamlConfiguration.cpp   |   4 +-
 libminifi/src/processors/InvokeHTTP.cpp |   4 +-
 libminifi/src/processors/PutFile.cpp|   4 +-
 libminifi/src/provenance/Provenance.cpp |  19 +-
 libminifi/src/utils/Id.cpp  | 154 
 libminifi/test/TestBase.h   |   4 +-
 libminifi/test/unit/IdTests.cpp | 174 +++
 main/MiNiFiMain.cpp |  10 +-
 34 files changed, 585 insertions(+), 98 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/0a2d25c4/CMakeLists.txt
--
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fdae7ea..454908e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -116,7 +116,7 @@ set(CPACK_SOURCE_PACKAGE_FILE_NAME 
"${ASSEMBLY_BASE_NAME}-source")
 set(CPACK_SOURCE_IGNORE_FILES 
"/docs/generated/;/build/;~$;${CPACK_SOURCE_IGNORE_FILES};${CMAKE_SOURCE_DIR}/.git/;${CMAKE_SOURCE_DIR}/.idea/;${CMAKE_SOURCE_DIR}/cmake-build-debug/")
 
 # Generate binary assembly
-install(FILES conf/minifi.properties conf/minifi-log.properties conf/config.yml
+install(FILES conf/minifi.properties conf/minifi-log.properties 
conf/minifi-uid.properties conf/config.yml
 DESTINATION conf
 COMPONENT bin)
 

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/0a2d25c4/README.md
--
diff --git a/README.md b/README.md
index 0fb25f3..b7f532c 100644
--- a/README.md
+++ b/README.md
@@ -84,7 +84,7 @@ Perspectives of the role of MiNiFi should be from the 
perspective of the agent a
 * libuuid
 * libleveldb
 * libcurl
-* libssl and libcrypto from openssl 
+* libssl and libcrypto from openssl
 
 The needed dependencies can be installed with the following commands for:
 
@@ -260,7 +260,7 @@ Additionally, users can utilize the MiNiFi Toolkit 
Converter (version 0.0.1 - sc
 - name: TransferFilesToRPG
   id: 471deef6-2a6e-4a7d-912a-81cc17e3a207
   source name: GetFile
-  source id: 471deef6-2a6e-4a7d-912a-81cc17e3a206 
+  source id: 471deef6-2a6e-4a7d-912a-81cc17e3a206
   source relationship name: success
   destination id: 471deef6-2a6e-4a7d-912a-81cc17e3a204
   max work queue size: 0
@@ -283,12 +283,12 @@ Additionally, users can utilize the MiNiFi Toolkit 
Converter (version 0.0.1 - sc
 
 ### Site2Site Security Configuration
 
-in minifi.properties 
+in 

[nifi-minifi-cpp] Git Push Summary

2017-06-07 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/remotes/apache/master [created] 77a20dbe3


nifi-minifi-cpp git commit: MINIFI-262: Configuration Listener

2017-06-07 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 77a20dbe3 -> 1a1716dc6


MINIFI-262: Configuration Listener

This closes #112.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/1a1716dc
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/1a1716dc
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/1a1716dc

Branch: refs/heads/master
Commit: 1a1716dc675886689217860a299f7a8d36850adf
Parents: 77a20db
Author: Bin Qiu 
Authored: Wed Jun 7 09:26:11 2017 -0700
Committer: Marc Parisi 
Committed: Wed Jun 7 13:55:28 2017 -0400

--
 README.md   |  18 ++
 cmake/BuildTests.cmake  |   3 +
 libminifi/include/ConfigurationListener.h   | 122 ++
 libminifi/include/FlowControlProtocol.h |   4 -
 libminifi/include/FlowController.h  |  39 -
 libminifi/include/HttpConfigurationListener.h   |  82 +
 libminifi/include/core/FlowConfiguration.h  |   9 +-
 libminifi/include/core/ProcessGroup.h   |   9 +-
 .../core/repository/FlowFileRepository.h|   2 +-
 libminifi/include/core/yaml/YamlConfiguration.h |  16 ++
 libminifi/include/processors/InvokeHTTP.h   |  58 +--
 libminifi/include/properties/Configure.h|  11 ++
 libminifi/include/utils/HTTPUtils.h |  97 +++
 libminifi/src/ConfigurationListener.cpp | 131 +++
 libminifi/src/Configure.cpp |  34 +++-
 libminifi/src/FlowController.cpp|  37 +++-
 libminifi/src/HttpConfigurationListener.cpp | 167 +++
 libminifi/src/core/FlowConfiguration.cpp|   6 +-
 libminifi/src/core/ProcessGroup.cpp |   4 +-
 libminifi/src/core/yaml/YamlConfiguration.cpp   |  14 +-
 libminifi/src/processors/InvokeHTTP.cpp |  16 +-
 .../HttpConfigurationListenerTest.cpp   | 144 
 22 files changed, 938 insertions(+), 85 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/1a1716dc/README.md
--
diff --git a/README.md b/README.md
index acaf8dd..0fb25f3 100644
--- a/README.md
+++ b/README.md
@@ -323,6 +323,24 @@ Additionally, users can utilize the MiNiFi Toolkit 
Converter (version 0.0.1 - sc
   host: localhost
   port uuid: 471deef6-2a6e-4a7d-912a-81cc17e3a204
   batch size: 100
+
+### Http Configuration Listener
+
+Http Configuration Listener will pull flow file configuration from the 
remote command control server, 
+validate and apply the new flow configuration
+
+in minifi.properties 
+
+nifi.configuration.listener.type=http
+nifi.configuration.listener.http.url=https://localhost:8080
+nifi.configuration.listener.pull.interval=1 sec 
+nifi.configuration.listener.client.ca.certificate=./conf/nifi-cert.pem
+
+if you want to enable client certificate
+nifi.configuration.listener.need.ClientAuth=true
+nifi.configuration.listener.client.certificate=./conf/client.pem
+nifi.configuration.listener.client.private.key=./conf/client.key
+nifi.configuration.listener.client.pass.phrase=./conf/password
   
 ### Controller Services
  If you need to reference a controller service in your config.yml file, use 
the following template. In the example, below, ControllerServiceClass is the 
name of the class defining the controller Service. ControllerService1 

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/1a1716dc/cmake/BuildTests.cmake
--
diff --git a/cmake/BuildTests.cmake b/cmake/BuildTests.cmake
index bad01d3..aedae10 100644
--- a/cmake/BuildTests.cmake
+++ b/cmake/BuildTests.cmake
@@ -36,6 +36,7 @@ function(createTests testName)
 target_include_directories(${testName} PRIVATE BEFORE 
"thirdparty/spdlog-0.13.0/include")
 target_include_directories(${testName} PRIVATE BEFORE 
"thirdparty/yaml-cpp-yaml-cpp-0.5.3/include")
 target_include_directories(${testName} PRIVATE BEFORE 
"thirdparty/jsoncpp/include")
+target_include_directories(${testName} PRIVATE BEFORE 
"thirdparty/civetweb-1.9.1/include")
 target_include_directories(${testName} PRIVATE BEFORE 
${LEVELDB_INCLUDE_DIRS})
 target_include_directories(${testName} PRIVATE BEFORE "include")
 target_include_directories(${testName} PRIVATE BEFORE "libminifi/include/")
@@ -87,6 +88,8 @@ add_test(NAME ControllerServiceIntegrationTests COMMAND 
ControllerServiceIntegra
 
 add_test(NAME HttpGetIntegrationTest COMMAND HttpGetIntegrationTest 
"${TEST_RESOURCES}/TestHTTPGet.yml"  

nifi-minifi-cpp git commit: Create Merge Content processor

2017-09-22 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 6283a447e -> 8b3b1c880


Create Merge Content processor

This closes #133.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/8b3b1c88
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/8b3b1c88
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/8b3b1c88

Branch: refs/heads/master
Commit: 8b3b1c880d92dfc8289af80ad883e254a23bc356
Parents: 6283a44
Author: Bin Qiu 
Authored: Thu Aug 24 10:04:32 2017 -0700
Committer: Marc Parisi 
Committed: Fri Sep 22 13:41:23 2017 -0400

--
 README.md |   1 +
 libminifi/include/core/FlowConfiguration.h|   1 +
 libminifi/include/core/ProcessSession.h   |   2 +
 libminifi/include/processors/BinFiles.h   | 296 +
 libminifi/include/processors/LoadProcessors.h |   1 +
 libminifi/include/processors/MergeContent.h   | 206 ++
 libminifi/src/core/ProcessSession.cpp |   4 +
 libminifi/src/processors/BinFiles.cpp | 303 +
 libminifi/src/processors/MergeContent.cpp | 283 
 libminifi/test/unit/MergeFileTests.cpp| 720 +
 10 files changed, 1817 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8b3b1c88/README.md
--
diff --git a/README.md b/README.md
index 8830aaa..db10ab4 100644
--- a/README.md
+++ b/README.md
@@ -56,6 +56,7 @@ Perspectives of the role of MiNiFi should be from the 
perspective of the agent a
   * ListenSyslog
   * PutFile
   * TailFile
+  * MergeContent
 * Provenance events generation is supported and are persisted using levelDB.
 
 ## System Requirements

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8b3b1c88/libminifi/include/core/FlowConfiguration.h
--
diff --git a/libminifi/include/core/FlowConfiguration.h 
b/libminifi/include/core/FlowConfiguration.h
index 43d2bc0..d9ebc72 100644
--- a/libminifi/include/core/FlowConfiguration.h
+++ b/libminifi/include/core/FlowConfiguration.h
@@ -35,6 +35,7 @@
 #include "processors/LogAttribute.h"
 #include "processors/ExecuteProcess.h"
 #include "processors/AppendHostInfo.h"
+#include "processors/MergeContent.h"
 #include "core/Processor.h"
 #include "core/logging/LoggerConfiguration.h"
 #include "core/ProcessContext.h"

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8b3b1c88/libminifi/include/core/ProcessSession.h
--
diff --git a/libminifi/include/core/ProcessSession.h 
b/libminifi/include/core/ProcessSession.h
index d853e9b..3a3b143 100644
--- a/libminifi/include/core/ProcessSession.h
+++ b/libminifi/include/core/ProcessSession.h
@@ -79,6 +79,8 @@ class ProcessSession {
   std::shared_ptr create(std::shared_ptr 
) {
 return create(parent);
   }
+  // Add a FlowFile to the session
+  void add(std::shared_ptr );
 // Clone a new UUID FlowFile from parent both for content resource claim and 
attributes
   std::shared_ptr clone(std::shared_ptr 
);
   // Clone a new UUID FlowFile from parent for attributes and sub set of 
parent content resource claim

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8b3b1c88/libminifi/include/processors/BinFiles.h
--
diff --git a/libminifi/include/processors/BinFiles.h 
b/libminifi/include/processors/BinFiles.h
new file mode 100644
index 000..6c619a8
--- /dev/null
+++ b/libminifi/include/processors/BinFiles.h
@@ -0,0 +1,296 @@
+/**
+ * @file BinFiles.h
+ * BinFiles class declaration
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+#ifndef __BIN_FILES_H__
+#define __BIN_FILES_H__
+
+#include 
+#include 
+#include 
+#include "FlowFileRecord.h"
+#include "core/Processor.h"
+#include 

nifi-minifi-cpp git commit: MINIFI-388 Backport the rest of EVP_Digest for civetweb

2017-09-28 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 8b3b1c880 -> aaeb929b2


MINIFI-388 Backport the rest of EVP_Digest for civetweb

This closes #139.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/aaeb929b
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/aaeb929b
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/aaeb929b

Branch: refs/heads/master
Commit: aaeb929b289f5c5f9a10811c37a183f2783e93e1
Parents: 8b3b1c8
Author: Caleb Johnson 
Authored: Thu Sep 28 11:25:18 2017 +
Committer: Marc Parisi 
Committed: Thu Sep 28 10:29:31 2017 -0400

--
 thirdparty/civetweb-1.9.1/src/civetweb.c | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/aaeb929b/thirdparty/civetweb-1.9.1/src/civetweb.c
--
diff --git a/thirdparty/civetweb-1.9.1/src/civetweb.c 
b/thirdparty/civetweb-1.9.1/src/civetweb.c
index ba916da..1aa0de6 100644
--- a/thirdparty/civetweb-1.9.1/src/civetweb.c
+++ b/thirdparty/civetweb-1.9.1/src/civetweb.c
@@ -1376,12 +1376,10 @@ struct ssl_func {
(*(int (*)(ASN1_INTEGER *, unsigned char **))crypto_sw[16].ptr)
 #define EVP_get_digestbyname   
\
(*(const EVP_MD *(*)(const char *))crypto_sw[17].ptr)
-#define ASN1_digest
\
-   (*(int (*)(int (*)(),   
   \
-  const EVP_MD *,  
   \
-  char *,  
   \
-  unsigned char *, 
   \
-  unsigned int *))crypto_sw[18].ptr)
+#define EVP_Digest 
\
+   (*(int (*)( 
   \
+   const void *, size_t, void *, unsigned int *, const EVP_MD *, void 
*)) \
+ crypto_sw[18].ptr)
 #define i2d_X509 (*(int (*)(X509 *, unsigned char **))crypto_sw[19].ptr)
 
 
@@ -1444,7 +1442,7 @@ static struct ssl_func crypto_sw[] = 
{{"CRYPTO_num_locks", NULL},
   {"X509_get_serialNumber", NULL},
   {"i2c_ASN1_INTEGER", NULL},
   {"EVP_get_digestbyname", NULL},
-  {"ASN1_digest", NULL},
+  {"EVP_Digest", NULL},
   {"i2d_X509", NULL},
   {NULL, NULL}};
 #endif /* NO_SSL_DL */



nifi-minifi-cpp git commit: MINIFI-388 Disable dynamic loading of TLS libs in civet, install libressl instead of openssl to resolve conflict with libcurl deps, and backport fix for civetweb which fixe

2017-09-01 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 0c31102da -> d422e725c


MINIFI-388 Disable dynamic loading of TLS libs in civet, install libressl 
instead of openssl
to resolve conflict with libcurl deps, and backport fix for civetweb which 
fixes compatibility with libressl

This closes #131.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/d422e725
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/d422e725
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/d422e725

Branch: refs/heads/master
Commit: d422e725cb0afb44a38c1062e832c1db284fd57b
Parents: 0c31102
Author: Andrew I. Christianson 
Authored: Mon Aug 21 12:19:54 2017 -0400
Committer: Marc Parisi 
Committed: Fri Sep 1 10:22:35 2017 -0400

--
 CMakeLists.txt   |  3 ++-
 docker/Dockerfile|  6 --
 thirdparty/civetweb-1.9.1/src/civetweb.c | 26 +-
 3 files changed, 31 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d422e725/CMakeLists.txt
--
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 361f9a5..292bc8d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -101,9 +101,10 @@ set(prefix "lib")
 set(suffix ".a")
 set(JSONCPP_LIB "${JSONCPP_LIB_DIR}/lib/${prefix}jsoncpp${suffix}")
 
+set(CIVETWEB_ENABLE_SSL_DYNAMIC_LOADING OFF CACHE BOOL "Disable dynamic SSL 
library loading")
 set(CIVETWEB_ENABLE_CXX ON CACHE BOOL "Enable civet C++ library")
 add_subdirectory(thirdparty/yaml-cpp-yaml-cpp-0.5.3)
-add_subdirectory(thirdparty/civetweb-1.9.1)
+add_subdirectory(thirdparty/civetweb-1.9.1 EXCLUDE_FROM_ALL)
 include_directories(thirdparty/concurrentqueue)
 add_subdirectory(libminifi)
 add_subdirectory(main)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d422e725/docker/Dockerfile
--
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 213015c..7688439 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -44,7 +44,8 @@ RUN apk --update --no-cache upgrade && apk --update 
--no-cache add gcc \
git \
unzip \
gpsd-dev \
-   openssl-dev
+   libressl-dev \
+   zlib-dev
 
 ENV USER minificpp
 ENV MINIFI_BASE_DIR /opt/minifi
@@ -86,7 +87,8 @@ RUN apk --update --no-cache upgrade && apk add --update 
--no-cache \
curl \
unzip \
gpsd \
-   openssl
+   libressl \
+   zlib
 
 # Start MiNiFi CPP in the foreground
 ENV USER minificpp

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d422e725/thirdparty/civetweb-1.9.1/src/civetweb.c
--
diff --git a/thirdparty/civetweb-1.9.1/src/civetweb.c 
b/thirdparty/civetweb-1.9.1/src/civetweb.c
index da491b6..ba916da 100644
--- a/thirdparty/civetweb-1.9.1/src/civetweb.c
+++ b/thirdparty/civetweb-1.9.1/src/civetweb.c
@@ -11826,6 +11826,9 @@ ssl_get_client_cert_info(struct mg_connection *conn)
unsigned char buf[256];
int len;
unsigned int ulen;
+   int ilen;
+   unsigned char *tmp_buf;
+   unsigned char *tmp_p;
 
/* Handle to algorithm used for fingerprint */
const EVP_MD *digest = EVP_get_digestbyname("sha1");
@@ -11856,7 +11859,24 @@ ssl_get_client_cert_info(struct mg_connection *conn)
 
/* Calculate SHA1 fingerprint and store as a hex string */
ulen = 0;
-   ASN1_digest((int (*)())i2d_X509, digest, (char *)cert, buf, 
);
+
+   /* ASN1_digest is deprecated. Do the calculation manually,
+* using EVP_Digest. */
+   ilen = i2d_X509(cert, NULL);
+   tmp_buf =
+   (ilen > 0)
+   ? (unsigned char *)mg_malloc((unsigned)ilen + 1)
+   : NULL;
+   if (tmp_buf) {
+   tmp_p = tmp_buf;
+   (void)i2d_X509(cert, _p);
+   if (!EVP_Digest(
+   tmp_buf, (unsigned)ilen, buf, , 
digest, NULL)) {
+   ulen = 0;
+   }
+   mg_free(tmp_buf);
+   }
+
if (!hexdump2string(
buf, (int)ulen, str_finger, (int)sizeof(str_finger))) {
*str_finger = 0;
@@ -12109,7 +12129,11 @@ set_ssl_option(struct mg_context *ctx)
SSL_CTX_set_options(ctx->ssl_ctx, 

nifi-minifi-cpp git commit: MINIFI-389 Added support for one-way TLS to SSLContextService

2017-08-30 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 2efac2da5 -> 0c31102da


MINIFI-389 Added support for one-way TLS to SSLContextService

This closes #132.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/0c31102d
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/0c31102d
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/0c31102d

Branch: refs/heads/master
Commit: 0c31102da9227d32659e2ed861fd9eec36fd1467
Parents: 2efac2d
Author: Andrew I. Christianson 
Authored: Fri Aug 25 16:24:12 2017 -0400
Committer: Marc Parisi 
Committed: Wed Aug 30 11:04:49 2017 -0400

--
 .../include/controllers/SSLContextService.h | 39 
 libminifi/src/controllers/SSLContextService.cpp | 37 +++
 2 files changed, 44 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/0c31102d/libminifi/include/controllers/SSLContextService.h
--
diff --git a/libminifi/include/controllers/SSLContextService.h 
b/libminifi/include/controllers/SSLContextService.h
index 9093d5f..c48d30f 100644
--- a/libminifi/include/controllers/SSLContextService.h
+++ b/libminifi/include/controllers/SSLContextService.h
@@ -100,27 +100,34 @@ class SSLContextService : public 
core::controller::ControllerService {
   }
 
   bool configure_ssl_context(SSL_CTX *ctx) {
-if (SSL_CTX_use_certificate_file(ctx, certificate.c_str(), 
SSL_FILETYPE_PEM) <= 0) {
-  logger_->log_error("Could not create load certificate, error : %s", 
std::strerror(errno));
-  return false;
-}
-if (!IsNullOrEmpty(passphrase_)) {
-  SSL_CTX_set_default_passwd_cb_userdata(ctx, _);
-  SSL_CTX_set_default_passwd_cb(ctx, pemPassWordCb);
+if (!IsNullOrEmpty(certificate)) {
+  if (SSL_CTX_use_certificate_file(ctx, certificate.c_str(), 
SSL_FILETYPE_PEM) <= 0) {
+logger_->log_error("Could not create load certificate, error : %s", 
std::strerror(errno));
+return false;
+  }
+  if (!IsNullOrEmpty(passphrase_)) {
+SSL_CTX_set_default_passwd_cb_userdata(ctx, _);
+SSL_CTX_set_default_passwd_cb(ctx, pemPassWordCb);
+  }
 }
 
-int retp = SSL_CTX_use_PrivateKey_file(ctx, private_key_.c_str(), 
SSL_FILETYPE_PEM);
-if (retp != 1) {
-  logger_->log_error("Could not create load private key,%i on %s error : 
%s", retp, private_key_, std::strerror(errno));
-  return false;
+if (!IsNullOrEmpty(private_key_)) {
+  int retp = SSL_CTX_use_PrivateKey_file(ctx, private_key_.c_str(), 
SSL_FILETYPE_PEM);
+  if (retp != 1) {
+logger_->log_error("Could not create load private key,%i on %s error : 
%s", retp, private_key_,
+   std::strerror(errno));
+return false;
+  }
+
+  if (!SSL_CTX_check_private_key(ctx)) {
+logger_->log_error("Private key does not match the public certificate, 
error : %s", std::strerror(errno));
+return false;
+  }
 }
 
-if (!SSL_CTX_check_private_key(ctx)) {
-  logger_->log_error("Private key does not match the public certificate, 
error : %s", std::strerror(errno));
-  return false;
-}
+SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, nullptr);
+int retp = SSL_CTX_load_verify_locations(ctx, ca_certificate_.c_str(), 0);
 
-retp = SSL_CTX_load_verify_locations(ctx, ca_certificate_.c_str(), 0);
 if (retp == 0) {
   logger_->log_error("Can not load CA certificate, Exiting, error : %s", 
std::strerror(errno));
   return false;

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/0c31102d/libminifi/src/controllers/SSLContextService.cpp
--
diff --git a/libminifi/src/controllers/SSLContextService.cpp 
b/libminifi/src/controllers/SSLContextService.cpp
index 73c9e35..95ccbb0 100644
--- a/libminifi/src/controllers/SSLContextService.cpp
+++ b/libminifi/src/controllers/SSLContextService.cpp
@@ -51,27 +51,32 @@ std::unique_ptr 
SSLContextService::createSSLContext() {
   method = TLSv1_2_client_method();
   SSL_CTX *ctx = SSL_CTX_new(method);
 
-  if (SSL_CTX_use_certificate_file(ctx, certificate.c_str(), SSL_FILETYPE_PEM) 
<= 0) {
-logger_->log_error("Could not create load certificate, error : %s", 
std::strerror(errno));
-return nullptr;
-  }
-  if (!IsNullOrEmpty(passphrase_)) {
-SSL_CTX_set_default_passwd_cb_userdata(ctx, _);
-SSL_CTX_set_default_passwd_cb(ctx, pemPassWordCb);
+  if (!IsNullOrEmpty(certificate)) {
+if (SSL_CTX_use_certificate_file(ctx, certificate.c_str(), 
SSL_FILETYPE_PEM) <= 0) {
+  

[24/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
MINIFI-372: Remove documentation and test utilities


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/d3a13a49
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/d3a13a49
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/d3a13a49

Branch: refs/heads/master
Commit: d3a13a497738b81b600655760b5425d7f314ae62
Parents: 49ed509
Author: Marc Parisi 
Authored: Mon Oct 16 14:40:05 2017 -0400
Committer: Marc Parisi 
Committed: Wed Oct 18 15:38:21 2017 -0400

--
 CMakeLists.txt  | 2 +-
 extensions/rocksdb-repos/CMakeLists.txt | 3 +-
 thirdparty/rocksdb/CMakeLists.txt   |22 -
 thirdparty/rocksdb/db/db_test_util.cc   |  1395 --
 thirdparty/rocksdb/db/db_test_util.h|   939 -
 thirdparty/rocksdb/docs/.gitignore  | 9 -
 thirdparty/rocksdb/docs/CNAME   | 1 -
 thirdparty/rocksdb/docs/CONTRIBUTING.md |   115 -
 thirdparty/rocksdb/docs/Gemfile | 2 -
 thirdparty/rocksdb/docs/Gemfile.lock|   145 -
 thirdparty/rocksdb/docs/LICENSE-DOCUMENTATION   |   385 -
 thirdparty/rocksdb/docs/README.md   |80 -
 thirdparty/rocksdb/docs/TEMPLATE-INFORMATION.md |17 -
 thirdparty/rocksdb/docs/_config.yml |85 -
 thirdparty/rocksdb/docs/_data/authors.yml   |62 -
 thirdparty/rocksdb/docs/_data/features.yml  |19 -
 thirdparty/rocksdb/docs/_data/nav.yml   |30 -
 thirdparty/rocksdb/docs/_data/nav_docs.yml  | 3 -
 thirdparty/rocksdb/docs/_data/powered_by.yml| 1 -
 .../rocksdb/docs/_data/powered_by_highlight.yml | 1 -
 thirdparty/rocksdb/docs/_data/promo.yml | 6 -
 thirdparty/rocksdb/docs/_docs/faq.md|48 -
 .../rocksdb/docs/_docs/getting-started.md   |78 -
 .../rocksdb/docs/_includes/blog_pagination.html |28 -
 .../docs/_includes/content/gridblocks.html  | 5 -
 .../docs/_includes/content/items/gridblock.html |37 -
 thirdparty/rocksdb/docs/_includes/doc.html  |25 -
 .../rocksdb/docs/_includes/doc_paging.html  | 0
 thirdparty/rocksdb/docs/_includes/footer.html   |33 -
 thirdparty/rocksdb/docs/_includes/head.html |23 -
 thirdparty/rocksdb/docs/_includes/header.html   |19 -
 thirdparty/rocksdb/docs/_includes/hero.html | 0
 .../rocksdb/docs/_includes/home_header.html |22 -
 .../rocksdb/docs/_includes/katex_import.html| 3 -
 .../rocksdb/docs/_includes/katex_render.html|   210 -
 thirdparty/rocksdb/docs/_includes/nav.html  |37 -
 .../docs/_includes/nav/collection_nav.html  |64 -
 .../_includes/nav/collection_nav_group.html |19 -
 .../nav/collection_nav_group_item.html  | 1 -
 .../rocksdb/docs/_includes/nav/header_nav.html  |30 -
 .../rocksdb/docs/_includes/nav_search.html  |15 -
 .../docs/_includes/plugins/all_share.html   | 3 -
 .../docs/_includes/plugins/ascii_cinema.html| 2 -
 .../rocksdb/docs/_includes/plugins/button.html  | 6 -
 .../docs/_includes/plugins/github_star.html | 4 -
 .../docs/_includes/plugins/github_watch.html| 4 -
 .../docs/_includes/plugins/google_share.html| 5 -
 .../rocksdb/docs/_includes/plugins/iframe.html  | 6 -
 .../docs/_includes/plugins/like_button.html |18 -
 .../docs/_includes/plugins/plugin_row.html  | 5 -
 .../_includes/plugins/post_social_plugins.html  |34 -
 .../docs/_includes/plugins/slideshow.html   |88 -
 .../docs/_includes/plugins/twitter_follow.html  | 5 -
 .../docs/_includes/plugins/twitter_share.html   | 4 -
 thirdparty/rocksdb/docs/_includes/post.html |35 -
 .../rocksdb/docs/_includes/powered_by.html  |28 -
 .../rocksdb/docs/_includes/social_plugins.html  |24 -
 .../rocksdb/docs/_includes/ui/button.html   | 1 -
 thirdparty/rocksdb/docs/_layouts/basic.html |12 -
 thirdparty/rocksdb/docs/_layouts/blog.html  |11 -
 .../rocksdb/docs/_layouts/blog_default.html |14 -
 thirdparty/rocksdb/docs/_layouts/default.html   |12 -
 .../rocksdb/docs/_layouts/doc_default.html  |14 -
 thirdparty/rocksdb/docs/_layouts/doc_page.html  |10 -
 thirdparty/rocksdb/docs/_layouts/docs.html  | 5 -
 thirdparty/rocksdb/docs/_layouts/home.html  |17 -
 thirdparty/rocksdb/docs/_layouts/page.html  | 3 -
 thirdparty/rocksdb/docs/_layouts/plain.html |10 -
 thirdparty/rocksdb/docs/_layouts/post.html  | 8 -
 thirdparty/rocksdb/docs/_layouts/redirect.html  | 6 -
 thirdparty/rocksdb/docs/_layouts/top-level.html |10 -
 .../2014-03-27-how-to-backup-rocksdb.markdown   |   135 -
 ...-persist-in-memory-rocksdb-database.markdown |54 -
 

[21/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/docs/_posts/2014-06-23-plaintable-a-new-file-format.markdown
--
diff --git 
a/thirdparty/rocksdb/docs/_posts/2014-06-23-plaintable-a-new-file-format.markdown
 
b/thirdparty/rocksdb/docs/_posts/2014-06-23-plaintable-a-new-file-format.markdown
deleted file mode 100644
index 6a641f2..000
--- 
a/thirdparty/rocksdb/docs/_posts/2014-06-23-plaintable-a-new-file-format.markdown
+++ /dev/null
@@ -1,47 +0,0 @@

-title: PlainTable — A New File Format
-layout: post
-author: sdong
-category: blog
-redirect_from:
-  - /blog/599/plaintable-a-new-file-format/

-
-In this post, we are introducing "PlainTable" -- a file format we designed for 
RocksDB, initially to satisfy a production use case at Facebook.
-
-Design goals:
-
-1. All data stored in memory, in files stored in tmpfs/ramfs. Support DBs 
larger than 100GB (may be sharded across multiple RocksDB instance).
-1. Optimize for [prefix 
hashing](https://github.com/facebook/rocksdb/raw/gh-pages/talks/2014-03-27-RocksDB-Meetup-Siying-Prefix-Hash.pdf)
-1. Less than or around 1 micro-second average latency for single Get() or 
Seek().
-1. Minimize memory consumption.
-1. Queries efficiently return empty results
-
-
-
-Notice that our priority was not to maximize query performance, but to strike 
a balance between query performance and memory consumption. PlainTable query 
performance is not as good as you would see with a nicely-designed hash table, 
but they are of the same order of magnitude, while keeping memory overhead to a 
minimum.
-
-Since we are targeting micro-second latency, it is on the level of the number 
of CPU cache misses (if they cannot be parallellized, which are usually the 
case for index look-ups). On our target hardware with Intel CPUs of multiple 
sockets with NUMA, we can only allow 4-5 CPU cache misses (including costs of 
data TLB).
-
-To meet our requirements, given that only hash prefix iterating is needed, we 
made two decisions:
-
-1. to use a hash index, which is
-1. directly addressed to rows, with no block structure.
-
-Having addressed our latency goal, the next task was to design a very compact 
hash index to minimize memory consumption. Some tricks we used to meet this 
goal:
-
-1. We only use 32-bit integers for data and index offsets.The first bit serves 
as a flag, so we can avoid using 8-byte pointers.
-1. We never copy keys or parts of keys to index search structures. We store 
only offsets from which keys can be retrieved, to make comparisons with search 
keys.
-1. Since our file is immutable, we can accurately estimate the number of hash 
buckets needed.
-
-To make sure the format works efficiently with empty queries, we added a bloom 
filter check before the query. This adds only one cache miss for non-empty 
cases [1], but avoids multiple cache misses for most empty results queries. 
This is a good trade-off for use cases with a large percentage of empty results.
-
-These are the design goals and basic ideas of PlainTable file format. For 
detailed information, see [this wiki 
page](https://github.com/facebook/rocksdb/wiki/PlainTable-Format).
-
-[1] Bloom filter checks typically require multiple memory access. However, 
because they are independent, they usually do not make the CPU pipeline stale. 
In any case, we improved the bloom filter to improve data locality - we may 
cover this further in a future blog post.
-
-### Comments
-
-**[Siying Dong](siyin...@fb.com)**
-
-Does [http://rocksdb.org/feed/](http://rocksdb.org/feed/) work?

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/docs/_posts/2014-06-27-avoid-expensive-locks-in-get.markdown
--
diff --git 
a/thirdparty/rocksdb/docs/_posts/2014-06-27-avoid-expensive-locks-in-get.markdown
 
b/thirdparty/rocksdb/docs/_posts/2014-06-27-avoid-expensive-locks-in-get.markdown
deleted file mode 100644
index 4411c7a..000
--- 
a/thirdparty/rocksdb/docs/_posts/2014-06-27-avoid-expensive-locks-in-get.markdown
+++ /dev/null
@@ -1,89 +0,0 @@

-title: Avoid Expensive Locks in Get()
-layout: post
-author: leijin
-category: blog
-redirect_from:
-  - /blog/677/avoid-expensive-locks-in-get/

-
-As promised in the previous [blog post](blog/2014/05/14/lock.html)!
-
-RocksDB employs a multiversion concurrency control strategy. Before reading 
data, it needs to grab the current version, which is encapsulated in a data 
structure called 
[SuperVersion](https://reviews.facebook.net/rROCKSDB1fdb3f7dc60e96394e3e5b69a46ede5d67fb976c).
-
-
-
-At the beginning of `GetImpl()`, it used to do this:
-
-
-mutex_.Lock();
-auto* s = super_version_->Ref();
-mutex_.Unlock();
-
-
-The lock is necessary because pointer super_version_ may be updated, the 
corresponding SuperVersion may be deleted while Ref() is in 

[17/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/java/src/test/java/org/rocksdb/DBOptionsTest.java
--
diff --git 
a/thirdparty/rocksdb/java/src/test/java/org/rocksdb/DBOptionsTest.java 
b/thirdparty/rocksdb/java/src/test/java/org/rocksdb/DBOptionsTest.java
deleted file mode 100644
index 11b7435..000
--- a/thirdparty/rocksdb/java/src/test/java/org/rocksdb/DBOptionsTest.java
+++ /dev/null
@@ -1,637 +0,0 @@
-// Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-
-package org.rocksdb;
-
-import org.junit.ClassRule;
-import org.junit.Test;
-
-import java.nio.file.Paths;
-import java.util.*;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class DBOptionsTest {
-
-  @ClassRule
-  public static final RocksMemoryResource rocksMemoryResource =
-  new RocksMemoryResource();
-
-  public static final Random rand = PlatformRandomHelper.
-  getPlatformSpecificRandomFactory();
-
-  @Test
-  public void getDBOptionsFromProps() {
-// setup sample properties
-final Properties properties = new Properties();
-properties.put("allow_mmap_reads", "true");
-properties.put("bytes_per_sync", "13");
-try(final DBOptions opt = DBOptions.getDBOptionsFromProps(properties)) {
-  assertThat(opt).isNotNull();
-  assertThat(String.valueOf(opt.allowMmapReads())).
-  isEqualTo(properties.get("allow_mmap_reads"));
-  assertThat(String.valueOf(opt.bytesPerSync())).
-  isEqualTo(properties.get("bytes_per_sync"));
-}
-  }
-
-  @Test
-  public void failDBOptionsFromPropsWithIllegalValue() {
-// setup sample properties
-final Properties properties = new Properties();
-properties.put("tomato", "1024");
-properties.put("burger", "2");
-try(final DBOptions opt = DBOptions.getDBOptionsFromProps(properties)) {
-  assertThat(opt).isNull();
-}
-  }
-
-  @Test(expected = IllegalArgumentException.class)
-  public void failDBOptionsFromPropsWithNullValue() {
-try(final DBOptions opt = DBOptions.getDBOptionsFromProps(null)) {
-  //no-op
-}
-  }
-
-  @Test(expected = IllegalArgumentException.class)
-  public void failDBOptionsFromPropsWithEmptyProps() {
-try(final DBOptions opt = DBOptions.getDBOptionsFromProps(
-new Properties())) {
-  //no-op
-}
-  }
-
-  @Test
-  public void linkageOfPrepMethods() {
-try (final DBOptions opt = new DBOptions()) {
-  opt.optimizeForSmallDb();
-}
-  }
-
-  @Test
-  public void env() {
-try (final DBOptions opt = new DBOptions();
- final Env env = Env.getDefault()) {
-  opt.setEnv(env);
-  assertThat(opt.getEnv()).isSameAs(env);
-}
-  }
-
-  @Test
-  public void setIncreaseParallelism() {
-try(final DBOptions opt = new DBOptions()) {
-  final int threads = Runtime.getRuntime().availableProcessors() * 2;
-  opt.setIncreaseParallelism(threads);
-}
-  }
-
-  @Test
-  public void createIfMissing() {
-try(final DBOptions opt = new DBOptions()) {
-  final boolean boolValue = rand.nextBoolean();
-  opt.setCreateIfMissing(boolValue);
-  assertThat(opt.createIfMissing()).isEqualTo(boolValue);
-}
-  }
-
-  @Test
-  public void createMissingColumnFamilies() {
-try(final DBOptions opt = new DBOptions()) {
-  final boolean boolValue = rand.nextBoolean();
-  opt.setCreateMissingColumnFamilies(boolValue);
-  assertThat(opt.createMissingColumnFamilies()).isEqualTo(boolValue);
-}
-  }
-
-  @Test
-  public void errorIfExists() {
-try(final DBOptions opt = new DBOptions()) {
-  final boolean boolValue = rand.nextBoolean();
-  opt.setErrorIfExists(boolValue);
-  assertThat(opt.errorIfExists()).isEqualTo(boolValue);
-}
-  }
-
-  @Test
-  public void paranoidChecks() {
-try(final DBOptions opt = new DBOptions()) {
-  final boolean boolValue = rand.nextBoolean();
-  opt.setParanoidChecks(boolValue);
-  assertThat(opt.paranoidChecks()).isEqualTo(boolValue);
-}
-  }
-
-  @Test
-  public void maxTotalWalSize() {
-try(final DBOptions opt = new DBOptions()) {
-  final long longValue = rand.nextLong();
-  opt.setMaxTotalWalSize(longValue);
-  assertThat(opt.maxTotalWalSize()).isEqualTo(longValue);
-}
-  }
-
-  @Test
-  public void maxOpenFiles() {
-try(final DBOptions opt = new DBOptions()) {
-  final int intValue = rand.nextInt();
-  opt.setMaxOpenFiles(intValue);
-  assertThat(opt.maxOpenFiles()).isEqualTo(intValue);
-}
-  }
-
-  @Test
-  public void maxFileOpeningThreads() {
-try(final DBOptions opt = new DBOptions()) {
-  final int intValue = rand.nextInt();
-  opt.setMaxFileOpeningThreads(intValue);
-  

[02/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/utilities/transactions/transaction_test.cc
--
diff --git a/thirdparty/rocksdb/utilities/transactions/transaction_test.cc 
b/thirdparty/rocksdb/utilities/transactions/transaction_test.cc
deleted file mode 100644
index 148f1c4..000
--- a/thirdparty/rocksdb/utilities/transactions/transaction_test.cc
+++ /dev/null
@@ -1,4578 +0,0 @@
-//  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-
-#ifndef ROCKSDB_LITE
-
-#include 
-#include 
-#include 
-#include 
-
-#include "db/db_impl.h"
-#include "rocksdb/db.h"
-#include "rocksdb/options.h"
-#include "rocksdb/utilities/transaction.h"
-#include "rocksdb/utilities/transaction_db.h"
-#include "table/mock_table.h"
-#include "util/fault_injection_test_env.h"
-#include "util/logging.h"
-#include "util/random.h"
-#include "util/string_util.h"
-#include "util/sync_point.h"
-#include "util/testharness.h"
-#include "util/testutil.h"
-#include "util/transaction_test_util.h"
-#include "utilities/merge_operators.h"
-#include "utilities/merge_operators/string_append/stringappend.h"
-
-#include "port/port.h"
-
-using std::string;
-
-namespace rocksdb {
-
-class TransactionTest
-: public ::testing::TestWithParam> {
- public:
-  TransactionDB* db;
-  FaultInjectionTestEnv* env;
-  string dbname;
-  Options options;
-
-  TransactionDBOptions txn_db_options;
-
-  TransactionTest() {
-options.create_if_missing = true;
-options.max_write_buffer_number = 2;
-options.write_buffer_size = 4 * 1024;
-options.level0_file_num_compaction_trigger = 2;
-options.merge_operator = 
MergeOperators::CreateFromStringId("stringappend");
-env = new FaultInjectionTestEnv(Env::Default());
-options.env = env;
-options.concurrent_prepare = std::get<1>(GetParam());
-dbname = test::TmpDir() + "/transaction_testdb";
-
-DestroyDB(dbname, options);
-txn_db_options.transaction_lock_timeout = 0;
-txn_db_options.default_lock_timeout = 0;
-Status s;
-if (std::get<0>(GetParam()) == false) {
-  s = TransactionDB::Open(options, txn_db_options, dbname, );
-} else {
-  s = OpenWithStackableDB();
-}
-assert(s.ok());
-  }
-
-  ~TransactionTest() {
-delete db;
-DestroyDB(dbname, options);
-delete env;
-  }
-
-  Status ReOpenNoDelete() {
-delete db;
-db = nullptr;
-env->AssertNoOpenFile();
-env->DropUnsyncedFileData();
-env->ResetState();
-Status s;
-if (std::get<0>(GetParam()) == false) {
-  s = TransactionDB::Open(options, txn_db_options, dbname, );
-} else {
-  s = OpenWithStackableDB();
-}
-return s;
-  }
-
-  Status ReOpen() {
-delete db;
-DestroyDB(dbname, options);
-Status s;
-if (std::get<0>(GetParam()) == false) {
-  s = TransactionDB::Open(options, txn_db_options, dbname, );
-} else {
-  s = OpenWithStackableDB();
-}
-return s;
-  }
-
-  Status OpenWithStackableDB() {
-std::vector compaction_enabled_cf_indices;
-std::vector column_families{ColumnFamilyDescriptor(
-kDefaultColumnFamilyName, ColumnFamilyOptions(options))};
-
-TransactionDB::PrepareWrap(, _families,
-   _enabled_cf_indices);
-std::vector handles;
-DB* root_db;
-Options options_copy(options);
-Status s =
-DB::Open(options_copy, dbname, column_families, , _db);
-if (s.ok()) {
-  assert(handles.size() == 1);
-  s = TransactionDB::WrapStackableDB(
-  new StackableDB(root_db), txn_db_options,
-  compaction_enabled_cf_indices, handles, );
-  delete handles[0];
-}
-return s;
-  }
-};
-
-class MySQLStyleTransactionTest : public TransactionTest {};
-
-INSTANTIATE_TEST_CASE_P(DBAsBaseDB, TransactionTest,
-::testing::Values(std::make_tuple(false, false)));
-INSTANTIATE_TEST_CASE_P(StackableDBAsBaseDB, TransactionTest,
-::testing::Values(std::make_tuple(true, false)));
-INSTANTIATE_TEST_CASE_P(MySQLStyleTransactionTest, MySQLStyleTransactionTest,
-::testing::Values(std::make_tuple(false, false),
-  std::make_tuple(false, true),
-  std::make_tuple(true, false),
-  std::make_tuple(true, true)));
-
-TEST_P(TransactionTest, DoubleEmptyWrite) {
-  WriteOptions write_options;
-  write_options.sync = true;
-  write_options.disableWAL = false;
-
-  WriteBatch batch;
-
-  ASSERT_OK(db->Write(write_options, ));
-  ASSERT_OK(db->Write(write_options, ));
-}
-
-TEST_P(TransactionTest, SuccessTest) 

[16/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/java/src/test/java/org/rocksdb/OptionsTest.java
--
diff --git a/thirdparty/rocksdb/java/src/test/java/org/rocksdb/OptionsTest.java 
b/thirdparty/rocksdb/java/src/test/java/org/rocksdb/OptionsTest.java
deleted file mode 100644
index 6afcab3..000
--- a/thirdparty/rocksdb/java/src/test/java/org/rocksdb/OptionsTest.java
+++ /dev/null
@@ -1,1095 +0,0 @@
-// Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-
-package org.rocksdb;
-
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Random;
-
-import org.junit.ClassRule;
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-
-public class OptionsTest {
-
-  @ClassRule
-  public static final RocksMemoryResource rocksMemoryResource =
-  new RocksMemoryResource();
-
-  public static final Random rand = PlatformRandomHelper.
-  getPlatformSpecificRandomFactory();
-
-  @Test
-  public void setIncreaseParallelism() {
-try (final Options opt = new Options()) {
-  final int threads = Runtime.getRuntime().availableProcessors() * 2;
-  opt.setIncreaseParallelism(threads);
-}
-  }
-
-  @Test
-  public void writeBufferSize() throws RocksDBException {
-try (final Options opt = new Options()) {
-  final long longValue = rand.nextLong();
-  opt.setWriteBufferSize(longValue);
-  assertThat(opt.writeBufferSize()).isEqualTo(longValue);
-}
-  }
-
-  @Test
-  public void maxWriteBufferNumber() {
-try (final Options opt = new Options()) {
-  final int intValue = rand.nextInt();
-  opt.setMaxWriteBufferNumber(intValue);
-  assertThat(opt.maxWriteBufferNumber()).isEqualTo(intValue);
-}
-  }
-
-  @Test
-  public void minWriteBufferNumberToMerge() {
-try (final Options opt = new Options()) {
-  final int intValue = rand.nextInt();
-  opt.setMinWriteBufferNumberToMerge(intValue);
-  assertThat(opt.minWriteBufferNumberToMerge()).isEqualTo(intValue);
-}
-  }
-
-  @Test
-  public void numLevels() {
-try (final Options opt = new Options()) {
-  final int intValue = rand.nextInt();
-  opt.setNumLevels(intValue);
-  assertThat(opt.numLevels()).isEqualTo(intValue);
-}
-  }
-
-  @Test
-  public void levelZeroFileNumCompactionTrigger() {
-try (final Options opt = new Options()) {
-  final int intValue = rand.nextInt();
-  opt.setLevelZeroFileNumCompactionTrigger(intValue);
-  assertThat(opt.levelZeroFileNumCompactionTrigger()).isEqualTo(intValue);
-}
-  }
-
-  @Test
-  public void levelZeroSlowdownWritesTrigger() {
-try (final Options opt = new Options()) {
-  final int intValue = rand.nextInt();
-  opt.setLevelZeroSlowdownWritesTrigger(intValue);
-  assertThat(opt.levelZeroSlowdownWritesTrigger()).isEqualTo(intValue);
-}
-  }
-
-  @Test
-  public void levelZeroStopWritesTrigger() {
-try (final Options opt = new Options()) {
-  final int intValue = rand.nextInt();
-  opt.setLevelZeroStopWritesTrigger(intValue);
-  assertThat(opt.levelZeroStopWritesTrigger()).isEqualTo(intValue);
-}
-  }
-
-  @Test
-  public void targetFileSizeBase() {
-try (final Options opt = new Options()) {
-  final long longValue = rand.nextLong();
-  opt.setTargetFileSizeBase(longValue);
-  assertThat(opt.targetFileSizeBase()).isEqualTo(longValue);
-}
-  }
-
-  @Test
-  public void targetFileSizeMultiplier() {
-try (final Options opt = new Options()) {
-  final int intValue = rand.nextInt();
-  opt.setTargetFileSizeMultiplier(intValue);
-  assertThat(opt.targetFileSizeMultiplier()).isEqualTo(intValue);
-}
-  }
-
-  @Test
-  public void maxBytesForLevelBase() {
-try (final Options opt = new Options()) {
-  final long longValue = rand.nextLong();
-  opt.setMaxBytesForLevelBase(longValue);
-  assertThat(opt.maxBytesForLevelBase()).isEqualTo(longValue);
-}
-  }
-
-  @Test
-  public void levelCompactionDynamicLevelBytes() {
-try (final Options opt = new Options()) {
-  final boolean boolValue = rand.nextBoolean();
-  opt.setLevelCompactionDynamicLevelBytes(boolValue);
-  assertThat(opt.levelCompactionDynamicLevelBytes())
-  .isEqualTo(boolValue);
-}
-  }
-
-  @Test
-  public void maxBytesForLevelMultiplier() {
-try (final Options opt = new Options()) {
-  final double doubleValue = rand.nextDouble();
-  opt.setMaxBytesForLevelMultiplier(doubleValue);
-  assertThat(opt.maxBytesForLevelMultiplier()).isEqualTo(doubleValue);
-}
-  }
-
-  @Test
-  public void 

[10/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/util/fault_injection_test_env.cc
--
diff --git a/thirdparty/rocksdb/util/fault_injection_test_env.cc 
b/thirdparty/rocksdb/util/fault_injection_test_env.cc
deleted file mode 100644
index 3b3a8b9..000
--- a/thirdparty/rocksdb/util/fault_injection_test_env.cc
+++ /dev/null
@@ -1,313 +0,0 @@
-//  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-//
-// Copyright 2014 The LevelDB Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
-
-// This test uses a custom Env to keep track of the state of a filesystem as of
-// the last "sync". It then checks for data loss errors by purposely dropping
-// file data (or entire files) not protected by a "sync".
-
-#include "util/fault_injection_test_env.h"
-#include 
-#include 
-
-namespace rocksdb {
-
-// Assume a filename, and not a directory name like "/foo/bar/"
-std::string GetDirName(const std::string filename) {
-  size_t found = filename.find_last_of("/\\");
-  if (found == std::string::npos) {
-return "";
-  } else {
-return filename.substr(0, found);
-  }
-}
-
-// A basic file truncation function suitable for this test.
-Status Truncate(Env* env, const std::string& filename, uint64_t length) {
-  unique_ptr orig_file;
-  const EnvOptions options;
-  Status s = env->NewSequentialFile(filename, _file, options);
-  if (!s.ok()) {
-fprintf(stderr, "Cannot truncate file %s: %s\n", filename.c_str(),
-s.ToString().c_str());
-return s;
-  }
-
-  std::unique_ptr scratch(new char[length]);
-  rocksdb::Slice result;
-  s = orig_file->Read(length, , scratch.get());
-#ifdef OS_WIN
-  orig_file.reset();
-#endif
-  if (s.ok()) {
-std::string tmp_name = GetDirName(filename) + "/truncate.tmp";
-unique_ptr tmp_file;
-s = env->NewWritableFile(tmp_name, _file, options);
-if (s.ok()) {
-  s = tmp_file->Append(result);
-  if (s.ok()) {
-s = env->RenameFile(tmp_name, filename);
-  } else {
-fprintf(stderr, "Cannot rename file %s to %s: %s\n", tmp_name.c_str(),
-filename.c_str(), s.ToString().c_str());
-env->DeleteFile(tmp_name);
-  }
-}
-  }
-  if (!s.ok()) {
-fprintf(stderr, "Cannot truncate file %s: %s\n", filename.c_str(),
-s.ToString().c_str());
-  }
-
-  return s;
-}
-
-// Trim the tailing "/" in the end of `str`
-std::string TrimDirname(const std::string& str) {
-  size_t found = str.find_last_not_of("/");
-  if (found == std::string::npos) {
-return str;
-  }
-  return str.substr(0, found + 1);
-}
-
-// Return pair  of a full path.
-std::pair GetDirAndName(const std::string& name) {
-  std::string dirname = GetDirName(name);
-  std::string fname = name.substr(dirname.size() + 1);
-  return std::make_pair(dirname, fname);
-}
-
-Status FileState::DropUnsyncedData(Env* env) const {
-  ssize_t sync_pos = pos_at_last_sync_ == -1 ? 0 : pos_at_last_sync_;
-  return Truncate(env, filename_, sync_pos);
-}
-
-Status FileState::DropRandomUnsyncedData(Env* env, Random* rand) const {
-  ssize_t sync_pos = pos_at_last_sync_ == -1 ? 0 : pos_at_last_sync_;
-  assert(pos_ >= sync_pos);
-  int range = static_cast(pos_ - sync_pos);
-  uint64_t truncated_size =
-  static_cast(sync_pos) + rand->Uniform(range);
-  return Truncate(env, filename_, truncated_size);
-}
-
-Status TestDirectory::Fsync() {
-  env_->SyncDir(dirname_);
-  return dir_->Fsync();
-}
-
-TestWritableFile::TestWritableFile(const std::string& fname,
-   unique_ptr&& f,
-   FaultInjectionTestEnv* env)
-: state_(fname),
-  target_(std::move(f)),
-  writable_file_opened_(true),
-  env_(env) {
-  assert(target_ != nullptr);
-  state_.pos_ = 0;
-}
-
-TestWritableFile::~TestWritableFile() {
-  if (writable_file_opened_) {
-Close();
-  }
-}
-
-Status TestWritableFile::Append(const Slice& data) {
-  if (!env_->IsFilesystemActive()) {
-return Status::Corruption("Not Active");
-  }
-  Status s = target_->Append(data);
-  if (s.ok()) {
-state_.pos_ += data.size();
-  }
-  return s;
-}
-
-Status TestWritableFile::Close() {
-  writable_file_opened_ = false;
-  Status s = target_->Close();
-  if (s.ok()) {
-env_->WritableFileClosed(state_);
-  }
-  return s;
-}
-
-Status TestWritableFile::Flush() {
-  Status s = target_->Flush();
-  if (s.ok() && env_->IsFilesystemActive()) {
-state_.pos_at_last_flush_ = state_.pos_;
-  }
-  return s;
-}
-
-Status TestWritableFile::Sync() {
-  if 

[07/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/utilities/cassandra/cassandra_format_test.cc
--
diff --git a/thirdparty/rocksdb/utilities/cassandra/cassandra_format_test.cc 
b/thirdparty/rocksdb/utilities/cassandra/cassandra_format_test.cc
deleted file mode 100644
index 0cf124d..000
--- a/thirdparty/rocksdb/utilities/cassandra/cassandra_format_test.cc
+++ /dev/null
@@ -1,353 +0,0 @@
-// Copyright (c) 2017-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-
-#include 
-#include 
-#include "util/testharness.h"
-#include "utilities/cassandra/format.h"
-#include "utilities/cassandra/serialize.h"
-#include "utilities/cassandra/test_utils.h"
-
-using namespace rocksdb::cassandra;
-
-namespace rocksdb {
-namespace cassandra {
-
-TEST(ColumnTest, Column) {
-  char data[4] = {'d', 'a', 't', 'a'};
-  int8_t mask = 0;
-  int8_t index = 1;
-  int64_t timestamp = 1494022807044;
-  Column c = Column(mask, index, timestamp, sizeof(data), data);
-
-  EXPECT_EQ(c.Index(), index);
-  EXPECT_EQ(c.Timestamp(), timestamp);
-  EXPECT_EQ(c.Size(), 14 + sizeof(data));
-
-  // Verify the serialization.
-  std::string dest;
-  dest.reserve(c.Size() * 2);
-  c.Serialize();
-
-  EXPECT_EQ(dest.size(), c.Size());
-  std::size_t offset = 0;
-  EXPECT_EQ(Deserialize(dest.c_str(), offset), mask);
-  offset += sizeof(int8_t);
-  EXPECT_EQ(Deserialize(dest.c_str(), offset), index);
-  offset += sizeof(int8_t);
-  EXPECT_EQ(Deserialize(dest.c_str(), offset), timestamp);
-  offset += sizeof(int64_t);
-  EXPECT_EQ(Deserialize(dest.c_str(), offset), sizeof(data));
-  offset += sizeof(int32_t);
-  EXPECT_TRUE(std::memcmp(data, dest.c_str() + offset, sizeof(data)) == 0);
-
-  // Verify the deserialization.
-  std::string saved_dest = dest;
-  std::shared_ptr c1 = Column::Deserialize(saved_dest.c_str(), 0);
-  EXPECT_EQ(c1->Index(), index);
-  EXPECT_EQ(c1->Timestamp(), timestamp);
-  EXPECT_EQ(c1->Size(), 14 + sizeof(data));
-
-  c1->Serialize();
-  EXPECT_EQ(dest.size(), 2 * c.Size());
-  EXPECT_TRUE(
-std::memcmp(dest.c_str(), dest.c_str() + c.Size(), c.Size()) == 0);
-
-  // Verify the ColumnBase::Deserialization.
-  saved_dest = dest;
-  std::shared_ptr c2 =
-  ColumnBase::Deserialize(saved_dest.c_str(), c.Size());
-  c2->Serialize();
-  EXPECT_EQ(dest.size(), 3 * c.Size());
-  EXPECT_TRUE(
-std::memcmp(dest.c_str() + c.Size(), dest.c_str() + c.Size() * 2, c.Size())
-  == 0);
-}
-
-TEST(ExpiringColumnTest, ExpiringColumn) {
-  char data[4] = {'d', 'a', 't', 'a'};
-  int8_t mask = ColumnTypeMask::EXPIRATION_MASK;
-  int8_t index = 3;
-  int64_t timestamp = 1494022807044;
-  int32_t ttl = 3600;
-  ExpiringColumn c = ExpiringColumn(mask, index, timestamp,
-sizeof(data), data, ttl);
-
-  EXPECT_EQ(c.Index(), index);
-  EXPECT_EQ(c.Timestamp(), timestamp);
-  EXPECT_EQ(c.Size(), 18 + sizeof(data));
-
-  // Verify the serialization.
-  std::string dest;
-  dest.reserve(c.Size() * 2);
-  c.Serialize();
-
-  EXPECT_EQ(dest.size(), c.Size());
-  std::size_t offset = 0;
-  EXPECT_EQ(Deserialize(dest.c_str(), offset), mask);
-  offset += sizeof(int8_t);
-  EXPECT_EQ(Deserialize(dest.c_str(), offset), index);
-  offset += sizeof(int8_t);
-  EXPECT_EQ(Deserialize(dest.c_str(), offset), timestamp);
-  offset += sizeof(int64_t);
-  EXPECT_EQ(Deserialize(dest.c_str(), offset), sizeof(data));
-  offset += sizeof(int32_t);
-  EXPECT_TRUE(std::memcmp(data, dest.c_str() + offset, sizeof(data)) == 0);
-  offset += sizeof(data);
-  EXPECT_EQ(Deserialize(dest.c_str(), offset), ttl);
-
-  // Verify the deserialization.
-  std::string saved_dest = dest;
-  std::shared_ptr c1 =
-  ExpiringColumn::Deserialize(saved_dest.c_str(), 0);
-  EXPECT_EQ(c1->Index(), index);
-  EXPECT_EQ(c1->Timestamp(), timestamp);
-  EXPECT_EQ(c1->Size(), 18 + sizeof(data));
-
-  c1->Serialize();
-  EXPECT_EQ(dest.size(), 2 * c.Size());
-  EXPECT_TRUE(
-std::memcmp(dest.c_str(), dest.c_str() + c.Size(), c.Size()) == 0);
-
-  // Verify the ColumnBase::Deserialization.
-  saved_dest = dest;
-  std::shared_ptr c2 =
-  ColumnBase::Deserialize(saved_dest.c_str(), c.Size());
-  c2->Serialize();
-  EXPECT_EQ(dest.size(), 3 * c.Size());
-  EXPECT_TRUE(
-std::memcmp(dest.c_str() + c.Size(), dest.c_str() + c.Size() * 2, c.Size())
-  == 0);
-}
-
-TEST(TombstoneTest, Tombstone) {
-  int8_t mask = ColumnTypeMask::DELETION_MASK;
-  int8_t index = 2;
-  int32_t local_deletion_time = 1494022807;
-  int64_t marked_for_delete_at = 1494022807044;
-  Tombstone c = Tombstone(mask, index, local_deletion_time,
-  marked_for_delete_at);
-
-  EXPECT_EQ(c.Index(), index);
-  EXPECT_EQ(c.Timestamp(), marked_for_delete_at);
- 

[08/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/utilities/backupable/backupable_db_test.cc
--
diff --git a/thirdparty/rocksdb/utilities/backupable/backupable_db_test.cc 
b/thirdparty/rocksdb/utilities/backupable/backupable_db_test.cc
deleted file mode 100644
index be20a8d..000
--- a/thirdparty/rocksdb/utilities/backupable/backupable_db_test.cc
+++ /dev/null
@@ -1,1548 +0,0 @@
-//  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-//
-// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
-
-#if !defined(ROCKSDB_LITE) && !defined(OS_WIN)
-
-#include 
-#include 
-
-#include "db/db_impl.h"
-#include "env/env_chroot.h"
-#include "port/port.h"
-#include "port/stack_trace.h"
-#include "rocksdb/rate_limiter.h"
-#include "rocksdb/transaction_log.h"
-#include "rocksdb/types.h"
-#include "rocksdb/utilities/backupable_db.h"
-#include "rocksdb/utilities/options_util.h"
-#include "util/file_reader_writer.h"
-#include "util/filename.h"
-#include "util/mutexlock.h"
-#include "util/random.h"
-#include "util/stderr_logger.h"
-#include "util/string_util.h"
-#include "util/sync_point.h"
-#include "util/testharness.h"
-#include "util/testutil.h"
-
-namespace rocksdb {
-
-namespace {
-
-using std::unique_ptr;
-
-class DummyDB : public StackableDB {
- public:
-  /* implicit */
-  DummyDB(const Options& options, const std::string& dbname)
- : StackableDB(nullptr), options_(options), dbname_(dbname),
-   deletions_enabled_(true), sequence_number_(0) {}
-
-  virtual SequenceNumber GetLatestSequenceNumber() const override {
-return ++sequence_number_;
-  }
-
-  virtual const std::string& GetName() const override {
-return dbname_;
-  }
-
-  virtual Env* GetEnv() const override {
-return options_.env;
-  }
-
-  using DB::GetOptions;
-  virtual Options GetOptions(ColumnFamilyHandle* column_family) const override 
{
-return options_;
-  }
-
-  virtual DBOptions GetDBOptions() const override {
-return DBOptions(options_);
-  }
-
-  virtual Status EnableFileDeletions(bool force) override {
-EXPECT_TRUE(!deletions_enabled_);
-deletions_enabled_ = true;
-return Status::OK();
-  }
-
-  virtual Status DisableFileDeletions() override {
-EXPECT_TRUE(deletions_enabled_);
-deletions_enabled_ = false;
-return Status::OK();
-  }
-
-  virtual Status GetLiveFiles(std::vector& vec, uint64_t* mfs,
-  bool flush_memtable = true) override {
-EXPECT_TRUE(!deletions_enabled_);
-vec = live_files_;
-*mfs = 100;
-return Status::OK();
-  }
-
-  virtual ColumnFamilyHandle* DefaultColumnFamily() const override {
-return nullptr;
-  }
-
-  class DummyLogFile : public LogFile {
-   public:
-/* implicit */
- DummyLogFile(const std::string& path, bool alive = true)
- : path_(path), alive_(alive) {}
-
-virtual std::string PathName() const override {
-  return path_;
-}
-
-virtual uint64_t LogNumber() const override {
-  // what business do you have calling this method?
-  ADD_FAILURE();
-  return 0;
-}
-
-virtual WalFileType Type() const override {
-  return alive_ ? kAliveLogFile : kArchivedLogFile;
-}
-
-virtual SequenceNumber StartSequence() const override {
-  // this seqnum guarantees the dummy file will be included in the backup
-  // as long as it is alive.
-  return kMaxSequenceNumber;
-}
-
-virtual uint64_t SizeFileBytes() const override {
-  return 0;
-}
-
-   private:
-std::string path_;
-bool alive_;
-  }; // DummyLogFile
-
-  virtual Status GetSortedWalFiles(VectorLogPtr& files) override {
-EXPECT_TRUE(!deletions_enabled_);
-files.resize(wal_files_.size());
-for (size_t i = 0; i < files.size(); ++i) {
-  files[i].reset(
-  new DummyLogFile(wal_files_[i].first, wal_files_[i].second));
-}
-return Status::OK();
-  }
-
-  // To avoid FlushWAL called on stacked db which is nullptr
-  virtual Status FlushWAL(bool sync) override { return Status::OK(); }
-
-  std::vector live_files_;
-  // pair
-  std::vector> wal_files_;
- private:
-  Options options_;
-  std::string dbname_;
-  bool deletions_enabled_;
-  mutable SequenceNumber sequence_number_;
-}; // DummyDB
-
-class TestEnv : public EnvWrapper {
- public:
-  explicit TestEnv(Env* t) : EnvWrapper(t) {}
-
-  class DummySequentialFile : public SequentialFile {
-   public:
-explicit DummySequentialFile(bool fail_reads)
-: SequentialFile(), 

[14/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/java/src/test/java/org/rocksdb/WriteBatchTest.java
--
diff --git 
a/thirdparty/rocksdb/java/src/test/java/org/rocksdb/WriteBatchTest.java 
b/thirdparty/rocksdb/java/src/test/java/org/rocksdb/WriteBatchTest.java
deleted file mode 100644
index 83f90c8..000
--- a/thirdparty/rocksdb/java/src/test/java/org/rocksdb/WriteBatchTest.java
+++ /dev/null
@@ -1,296 +0,0 @@
-//  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-//
-// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
-package org.rocksdb;
-
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-
-import java.io.UnsupportedEncodingException;
-import java.util.Arrays;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * This class mimics the db/write_batch_test.cc
- * in the c++ rocksdb library.
- * 
- * Not ported yet:
- * 
- * Continue();
- * PutGatherSlices();
- */
-public class WriteBatchTest {
-  @ClassRule
-  public static final RocksMemoryResource rocksMemoryResource =
-  new RocksMemoryResource();
-
-  @Rule
-  public TemporaryFolder dbFolder = new TemporaryFolder();
-
-  @Test
-  public void emptyWriteBatch() {
-try (final WriteBatch batch = new WriteBatch()) {
-  assertThat(batch.count()).isEqualTo(0);
-}
-  }
-
-  @Test
-  public void multipleBatchOperations()
-  throws UnsupportedEncodingException {
-try (WriteBatch batch = new WriteBatch()) {
-  batch.put("foo".getBytes("US-ASCII"), "bar".getBytes("US-ASCII"));
-  batch.remove("box".getBytes("US-ASCII"));
-  batch.put("baz".getBytes("US-ASCII"), "boo".getBytes("US-ASCII"));
-
-  WriteBatchTestInternalHelper.setSequence(batch, 100);
-  assertThat(WriteBatchTestInternalHelper.sequence(batch)).
-  isNotNull().
-  isEqualTo(100);
-  assertThat(batch.count()).isEqualTo(3);
-  assertThat(new String(getContents(batch), "US-ASCII")).
-  isEqualTo("Put(baz, boo)@102" +
-  "Delete(box)@101" +
-  "Put(foo, bar)@100");
-}
-  }
-
-  @Test
-  public void testAppendOperation()
-  throws UnsupportedEncodingException {
-try (final WriteBatch b1 = new WriteBatch();
- final WriteBatch b2 = new WriteBatch()) {
-  WriteBatchTestInternalHelper.setSequence(b1, 200);
-  WriteBatchTestInternalHelper.setSequence(b2, 300);
-  WriteBatchTestInternalHelper.append(b1, b2);
-  assertThat(getContents(b1).length).isEqualTo(0);
-  assertThat(b1.count()).isEqualTo(0);
-  b2.put("a".getBytes("US-ASCII"), "va".getBytes("US-ASCII"));
-  WriteBatchTestInternalHelper.append(b1, b2);
-  assertThat("Put(a, va)@200".equals(new String(getContents(b1),
-  "US-ASCII")));
-  assertThat(b1.count()).isEqualTo(1);
-  b2.clear();
-  b2.put("b".getBytes("US-ASCII"), "vb".getBytes("US-ASCII"));
-  WriteBatchTestInternalHelper.append(b1, b2);
-  assertThat(("Put(a, va)@200" +
-  "Put(b, vb)@201")
-  .equals(new String(getContents(b1), "US-ASCII")));
-  assertThat(b1.count()).isEqualTo(2);
-  b2.remove("foo".getBytes("US-ASCII"));
-  WriteBatchTestInternalHelper.append(b1, b2);
-  assertThat(("Put(a, va)@200" +
-  "Put(b, vb)@202" +
-  "Put(b, vb)@201" +
-  "Delete(foo)@203")
-  .equals(new String(getContents(b1), "US-ASCII")));
-  assertThat(b1.count()).isEqualTo(4);
-}
-  }
-
-  @Test
-  public void blobOperation()
-  throws UnsupportedEncodingException {
-try (final WriteBatch batch = new WriteBatch()) {
-  batch.put("k1".getBytes("US-ASCII"), "v1".getBytes("US-ASCII"));
-  batch.put("k2".getBytes("US-ASCII"), "v2".getBytes("US-ASCII"));
-  batch.put("k3".getBytes("US-ASCII"), "v3".getBytes("US-ASCII"));
-  batch.putLogData("blob1".getBytes("US-ASCII"));
-  batch.remove("k2".getBytes("US-ASCII"));
-  batch.putLogData("blob2".getBytes("US-ASCII"));
-  batch.merge("foo".getBytes("US-ASCII"), "bar".getBytes("US-ASCII"));
-  assertThat(batch.count()).isEqualTo(5);
-  assertThat(("Merge(foo, bar)@4" +
-  "Put(k1, v1)@0" +
-  "Delete(k2)@3" +
-  "Put(k2, v2)@1" +
-  "Put(k3, v3)@2")
-  .equals(new String(getContents(batch), "US-ASCII")));
-}
-  }
-
-  @Test
-  public void savePoints()
-  throws UnsupportedEncodingException, RocksDBException {
-try (final WriteBatch batch = new WriteBatch()) {
-  

[19/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/docs/css/main.scss
--
diff --git a/thirdparty/rocksdb/docs/css/main.scss 
b/thirdparty/rocksdb/docs/css/main.scss
deleted file mode 100644
index 48a3e14..000
--- a/thirdparty/rocksdb/docs/css/main.scss
+++ /dev/null
@@ -1,149 +0,0 @@

-# Only the main Sass file needs front matter (the dashes are enough)

-@charset "utf-8";
-
-@font-face {
-   font-family: 'Lato';
-   src: url("{{ '/static/fonts/LatoLatin-Italic.woff2' }}") 
format('woff2'),
-   url("{{ '/static/fonts/LatoLatin-Italic.woff' }}") 
format('woff');
-   font-weight: normal;
-   font-style: italic;
-}
-
-@font-face {
-   font-family: 'Lato';
-   src: url("{{ '/static/fonts/LatoLatin-Black.woff2' }}") format('woff2'),
-   url("{{ '/static/fonts/LatoLatin-Black.woff' }}") 
format('woff');
-   font-weight: 900;
-   font-style: normal;
-}
-
-@font-face {
-   font-family: 'Lato';
-   src: url("{{ '/static/fonts/LatoLatin-BlackItalic.woff2' }}") 
format('woff2'),
-   url("{{ '/static/fonts/LatoLatin-BlackItalic.woff' }}") 
format('woff');
-   font-weight: 900;
-   font-style: italic;
-}
-
-@font-face {
-   font-family: 'Lato';
-   src: url("{{ '/static/fonts/LatoLatin-Light.woff2' }}") format('woff2'),
-   url("{{ '/static/fonts/LatoLatin-Light.woff' }}") 
format('woff');
-   font-weight: 300;
-   font-style: normal;
-}
-
-@font-face {
-   font-family: 'Lato';
-   src: url("{{ '/static/fonts/LatoLatin-Regular.woff2' }}") 
format('woff2'),
-   url("{{ '/static/fonts/LatoLatin-Regular.woff' }}") 
format('woff');
-   font-weight: normal;
-   font-style: normal;
-}
-
-// Our variables
-$base-font-family:  'Lato', Calibri, Arial, sans-serif;
-$header-font-family:  'Lato', 'Helvetica Neue', Arial, sans-serif;
-$base-font-size:18px;
-$small-font-size:   $base-font-size * 0.875;
-$base-line-height:  1.4em;
-
-$spacing-unit:  12px;
-
-// Two configured colors (see _config.yml)
-$primary-bg:   {{ site.color.primary }};
-$secondary-bg: {{ site.color.secondary }};
-
-// $primary-bg overlays
-{% if site.color.primary-overlay == 'light' %}
-$primary-overlay:  darken($primary-bg, 70%);
-$primary-overlay-special:  darken($primary-bg, 40%);
-{% else %}
-$primary-overlay:  #fff;
-$primary-overlay-special:  lighten($primary-bg, 30%);
-{% endif %}
-
-// $secondary-bg overlays
-{% if site.color.secondary-overlay == 'light' %}
-$text:  #393939;
-$sidenav:darken($secondary-bg, 20%);
-$sidenav-text: $text;
-$sidenav-overlay:  darken($sidenav, 10%);
-$sidenav-active:   lighten($sidenav, 10%);
-{% else %}
-$text:  #fff;
-$sidenav:lighten($secondary-bg, 20%);
-$sidenav-text: $text;
-$sidenav-overlay:  lighten($sidenav, 10%);
-$sidenav-active:   darken($sidenav, 10%);
-{% endif %}
-
-$code-bg:  #002b36;
-
-$header-height: 34px;
-$header-ptop: 10px;
-$header-pbot: 8px;
-
-// Width of the content area
-$content-width: 900px;
-
-// Table setting variables
-$lightergrey: #F8F8F8;
-$greyish: #E8E8E8;
-$lightgrey: #B0B0B0;
-$green: #2db04b;
-
-// Using media queries with like this:
-// @include media-query($on-palm) {
-// .wrapper {
-// padding-right: $spacing-unit / 2;
-// padding-left: $spacing-unit / 2;
-// }
-// }
-@mixin media-query($device) {
-@media screen and (max-width: $device) {
-@content;
-}
-}
-
-
-
-// Import partials from `sass_dir` (defaults to `_sass`)
-@import
-"reset",
-"base",
-   "header",
-"search",
-"syntax-highlighting",
-   "promo",
-   "buttons",
-   "gridBlock",
-   "poweredby",
-   "footer",
-   "react_header_nav",
-   "react_docs_nav",
-   "tables",
-   "blog"
-;
-
-// Anchor links
-// http://ben.balter.com/2014/03/13/pages-anchor-links/
-.header-link {
-  position: absolute;
-  margin-left: 0.2em;
-  opacity: 0;
-
-  -webkit-transition: opacity 0.2s ease-in-out 0.1s;
-  -moz-transition: opacity 0.2s ease-in-out 0.1s;
-  -ms-transition: opacity 0.2s ease-in-out 0.1s;
-}
-
-h2:hover .header-link,
-h3:hover .header-link,
-h4:hover .header-link,
-h5:hover .header-link,
-h6:hover .header-link {
-  opacity: 1;
-}


[05/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/utilities/lua/rocks_lua_test.cc
--
diff --git a/thirdparty/rocksdb/utilities/lua/rocks_lua_test.cc 
b/thirdparty/rocksdb/utilities/lua/rocks_lua_test.cc
deleted file mode 100644
index 025acaf..000
--- a/thirdparty/rocksdb/utilities/lua/rocks_lua_test.cc
+++ /dev/null
@@ -1,498 +0,0 @@
-//  Copyright (c) 2016, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-
-#include 
-
-#if !defined(ROCKSDB_LITE)
-
-#if defined(LUA)
-
-#include 
-
-#include "db/db_test_util.h"
-#include "port/stack_trace.h"
-#include "rocksdb/compaction_filter.h"
-#include "rocksdb/db.h"
-#include "rocksdb/utilities/lua/rocks_lua_compaction_filter.h"
-#include "util/testharness.h"
-
-namespace rocksdb {
-
-class StopOnErrorLogger : public Logger {
- public:
-  using Logger::Logv;
-  virtual void Logv(const char* format, va_list ap) override {
-vfprintf(stderr, format, ap);
-fprintf(stderr, "\n");
-FAIL();
-  }
-};
-
-
-class RocksLuaTest : public testing::Test {
- public:
-  RocksLuaTest() : rnd_(301) {
-temp_dir_ = test::TmpDir(Env::Default());
-db_ = nullptr;
-  }
-
-  std::string RandomString(int len) {
-std::string res;
-for (int i = 0; i < len; ++i) {
-  res += rnd_.Uniform(26) + 'a';
-}
-return res;
-  }
-
-  void CreateDBWithLuaCompactionFilter(
-  const lua::RocksLuaCompactionFilterOptions& lua_opt,
-  const std::string& db_path,
-  std::unordered_map* kvs,
-  const int kNumFlushes = 5,
-  std::shared_ptr*
-  output_factory = nullptr) {
-const int kKeySize = 10;
-const int kValueSize = 50;
-const int kKeysPerFlush = 2;
-auto factory =
-std::make_shared(
-lua_opt);
-if (output_factory != nullptr) {
-  *output_factory = factory;
-}
-
-options_ = Options();
-options_.create_if_missing = true;
-options_.compaction_filter_factory = factory;
-options_.disable_auto_compactions = true;
-options_.max_bytes_for_level_base =
-(kKeySize + kValueSize) * kKeysPerFlush * 2;
-options_.max_bytes_for_level_multiplier = 2;
-options_.target_file_size_base = (kKeySize + kValueSize) * kKeysPerFlush;
-options_.level0_file_num_compaction_trigger = 2;
-DestroyDB(db_path, options_);
-ASSERT_OK(DB::Open(options_, db_path, _));
-
-for (int f = 0; f < kNumFlushes; ++f) {
-  for (int i = 0; i < kKeysPerFlush; ++i) {
-std::string key = RandomString(kKeySize);
-std::string value = RandomString(kValueSize);
-kvs->insert({key, value});
-ASSERT_OK(db_->Put(WriteOptions(), key, value));
-  }
-  db_->Flush(FlushOptions());
-}
-  }
-
-  ~RocksLuaTest() {
-if (db_) {
-  delete db_;
-}
-  }
-  std::string temp_dir_;
-  DB* db_;
-  Random rnd_;
-  Options options_;
-};
-
-TEST_F(RocksLuaTest, Default) {
-  // If nothing is set in the LuaCompactionFilterOptions, then
-  // RocksDB will keep all the key / value pairs, but it will also
-  // print our error log indicating failure.
-  std::string db_path = temp_dir_ + "/rocks_lua_test";
-
-  lua::RocksLuaCompactionFilterOptions lua_opt;
-
-  std::unordered_map kvs;
-  CreateDBWithLuaCompactionFilter(lua_opt, db_path, );
-
-  for (auto const& entry : kvs) {
-std::string value;
-ASSERT_OK(db_->Get(ReadOptions(), entry.first, ));
-ASSERT_EQ(value, entry.second);
-  }
-}
-
-TEST_F(RocksLuaTest, KeepsAll) {
-  std::string db_path = temp_dir_ + "/rocks_lua_test";
-
-  lua::RocksLuaCompactionFilterOptions lua_opt;
-  lua_opt.error_log = std::make_shared();
-  // keeps all the key value pairs
-  lua_opt.lua_script =
-  "function Filter(level, key, existing_value)\n"
-  "  return false, false, \"\"\n"
-  "end\n"
-  "\n"
-  "function FilterMergeOperand(level, key, operand)\n"
-  "  return false\n"
-  "end\n"
-  "function Name()\n"
-  "  return \"KeepsAll\"\n"
-  "end\n"
-  "\n";
-
-  std::unordered_map kvs;
-  CreateDBWithLuaCompactionFilter(lua_opt, db_path, );
-
-  for (auto const& entry : kvs) {
-std::string value;
-ASSERT_OK(db_->Get(ReadOptions(), entry.first, ));
-ASSERT_EQ(value, entry.second);
-  }
-}
-
-TEST_F(RocksLuaTest, GetName) {
-  std::string db_path = temp_dir_ + "/rocks_lua_test";
-
-  lua::RocksLuaCompactionFilterOptions lua_opt;
-  lua_opt.error_log = std::make_shared();
-  const std::string kScriptName = "SimpleLuaCompactionFilter";
-  lua_opt.lua_script =
-  std::string(
-  "function Filter(level, key, existing_value)\n"
-  "  return false, false, \"\"\n"
-  "end\n"
-  

[01/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 49ed50945 -> d3a13a497


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/utilities/ttl/ttl_test.cc
--
diff --git a/thirdparty/rocksdb/utilities/ttl/ttl_test.cc 
b/thirdparty/rocksdb/utilities/ttl/ttl_test.cc
deleted file mode 100644
index 586d0ce..000
--- a/thirdparty/rocksdb/utilities/ttl/ttl_test.cc
+++ /dev/null
@@ -1,645 +0,0 @@
-// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
-
-#ifndef ROCKSDB_LITE
-
-#include 
-#include 
-#include "rocksdb/compaction_filter.h"
-#include "rocksdb/utilities/db_ttl.h"
-#include "util/string_util.h"
-#include "util/testharness.h"
-#ifndef OS_WIN
-#include 
-#endif
-
-namespace rocksdb {
-
-namespace {
-
-typedef std::map KVMap;
-
-enum BatchOperation { OP_PUT = 0, OP_DELETE = 1 };
-}
-
-class SpecialTimeEnv : public EnvWrapper {
- public:
-  explicit SpecialTimeEnv(Env* base) : EnvWrapper(base) {
-base->GetCurrentTime(_time_);
-  }
-
-  void Sleep(int64_t sleep_time) { current_time_ += sleep_time; }
-  virtual Status GetCurrentTime(int64_t* current_time) override {
-*current_time = current_time_;
-return Status::OK();
-  }
-
- private:
-  int64_t current_time_ = 0;
-};
-
-class TtlTest : public testing::Test {
- public:
-  TtlTest() {
-env_.reset(new SpecialTimeEnv(Env::Default()));
-dbname_ = test::TmpDir() + "/db_ttl";
-options_.create_if_missing = true;
-options_.env = env_.get();
-// ensure that compaction is kicked in to always strip timestamp from kvs
-options_.max_compaction_bytes = 1;
-// compaction should take place always from level0 for determinism
-db_ttl_ = nullptr;
-DestroyDB(dbname_, Options());
-  }
-
-  ~TtlTest() {
-CloseTtl();
-DestroyDB(dbname_, Options());
-  }
-
-  // Open database with TTL support when TTL not provided with db_ttl_ pointer
-  void OpenTtl() {
-ASSERT_TRUE(db_ttl_ ==
-nullptr);  //  db should be closed before opening again
-ASSERT_OK(DBWithTTL::Open(options_, dbname_, _ttl_));
-  }
-
-  // Open database with TTL support when TTL provided with db_ttl_ pointer
-  void OpenTtl(int32_t ttl) {
-ASSERT_TRUE(db_ttl_ == nullptr);
-ASSERT_OK(DBWithTTL::Open(options_, dbname_, _ttl_, ttl));
-  }
-
-  // Open with TestFilter compaction filter
-  void OpenTtlWithTestCompaction(int32_t ttl) {
-options_.compaction_filter_factory =
-  std::shared_ptr(
-  new TestFilterFactory(kSampleSize_, kNewValue_));
-OpenTtl(ttl);
-  }
-
-  // Open database with TTL support in read_only mode
-  void OpenReadOnlyTtl(int32_t ttl) {
-ASSERT_TRUE(db_ttl_ == nullptr);
-ASSERT_OK(DBWithTTL::Open(options_, dbname_, _ttl_, ttl, true));
-  }
-
-  void CloseTtl() {
-delete db_ttl_;
-db_ttl_ = nullptr;
-  }
-
-  // Populates and returns a kv-map
-  void MakeKVMap(int64_t num_entries) {
-kvmap_.clear();
-int digits = 1;
-for (int64_t dummy = num_entries; dummy /= 10; ++digits) {
-}
-int digits_in_i = 1;
-for (int64_t i = 0; i < num_entries; i++) {
-  std::string key = "key";
-  std::string value = "value";
-  if (i % 10 == 0) {
-digits_in_i++;
-  }
-  for(int j = digits_in_i; j < digits; j++) {
-key.append("0");
-value.append("0");
-  }
-  AppendNumberTo(, i);
-  AppendNumberTo(, i);
-  kvmap_[key] = value;
-}
-ASSERT_EQ(static_cast(kvmap_.size()),
-  num_entries);  // check all insertions done
-  }
-
-  // Makes a write-batch with key-vals from kvmap_ and 'Write''s it
-  void MakePutWriteBatch(const BatchOperation* batch_ops, int64_t num_ops) {
-ASSERT_LE(num_ops, static_cast(kvmap_.size()));
-static WriteOptions wopts;
-static FlushOptions flush_opts;
-WriteBatch batch;
-kv_it_ = kvmap_.begin();
-for (int64_t i = 0; i < num_ops && kv_it_ != kvmap_.end(); i++, ++kv_it_) {
-  switch (batch_ops[i]) {
-case OP_PUT:
-  batch.Put(kv_it_->first, kv_it_->second);
-  break;
-case OP_DELETE:
-  batch.Delete(kv_it_->first);
-  break;
-default:
-  FAIL();
-  }
-}
-db_ttl_->Write(wopts, );
-db_ttl_->Flush(flush_opts);
-  }
-
-  // Puts num_entries starting from start_pos_map from kvmap_ into the database
-  void PutValues(int64_t start_pos_map, int64_t num_entries, bool flush = true,
- ColumnFamilyHandle* cf = nullptr) {
-ASSERT_TRUE(db_ttl_);
-ASSERT_LE(start_pos_map + num_entries, 
static_cast(kvmap_.size()));
-static WriteOptions wopts;
-static FlushOptions flush_opts;
-kv_it_ = kvmap_.begin();
-advance(kv_it_, start_pos_map);
-for 

[03/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/utilities/transactions/optimistic_transaction_test.cc
--
diff --git 
a/thirdparty/rocksdb/utilities/transactions/optimistic_transaction_test.cc 
b/thirdparty/rocksdb/utilities/transactions/optimistic_transaction_test.cc
deleted file mode 100644
index f627f0e..000
--- a/thirdparty/rocksdb/utilities/transactions/optimistic_transaction_test.cc
+++ /dev/null
@@ -1,1401 +0,0 @@
-//  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-
-#ifndef ROCKSDB_LITE
-
-#include 
-#include 
-#include 
-
-#include "rocksdb/db.h"
-#include "rocksdb/utilities/optimistic_transaction_db.h"
-#include "rocksdb/utilities/transaction.h"
-#include "util/crc32c.h"
-#include "util/logging.h"
-#include "util/random.h"
-#include "util/testharness.h"
-#include "util/transaction_test_util.h"
-#include "port/port.h"
-
-using std::string;
-
-namespace rocksdb {
-
-class OptimisticTransactionTest : public testing::Test {
- public:
-  OptimisticTransactionDB* txn_db;
-  DB* db;
-  string dbname;
-  Options options;
-
-  OptimisticTransactionTest() {
-options.create_if_missing = true;
-options.max_write_buffer_number = 2;
-dbname = test::TmpDir() + "/optimistic_transaction_testdb";
-
-DestroyDB(dbname, options);
-Open();
-  }
-  ~OptimisticTransactionTest() {
-delete txn_db;
-DestroyDB(dbname, options);
-  }
-
-  void Reopen() {
-delete txn_db;
-txn_db = nullptr;
-Open();
-  }
-
-private:
-  void Open() {
-Status s = OptimisticTransactionDB::Open(options, dbname, _db);
-assert(s.ok());
-assert(txn_db != nullptr);
-db = txn_db->GetBaseDB();
-  }
-};
-
-TEST_F(OptimisticTransactionTest, SuccessTest) {
-  WriteOptions write_options;
-  ReadOptions read_options;
-  string value;
-  Status s;
-
-  db->Put(write_options, Slice("foo"), Slice("bar"));
-  db->Put(write_options, Slice("foo2"), Slice("bar"));
-
-  Transaction* txn = txn_db->BeginTransaction(write_options);
-  ASSERT_TRUE(txn);
-
-  txn->GetForUpdate(read_options, "foo", );
-  ASSERT_EQ(value, "bar");
-
-  txn->Put(Slice("foo"), Slice("bar2"));
-
-  txn->GetForUpdate(read_options, "foo", );
-  ASSERT_EQ(value, "bar2");
-
-  s = txn->Commit();
-  ASSERT_OK(s);
-
-  db->Get(read_options, "foo", );
-  ASSERT_EQ(value, "bar2");
-
-  delete txn;
-}
-
-TEST_F(OptimisticTransactionTest, WriteConflictTest) {
-  WriteOptions write_options;
-  ReadOptions read_options;
-  string value;
-  Status s;
-
-  db->Put(write_options, "foo", "bar");
-  db->Put(write_options, "foo2", "bar");
-
-  Transaction* txn = txn_db->BeginTransaction(write_options);
-  ASSERT_TRUE(txn);
-
-  txn->Put("foo", "bar2");
-
-  // This Put outside of a transaction will conflict with the previous write
-  s = db->Put(write_options, "foo", "barz");
-  ASSERT_OK(s);
-
-  s = db->Get(read_options, "foo", );
-  ASSERT_EQ(value, "barz");
-  ASSERT_EQ(1, txn->GetNumKeys());
-
-  s = txn->Commit();
-  ASSERT_TRUE(s.IsBusy());  // Txn should not commit
-
-  // Verify that transaction did not write anything
-  db->Get(read_options, "foo", );
-  ASSERT_EQ(value, "barz");
-  db->Get(read_options, "foo2", );
-  ASSERT_EQ(value, "bar");
-
-  delete txn;
-}
-
-TEST_F(OptimisticTransactionTest, WriteConflictTest2) {
-  WriteOptions write_options;
-  ReadOptions read_options;
-  OptimisticTransactionOptions txn_options;
-  string value;
-  Status s;
-
-  db->Put(write_options, "foo", "bar");
-  db->Put(write_options, "foo2", "bar");
-
-  txn_options.set_snapshot = true;
-  Transaction* txn = txn_db->BeginTransaction(write_options, txn_options);
-  ASSERT_TRUE(txn);
-
-  // This Put outside of a transaction will conflict with a later write
-  s = db->Put(write_options, "foo", "barz");
-  ASSERT_OK(s);
-
-  txn->Put("foo", "bar2");  // Conflicts with write done after snapshot taken
-
-  s = db->Get(read_options, "foo", );
-  ASSERT_EQ(value, "barz");
-
-  s = txn->Commit();
-  ASSERT_TRUE(s.IsBusy());  // Txn should not commit
-
-  // Verify that transaction did not write anything
-  db->Get(read_options, "foo", );
-  ASSERT_EQ(value, "barz");
-  db->Get(read_options, "foo2", );
-  ASSERT_EQ(value, "bar");
-
-  delete txn;
-}
-
-TEST_F(OptimisticTransactionTest, ReadConflictTest) {
-  WriteOptions write_options;
-  ReadOptions read_options, snapshot_read_options;
-  OptimisticTransactionOptions txn_options;
-  string value;
-  Status s;
-
-  db->Put(write_options, "foo", "bar");
-  db->Put(write_options, "foo2", "bar");
-
-  txn_options.set_snapshot = true;
-  Transaction* txn = txn_db->BeginTransaction(write_options, txn_options);
-  ASSERT_TRUE(txn);
-
-  txn->SetSnapshot();
-  snapshot_read_options.snapshot = 

[11/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/util/arena_test.cc
--
diff --git a/thirdparty/rocksdb/util/arena_test.cc 
b/thirdparty/rocksdb/util/arena_test.cc
deleted file mode 100644
index 53777a2..000
--- a/thirdparty/rocksdb/util/arena_test.cc
+++ /dev/null
@@ -1,203 +0,0 @@
-//  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-//
-// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
-
-#include "util/arena.h"
-#include "util/random.h"
-#include "util/testharness.h"
-
-namespace rocksdb {
-
-namespace {
-const size_t kHugePageSize = 2 * 1024 * 1024;
-}  // namespace
-class ArenaTest : public testing::Test {};
-
-TEST_F(ArenaTest, Empty) { Arena arena0; }
-
-namespace {
-bool CheckMemoryAllocated(size_t allocated, size_t expected) {
-  // The value returned by Arena::MemoryAllocatedBytes() may be greater than
-  // the requested memory. We choose a somewhat arbitrary upper bound of
-  // max_expected = expected * 1.1 to detect critical overallocation.
-  size_t max_expected = expected + expected / 10;
-  return allocated >= expected && allocated <= max_expected;
-}
-
-void MemoryAllocatedBytesTest(size_t huge_page_size) {
-  const int N = 17;
-  size_t req_sz;  // requested size
-  size_t bsz = 32 * 1024;  // block size
-  size_t expected_memory_allocated;
-
-  Arena arena(bsz, nullptr, huge_page_size);
-
-  // requested size > quarter of a block:
-  //   allocate requested size separately
-  req_sz = 12 * 1024;
-  for (int i = 0; i < N; i++) {
-arena.Allocate(req_sz);
-  }
-  expected_memory_allocated = req_sz * N + Arena::kInlineSize;
-  ASSERT_PRED2(CheckMemoryAllocated, arena.MemoryAllocatedBytes(),
-   expected_memory_allocated);
-
-  arena.Allocate(Arena::kInlineSize - 1);
-
-  // requested size < quarter of a block:
-  //   allocate a block with the default size, then try to use unused part
-  //   of the block. So one new block will be allocated for the first
-  //   Allocate(99) call. All the remaining calls won't lead to new allocation.
-  req_sz = 99;
-  for (int i = 0; i < N; i++) {
-arena.Allocate(req_sz);
-  }
-  if (huge_page_size) {
-ASSERT_TRUE(
-CheckMemoryAllocated(arena.MemoryAllocatedBytes(),
- expected_memory_allocated + bsz) ||
-CheckMemoryAllocated(arena.MemoryAllocatedBytes(),
- expected_memory_allocated + huge_page_size));
-  } else {
-expected_memory_allocated += bsz;
-ASSERT_PRED2(CheckMemoryAllocated, arena.MemoryAllocatedBytes(),
- expected_memory_allocated);
-  }
-
-  // requested size > size of a block:
-  //   allocate requested size separately
-  expected_memory_allocated = arena.MemoryAllocatedBytes();
-  req_sz = 8 * 1024 * 1024;
-  for (int i = 0; i < N; i++) {
-arena.Allocate(req_sz);
-  }
-  expected_memory_allocated += req_sz * N;
-  ASSERT_PRED2(CheckMemoryAllocated, arena.MemoryAllocatedBytes(),
-   expected_memory_allocated);
-}
-
-// Make sure we didn't count the allocate but not used memory space in
-// Arena::ApproximateMemoryUsage()
-static void ApproximateMemoryUsageTest(size_t huge_page_size) {
-  const size_t kBlockSize = 4096;
-  const size_t kEntrySize = kBlockSize / 8;
-  const size_t kZero = 0;
-  Arena arena(kBlockSize, nullptr, huge_page_size);
-  ASSERT_EQ(kZero, arena.ApproximateMemoryUsage());
-
-  // allocate inline bytes
-  EXPECT_TRUE(arena.IsInInlineBlock());
-  arena.AllocateAligned(8);
-  EXPECT_TRUE(arena.IsInInlineBlock());
-  arena.AllocateAligned(Arena::kInlineSize / 2 - 16);
-  EXPECT_TRUE(arena.IsInInlineBlock());
-  arena.AllocateAligned(Arena::kInlineSize / 2);
-  EXPECT_TRUE(arena.IsInInlineBlock());
-  ASSERT_EQ(arena.ApproximateMemoryUsage(), Arena::kInlineSize - 8);
-  ASSERT_PRED2(CheckMemoryAllocated, arena.MemoryAllocatedBytes(),
-   Arena::kInlineSize);
-
-  auto num_blocks = kBlockSize / kEntrySize;
-
-  // first allocation
-  arena.AllocateAligned(kEntrySize);
-  EXPECT_FALSE(arena.IsInInlineBlock());
-  auto mem_usage = arena.MemoryAllocatedBytes();
-  if (huge_page_size) {
-ASSERT_TRUE(
-CheckMemoryAllocated(mem_usage, kBlockSize + Arena::kInlineSize) ||
-CheckMemoryAllocated(mem_usage, huge_page_size + Arena::kInlineSize));
-  } else {
-ASSERT_PRED2(CheckMemoryAllocated, mem_usage,
- kBlockSize + Arena::kInlineSize);
-  }
-  auto usage = arena.ApproximateMemoryUsage();
-  ASSERT_LT(usage, mem_usage);
-  for (size_t i = 1; i < num_blocks; ++i) {
-

[18/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/java/src/test/java/org/rocksdb/CheckPointTest.java
--
diff --git 
a/thirdparty/rocksdb/java/src/test/java/org/rocksdb/CheckPointTest.java 
b/thirdparty/rocksdb/java/src/test/java/org/rocksdb/CheckPointTest.java
deleted file mode 100644
index e79569f..000
--- a/thirdparty/rocksdb/java/src/test/java/org/rocksdb/CheckPointTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package org.rocksdb;
-
-
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class CheckPointTest {
-
-  @ClassRule
-  public static final RocksMemoryResource rocksMemoryResource =
-  new RocksMemoryResource();
-
-  @Rule
-  public TemporaryFolder dbFolder = new TemporaryFolder();
-
-  @Rule
-  public TemporaryFolder checkpointFolder = new TemporaryFolder();
-
-  @Test
-  public void checkPoint() throws RocksDBException {
-try (final Options options = new Options().
-setCreateIfMissing(true)) {
-
-  try (final RocksDB db = RocksDB.open(options,
-  dbFolder.getRoot().getAbsolutePath())) {
-db.put("key".getBytes(), "value".getBytes());
-try (final Checkpoint checkpoint = Checkpoint.create(db)) {
-  checkpoint.createCheckpoint(checkpointFolder.
-  getRoot().getAbsolutePath() + "/snapshot1");
-  db.put("key2".getBytes(), "value2".getBytes());
-  checkpoint.createCheckpoint(checkpointFolder.
-  getRoot().getAbsolutePath() + "/snapshot2");
-}
-  }
-
-  try (final RocksDB db = RocksDB.open(options,
-  checkpointFolder.getRoot().getAbsolutePath() +
-  "/snapshot1")) {
-assertThat(new String(db.get("key".getBytes(.
-isEqualTo("value");
-assertThat(db.get("key2".getBytes())).isNull();
-  }
-
-  try (final RocksDB db = RocksDB.open(options,
-  checkpointFolder.getRoot().getAbsolutePath() +
-  "/snapshot2")) {
-assertThat(new String(db.get("key".getBytes(.
-isEqualTo("value");
-assertThat(new String(db.get("key2".getBytes(.
-isEqualTo("value2");
-  }
-}
-  }
-
-  @Test(expected = IllegalArgumentException.class)
-  public void failIfDbIsNull() {
-try (final Checkpoint checkpoint = Checkpoint.create(null)) {
-
-}
-  }
-
-  @Test(expected = IllegalStateException.class)
-  public void failIfDbNotInitialized() throws RocksDBException {
-try (final RocksDB db = RocksDB.open(
-dbFolder.getRoot().getAbsolutePath())) {
-  db.close();
-  Checkpoint.create(db);
-}
-  }
-
-  @Test(expected = RocksDBException.class)
-  public void failWithIllegalPath() throws RocksDBException {
-try (final RocksDB db = RocksDB.open(dbFolder.getRoot().getAbsolutePath());
- final Checkpoint checkpoint = Checkpoint.create(db)) {
-  checkpoint.createCheckpoint("/Z:///:\\C:\\TZ/-");
-}
-  }
-}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/java/src/test/java/org/rocksdb/ClockCacheTest.java
--
diff --git 
a/thirdparty/rocksdb/java/src/test/java/org/rocksdb/ClockCacheTest.java 
b/thirdparty/rocksdb/java/src/test/java/org/rocksdb/ClockCacheTest.java
deleted file mode 100644
index d1241ac..000
--- a/thirdparty/rocksdb/java/src/test/java/org/rocksdb/ClockCacheTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-
-package org.rocksdb;
-
-import org.junit.Test;
-
-public class ClockCacheTest {
-
-  static {
-RocksDB.loadLibrary();
-  }
-
-  @Test
-  public void newClockCache() {
-final long capacity = 1000;
-final int numShardBits = 16;
-final boolean strictCapacityLimit = true;
-try(final Cache clockCache = new ClockCache(capacity,
-numShardBits, strictCapacityLimit)) {
-  //no op
-}
-  }
-}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/java/src/test/java/org/rocksdb/ColumnFamilyOptionsTest.java
--
diff --git 
a/thirdparty/rocksdb/java/src/test/java/org/rocksdb/ColumnFamilyOptionsTest.java
 
b/thirdparty/rocksdb/java/src/test/java/org/rocksdb/ColumnFamilyOptionsTest.java
deleted file mode 100644
index 7574943..000
--- 
a/thirdparty/rocksdb/java/src/test/java/org/rocksdb/ColumnFamilyOptionsTest.java
+++ /dev/null
@@ -1,567 +0,0 @@
-// Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This 

[06/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/utilities/document/document_db_test.cc
--
diff --git a/thirdparty/rocksdb/utilities/document/document_db_test.cc 
b/thirdparty/rocksdb/utilities/document/document_db_test.cc
deleted file mode 100644
index e8f4138..000
--- a/thirdparty/rocksdb/utilities/document/document_db_test.cc
+++ /dev/null
@@ -1,336 +0,0 @@
-//  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-
-#ifndef ROCKSDB_LITE
-
-#include 
-
-#include "rocksdb/utilities/json_document.h"
-#include "rocksdb/utilities/document_db.h"
-
-#include "util/testharness.h"
-#include "util/testutil.h"
-
-namespace rocksdb {
-
-class DocumentDBTest : public testing::Test {
- public:
-  DocumentDBTest() {
-dbname_ = test::TmpDir() + "/document_db_test";
-DestroyDB(dbname_, Options());
-  }
-  ~DocumentDBTest() {
-delete db_;
-DestroyDB(dbname_, Options());
-  }
-
-  void AssertCursorIDs(Cursor* cursor, std::vector expected) {
-std::vector got;
-while (cursor->Valid()) {
-  ASSERT_TRUE(cursor->Valid());
-  ASSERT_TRUE(cursor->document().Contains("_id"));
-  got.push_back(cursor->document()["_id"].GetInt64());
-  cursor->Next();
-}
-std::sort(expected.begin(), expected.end());
-std::sort(got.begin(), got.end());
-ASSERT_TRUE(got == expected);
-  }
-
-  // converts ' to ", so that we don't have to escape " all over the place
-  std::string ConvertQuotes(const std::string& input) {
-std::string output;
-for (auto x : input) {
-  if (x == '\'') {
-output.push_back('\"');
-  } else {
-output.push_back(x);
-  }
-}
-return output;
-  }
-
-  void CreateIndexes(std::vector indexes) {
-for (auto i : indexes) {
-  ASSERT_OK(db_->CreateIndex(WriteOptions(), i));
-}
-  }
-
-  JSONDocument* Parse(const std::string& doc) {
-return JSONDocument::ParseJSON(ConvertQuotes(doc).c_str());
-  }
-
-  std::string dbname_;
-  DocumentDB* db_;
-};
-
-TEST_F(DocumentDBTest, SimpleQueryTest) {
-  DocumentDBOptions options;
-  DocumentDB::IndexDescriptor index;
-  index.description = Parse("{\"name\": 1}");
-  index.name = "name_index";
-
-  ASSERT_OK(DocumentDB::Open(options, dbname_, {}, _));
-  CreateIndexes({index});
-  delete db_;
-  // now there is index present
-  ASSERT_OK(DocumentDB::Open(options, dbname_, {index}, _));
-  delete index.description;
-
-  std::vector json_objects = {
-  "{\"_id\': 1, \"name\": \"One\"}",   "{\"_id\": 2, \"name\": \"Two\"}",
-  "{\"_id\": 3, \"name\": \"Three\"}", "{\"_id\": 4, \"name\": \"Four\"}"};
-
-  for (auto& json : json_objects) {
-std::unique_ptr document(Parse(json));
-ASSERT_TRUE(document.get() != nullptr);
-ASSERT_OK(db_->Insert(WriteOptions(), *document));
-  }
-
-  // inserting a document with existing primary key should return failure
-  {
-std::unique_ptr document(Parse(json_objects[0]));
-ASSERT_TRUE(document.get() != nullptr);
-Status s = db_->Insert(WriteOptions(), *document);
-ASSERT_TRUE(s.IsInvalidArgument());
-  }
-
-  // find equal to "Two"
-  {
-std::unique_ptr query(
-Parse("[{'$filter': {'name': 'Two', '$index': 'name_index'}}]"));
-std::unique_ptr cursor(db_->Query(ReadOptions(), *query));
-AssertCursorIDs(cursor.get(), {2});
-  }
-
-  // find less than "Three"
-  {
-std::unique_ptr query(Parse(
-"[{'$filter': {'name': {'$lt': 'Three'}, '$index': "
-"'name_index'}}]"));
-std::unique_ptr cursor(db_->Query(ReadOptions(), *query));
-
-AssertCursorIDs(cursor.get(), {1, 4});
-  }
-
-  // find less than "Three" without index
-  {
-std::unique_ptr query(
-Parse("[{'$filter': {'name': {'$lt': 'Three'} }}]"));
-std::unique_ptr cursor(db_->Query(ReadOptions(), *query));
-AssertCursorIDs(cursor.get(), {1, 4});
-  }
-
-  // remove less or equal to "Three"
-  {
-std::unique_ptr query(
-Parse("{'name': {'$lte': 'Three'}, '$index': 'name_index'}"));
-ASSERT_OK(db_->Remove(ReadOptions(), WriteOptions(), *query));
-  }
-
-  // find all -- only "Two" left, everything else should be deleted
-  {
-std::unique_ptr query(Parse("[]"));
-std::unique_ptr cursor(db_->Query(ReadOptions(), *query));
-AssertCursorIDs(cursor.get(), {2});
-  }
-}
-
-TEST_F(DocumentDBTest, ComplexQueryTest) {
-  DocumentDBOptions options;
-  DocumentDB::IndexDescriptor priority_index;
-  priority_index.description = Parse("{'priority': 1}");
-  priority_index.name = "priority";
-  DocumentDB::IndexDescriptor job_name_index;
-  job_name_index.description = Parse("{'job_name': 1}");
-  job_name_index.name = "job_name";
-  DocumentDB::IndexDescriptor 

[04/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/utilities/persistent_cache/persistent_cache_test.cc
--
diff --git 
a/thirdparty/rocksdb/utilities/persistent_cache/persistent_cache_test.cc 
b/thirdparty/rocksdb/utilities/persistent_cache/persistent_cache_test.cc
deleted file mode 100644
index 5affc40..000
--- a/thirdparty/rocksdb/utilities/persistent_cache/persistent_cache_test.cc
+++ /dev/null
@@ -1,471 +0,0 @@
-//  Copyright (c) 2013, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-//
-// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
-#ifndef ROCKSDB_LITE
-
-#include "utilities/persistent_cache/persistent_cache_test.h"
-
-#include 
-#include 
-#include 
-
-#include "utilities/persistent_cache/block_cache_tier.h"
-
-namespace rocksdb {
-
-static const double kStressFactor = .125;
-
-#ifdef OS_LINUX
-static void OnOpenForRead(void* arg) {
-  int* val = static_cast(arg);
-  *val &= ~O_DIRECT;
-  rocksdb::SyncPoint::GetInstance()->SetCallBack(
-  "NewRandomAccessFile:O_DIRECT",
-  std::bind(OnOpenForRead, std::placeholders::_1));
-}
-
-static void OnOpenForWrite(void* arg) {
-  int* val = static_cast(arg);
-  *val &= ~O_DIRECT;
-  rocksdb::SyncPoint::GetInstance()->SetCallBack(
-  "NewWritableFile:O_DIRECT",
-  std::bind(OnOpenForWrite, std::placeholders::_1));
-}
-#endif
-
-static void RemoveDirectory(const std::string& folder) {
-  std::vector files;
-  Status status = Env::Default()->GetChildren(folder, );
-  if (!status.ok()) {
-// we assume the directory does not exist
-return;
-  }
-
-  // cleanup files with the patter :digi:.rc
-  for (auto file : files) {
-if (file == "." || file == "..") {
-  continue;
-}
-status = Env::Default()->DeleteFile(folder + "/" + file);
-assert(status.ok());
-  }
-
-  status = Env::Default()->DeleteDir(folder);
-  assert(status.ok());
-}
-
-static void OnDeleteDir(void* arg) {
-  char* dir = static_cast(arg);
-  RemoveDirectory(std::string(dir));
-}
-
-//
-// Simple logger that prints message on stdout
-//
-class ConsoleLogger : public Logger {
- public:
-  using Logger::Logv;
-  ConsoleLogger() : Logger(InfoLogLevel::ERROR_LEVEL) {}
-
-  void Logv(const char* format, va_list ap) override {
-MutexLock _(_);
-vprintf(format, ap);
-printf("\n");
-  }
-
-  port::Mutex lock_;
-};
-
-// construct a tiered RAM+Block cache
-std::unique_ptr NewTieredCache(
-const size_t mem_size, const PersistentCacheConfig& opt) {
-  std::unique_ptr tcache(new PersistentTieredCache());
-  // create primary tier
-  assert(mem_size);
-  auto pcache = std::shared_ptr(new VolatileCacheTier(
-  /*is_compressed*/ true, mem_size));
-  tcache->AddTier(pcache);
-  // create secondary tier
-  auto scache = std::shared_ptr(new BlockCacheTier(opt));
-  tcache->AddTier(scache);
-
-  Status s = tcache->Open();
-  assert(s.ok());
-  return tcache;
-}
-
-// create block cache
-std::unique_ptr NewBlockCache(
-Env* env, const std::string& path,
-const uint64_t max_size = std::numeric_limits::max(),
-const bool enable_direct_writes = false) {
-  const uint32_t max_file_size = static_cast(12 * 1024 * 1024 * 
kStressFactor);
-  auto log = std::make_shared();
-  PersistentCacheConfig opt(env, path, max_size, log);
-  opt.cache_file_size = max_file_size;
-  opt.max_write_pipeline_backlog_size = std::numeric_limits::max();
-  opt.enable_direct_writes = enable_direct_writes;
-  std::unique_ptr scache(new BlockCacheTier(opt));
-  Status s = scache->Open();
-  assert(s.ok());
-  return scache;
-}
-
-// create a new cache tier
-std::unique_ptr NewTieredCache(
-Env* env, const std::string& path, const uint64_t max_volatile_cache_size,
-const uint64_t max_block_cache_size =
-std::numeric_limits::max()) {
-  const uint32_t max_file_size = static_cast(12 * 1024 * 1024 * 
kStressFactor);
-  auto log = std::make_shared();
-  auto opt = PersistentCacheConfig(env, path, max_block_cache_size, log);
-  opt.cache_file_size = max_file_size;
-  opt.max_write_pipeline_backlog_size = std::numeric_limits::max();
-  // create tier out of the two caches
-  auto cache = NewTieredCache(max_volatile_cache_size, opt);
-  return cache;
-}
-
-PersistentCacheTierTest::PersistentCacheTierTest()
-: path_(test::TmpDir(Env::Default()) + "/cache_test") {
-#ifdef OS_LINUX
-  rocksdb::SyncPoint::GetInstance()->EnableProcessing();
-  
rocksdb::SyncPoint::GetInstance()->SetCallBack("NewRandomAccessFile:O_DIRECT",
- OnOpenForRead);
-  

[09/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/util/thread_list_test.cc
--
diff --git a/thirdparty/rocksdb/util/thread_list_test.cc 
b/thirdparty/rocksdb/util/thread_list_test.cc
deleted file mode 100644
index 36a221b..000
--- a/thirdparty/rocksdb/util/thread_list_test.cc
+++ /dev/null
@@ -1,352 +0,0 @@
-//  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-
-#include 
-#include 
-
-#include "monitoring/thread_status_updater.h"
-#include "rocksdb/db.h"
-#include "util/testharness.h"
-
-#ifdef ROCKSDB_USING_THREAD_STATUS
-
-namespace rocksdb {
-
-class SimulatedBackgroundTask {
- public:
-  SimulatedBackgroundTask(
-  const void* db_key, const std::string& db_name,
-  const void* cf_key, const std::string& cf_name,
-  const ThreadStatus::OperationType operation_type =
-  ThreadStatus::OP_UNKNOWN,
-  const ThreadStatus::StateType state_type =
-  ThreadStatus::STATE_UNKNOWN)
-  : db_key_(db_key), db_name_(db_name),
-cf_key_(cf_key), cf_name_(cf_name),
-operation_type_(operation_type), state_type_(state_type),
-should_run_(true), running_count_(0) {
-Env::Default()->GetThreadStatusUpdater()->NewColumnFamilyInfo(
-db_key_, db_name_, cf_key_, cf_name_);
-  }
-
-  ~SimulatedBackgroundTask() {
-Env::Default()->GetThreadStatusUpdater()->EraseDatabaseInfo(db_key_);
-  }
-
-  void Run() {
-std::unique_lock l(mutex_);
-running_count_++;
-Env::Default()->GetThreadStatusUpdater()->SetColumnFamilyInfoKey(cf_key_);
-Env::Default()->GetThreadStatusUpdater()->SetThreadOperation(
-operation_type_);
-Env::Default()->GetThreadStatusUpdater()->SetThreadState(state_type_);
-while (should_run_) {
-  bg_cv_.wait(l);
-}
-Env::Default()->GetThreadStatusUpdater()->ClearThreadState();
-Env::Default()->GetThreadStatusUpdater()->ClearThreadOperation();
-Env::Default()->GetThreadStatusUpdater()->SetColumnFamilyInfoKey(0);
-running_count_--;
-bg_cv_.notify_all();
-  }
-
-  void FinishAllTasks() {
-std::unique_lock l(mutex_);
-should_run_ = false;
-bg_cv_.notify_all();
-  }
-
-  void WaitUntilScheduled(int job_count, Env* env) {
-while (running_count_ < job_count) {
-  env->SleepForMicroseconds(1000);
-}
-  }
-
-  void WaitUntilDone() {
-std::unique_lock l(mutex_);
-while (running_count_ > 0) {
-  bg_cv_.wait(l);
-}
-  }
-
-  static void DoSimulatedTask(void* arg) {
-reinterpret_cast(arg)->Run();
-  }
-
- private:
-  const void* db_key_;
-  const std::string db_name_;
-  const void* cf_key_;
-  const std::string cf_name_;
-  const ThreadStatus::OperationType operation_type_;
-  const ThreadStatus::StateType state_type_;
-  std::mutex mutex_;
-  std::condition_variable bg_cv_;
-  bool should_run_;
-  std::atomic running_count_;
-};
-
-class ThreadListTest : public testing::Test {
- public:
-  ThreadListTest() {
-  }
-};
-
-TEST_F(ThreadListTest, GlobalTables) {
-  // verify the global tables for operations and states are properly indexed.
-  for (int type = 0; type != ThreadStatus::NUM_OP_TYPES; ++type) {
-ASSERT_EQ(global_operation_table[type].type, type);
-ASSERT_EQ(global_operation_table[type].name,
-  ThreadStatus::GetOperationName(
-  ThreadStatus::OperationType(type)));
-  }
-
-  for (int type = 0; type != ThreadStatus::NUM_STATE_TYPES; ++type) {
-ASSERT_EQ(global_state_table[type].type, type);
-ASSERT_EQ(global_state_table[type].name,
-  ThreadStatus::GetStateName(
-  ThreadStatus::StateType(type)));
-  }
-
-  for (int stage = 0; stage != ThreadStatus::NUM_OP_STAGES; ++stage) {
-ASSERT_EQ(global_op_stage_table[stage].stage, stage);
-ASSERT_EQ(global_op_stage_table[stage].name,
-  ThreadStatus::GetOperationStageName(
-  ThreadStatus::OperationStage(stage)));
-  }
-}
-
-TEST_F(ThreadListTest, SimpleColumnFamilyInfoTest) {
-  Env* env = Env::Default();
-  const int kHighPriorityThreads = 3;
-  const int kLowPriorityThreads = 5;
-  const int kSimulatedHighPriThreads = kHighPriorityThreads - 1;
-  const int kSimulatedLowPriThreads = kLowPriorityThreads / 3;
-  env->SetBackgroundThreads(kHighPriorityThreads, Env::HIGH);
-  env->SetBackgroundThreads(kLowPriorityThreads, Env::LOW);
-
-  SimulatedBackgroundTask running_task(
-  reinterpret_cast(1234), "running",
-  reinterpret_cast(5678), "pikachu");
-
-  for (int test = 0; test < kSimulatedHighPriThreads; ++test) {
-env->Schedule(::DoSimulatedTask,
-_task, Env::Priority::HIGH);
-  }
-  for (int test = 0; test < 

[13/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/third-party/gtest-1.7.0/fused-src/gtest/gtest-all.cc
--
diff --git 
a/thirdparty/rocksdb/third-party/gtest-1.7.0/fused-src/gtest/gtest-all.cc 
b/thirdparty/rocksdb/third-party/gtest-1.7.0/fused-src/gtest/gtest-all.cc
deleted file mode 100644
index 7c52172..000
--- a/thirdparty/rocksdb/third-party/gtest-1.7.0/fused-src/gtest/gtest-all.cc
+++ /dev/null
@@ -1,10261 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: mhe...@google.com (Markus Heule)
-//
-// Google C++ Testing Framework (Google Test)
-//
-// Sometimes it's desirable to build Google Test by compiling a single file.
-// This file serves this purpose.
-
-// Suppress clang analyzer warnings.
-#ifndef __clang_analyzer__
-
-// This line ensures that gtest.h can be compiled on its own, even
-// when it's fused.
-#include "gtest/gtest.h"
-
-// The following lines pull in the real gtest *.cc files.
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: w...@google.com (Zhanyong Wan)
-//
-// The Google C++ Testing Framework (Google Test)
-
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this 

[23/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/db/db_test_util.h
--
diff --git a/thirdparty/rocksdb/db/db_test_util.h 
b/thirdparty/rocksdb/db/db_test_util.h
deleted file mode 100644
index cd1265e..000
--- a/thirdparty/rocksdb/db/db_test_util.h
+++ /dev/null
@@ -1,939 +0,0 @@
-// Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-//  This source code is licensed under both the GPLv2 (found in the
-//  COPYING file in the root directory) and Apache 2.0 License
-//  (found in the LICENSE.Apache file in the root directory).
-//
-// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
-
-#pragma once
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS
-#endif
-
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "db/db_impl.h"
-#include "db/dbformat.h"
-#include "env/mock_env.h"
-#include "memtable/hash_linklist_rep.h"
-#include "rocksdb/cache.h"
-#include "rocksdb/compaction_filter.h"
-#include "rocksdb/convenience.h"
-#include "rocksdb/db.h"
-#include "rocksdb/env.h"
-#include "rocksdb/filter_policy.h"
-#include "rocksdb/options.h"
-#include "rocksdb/slice.h"
-#include "rocksdb/sst_file_writer.h"
-#include "rocksdb/statistics.h"
-#include "rocksdb/table.h"
-#include "rocksdb/utilities/checkpoint.h"
-#include "table/block_based_table_factory.h"
-#include "table/mock_table.h"
-#include "table/plain_table_factory.h"
-#include "table/scoped_arena_iterator.h"
-#include "util/compression.h"
-#include "util/filename.h"
-#include "util/mutexlock.h"
-
-#include "util/string_util.h"
-#include "util/sync_point.h"
-#include "util/testharness.h"
-#include "util/testutil.h"
-#include "utilities/merge_operators.h"
-
-namespace rocksdb {
-
-namespace anon {
-class AtomicCounter {
- public:
-  explicit AtomicCounter(Env* env = NULL)
-  : env_(env), cond_count_(_), count_(0) {}
-
-  void Increment() {
-MutexLock l(_);
-count_++;
-cond_count_.SignalAll();
-  }
-
-  int Read() {
-MutexLock l(_);
-return count_;
-  }
-
-  bool WaitFor(int count) {
-MutexLock l(_);
-
-uint64_t start = env_->NowMicros();
-while (count_ < count) {
-  uint64_t now = env_->NowMicros();
-  cond_count_.TimedWait(now + /*1s*/ 1 * 1000 * 1000);
-  if (env_->NowMicros() - start > /*10s*/ 10 * 1000 * 1000) {
-return false;
-  }
-  if (count_ < count) {
-GTEST_LOG_(WARNING) << "WaitFor is taking more time than usual";
-  }
-}
-
-return true;
-  }
-
-  void Reset() {
-MutexLock l(_);
-count_ = 0;
-cond_count_.SignalAll();
-  }
-
- private:
-  Env* env_;
-  port::Mutex mu_;
-  port::CondVar cond_count_;
-  int count_;
-};
-
-struct OptionsOverride {
-  std::shared_ptr filter_policy = nullptr;
-  // These will be used only if filter_policy is set
-  bool partition_filters = false;
-  uint64_t metadata_block_size = 1024;
-  BlockBasedTableOptions::IndexType index_type =
-  BlockBasedTableOptions::IndexType::kBinarySearch;
-
-  // Used as a bit mask of individual enums in which to skip an XF test point
-  int skip_policy = 0;
-};
-
-}  // namespace anon
-
-enum SkipPolicy { kSkipNone = 0, kSkipNoSnapshot = 1, kSkipNoPrefix = 2 };
-
-// A hacky skip list mem table that triggers flush after number of entries.
-class SpecialMemTableRep : public MemTableRep {
- public:
-  explicit SpecialMemTableRep(Allocator* allocator, MemTableRep* memtable,
-  int num_entries_flush)
-  : MemTableRep(allocator),
-memtable_(memtable),
-num_entries_flush_(num_entries_flush),
-num_entries_(0) {}
-
-  virtual KeyHandle Allocate(const size_t len, char** buf) override {
-return memtable_->Allocate(len, buf);
-  }
-
-  // Insert key into the list.
-  // REQUIRES: nothing that compares equal to key is currently in the list.
-  virtual void Insert(KeyHandle handle) override {
-memtable_->Insert(handle);
-num_entries_++;
-  }
-
-  // Returns true iff an entry that compares equal to key is in the list.
-  virtual bool Contains(const char* key) const override {
-return memtable_->Contains(key);
-  }
-
-  virtual size_t ApproximateMemoryUsage() override {
-// Return a high memory usage when number of entries exceeds the threshold
-// to trigger a flush.
-return (num_entries_ < num_entries_flush_) ? 0 : 1024 * 1024 * 1024;
-  }
-
-  virtual void Get(const LookupKey& k, void* callback_args,
-   bool (*callback_func)(void* arg,
- const char* entry)) override {
-memtable_->Get(k, callback_args, callback_func);
-  }
-
-  uint64_t ApproximateNumEntries(const Slice& start_ikey,
-   

[22/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/docs/_includes/doc.html
--
diff --git a/thirdparty/rocksdb/docs/_includes/doc.html 
b/thirdparty/rocksdb/docs/_includes/doc.html
deleted file mode 100644
index a795000..000
--- a/thirdparty/rocksdb/docs/_includes/doc.html
+++ /dev/null
@@ -1,25 +0,0 @@
-
-  
-{% if include.truncate %}{{ page.title }}{% else %}{{ page.title }}{% endif %}
-  
-
-  
-   {% if include.truncate %}
-  {% if page.content contains '' %}
-{{ page.content | split:'' | first }}
-
-  
-...Read More
-  
-
-  {% else %}
-{{ page.content }}
-  {% endif %}
-{% else %}
-  {{ content }}
-
-  https://github.com/{{ site.ghrepo 
}}/blob/master/docs/{{ page.path }}" target="_blank">Edit on GitHub
-{% endif %}
-  
-  {% include doc_paging.html %}
-

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/docs/_includes/doc_paging.html
--
diff --git a/thirdparty/rocksdb/docs/_includes/doc_paging.html 
b/thirdparty/rocksdb/docs/_includes/doc_paging.html
deleted file mode 100644
index e69de29..000

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/docs/_includes/footer.html
--
diff --git a/thirdparty/rocksdb/docs/_includes/footer.html 
b/thirdparty/rocksdb/docs/_includes/footer.html
deleted file mode 100644
index dd9494a..000
--- a/thirdparty/rocksdb/docs/_includes/footer.html
+++ /dev/null
@@ -1,33 +0,0 @@
-
-  
-
-  
-  
-
-  
-  
-  
-
-  
-Facebook Open Source
-  
-  
-https://code.facebook.com/projects/; 
target="_blank">Open Source Projects
-https://github.com/facebook/; 
target="_blank">GitHub
-https://twitter.com/fbOpenSource; 
target="_blank">Twitter
-  
-  
-https://github.com/{{ site.ghrepo }}" 
target="_blank">Contribute to this project on GitHub
-  
-
-  
-
-
-  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new 
Date();a=s.createElement(o),
-  
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
-  ga('create', '{{ site.gacode }}', 'auto');
-  ga('send', 'pageview');
-

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/docs/_includes/head.html
--
diff --git a/thirdparty/rocksdb/docs/_includes/head.html 
b/thirdparty/rocksdb/docs/_includes/head.html
deleted file mode 100644
index 10845ec..000
--- a/thirdparty/rocksdb/docs/_includes/head.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-  
-  
-  
-
-  
-  
-  
-  
-  
-
-  
-  
-  {% if site.searchconfig %}
-  https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css; />
-  {% endif %}
-
-  {% if page.title %}{{ page.title }} | {{ site.title }}{% else %}{{ 
site.title }}{% endif %}
-  
-
-  
-  
-

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/docs/_includes/header.html
--
diff --git a/thirdparty/rocksdb/docs/_includes/header.html 
b/thirdparty/rocksdb/docs/_includes/header.html
deleted file mode 100644
index 8108d22..000
--- a/thirdparty/rocksdb/docs/_includes/header.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-  
-
-  
-  {{ site.title }}
-  {{ site.tagline }}
-
-  
-{% if page.excerpt %}{{ page.excerpt | strip_html }}{% else %}{{ 
site.description }}{% endif %}
-  
-  
-{% for promo in site.data.promo %}
-  {% include plugins/{{promo.type}}.html button_href=promo.href 
button_text=promo.text %}
-  
-{% endfor %}
-  
-
-  
-

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/docs/_includes/hero.html
--
diff --git a/thirdparty/rocksdb/docs/_includes/hero.html 
b/thirdparty/rocksdb/docs/_includes/hero.html
deleted file mode 100644
index e69de29..000

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/docs/_includes/home_header.html
--
diff --git a/thirdparty/rocksdb/docs/_includes/home_header.html 
b/thirdparty/rocksdb/docs/_includes/home_header.html
deleted file mode 100644
index 90880d1..000
--- a/thirdparty/rocksdb/docs/_includes/home_header.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-  
-
-  
- 

[20/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/docs/_posts/2016-04-26-rocksdb-4-5-1-released.markdown
--
diff --git 
a/thirdparty/rocksdb/docs/_posts/2016-04-26-rocksdb-4-5-1-released.markdown 
b/thirdparty/rocksdb/docs/_posts/2016-04-26-rocksdb-4-5-1-released.markdown
deleted file mode 100644
index 247768d..000
--- a/thirdparty/rocksdb/docs/_posts/2016-04-26-rocksdb-4-5-1-released.markdown
+++ /dev/null
@@ -1,60 +0,0 @@

-title: RocksDB 4.5.1 Released!
-layout: post
-author: sdong
-category: blog
-redirect_from:
-  - /blog/3179/rocksdb-4-5-1-released/

-
-## 4.5.1 (3/25/2016)
-
-### Bug Fixes
-
-  *  Fix failures caused by the destorying order of singleton objects.
-
-
-
-## 4.5.0 (2/5/2016)
-
-### Public API Changes
-
-  * Add a new perf context level between kEnableCount and kEnableTime. Level 2 
now does not include timers for mutexes.
-  * Statistics of mutex operation durations will not be measured by default. 
If you want to have them enabled, you need to set Statistics::stats_level_ to 
kAll.
-  * DBOptions::delete_scheduler and NewDeleteScheduler() are removed, please 
use DBOptions::sst_file_manager and NewSstFileManager() instead
-
-### New Features
-  * ldb tool now supports operations to non-default column families.
-  * Add kPersistedTier to ReadTier. This option allows Get and MultiGet to 
read only the persited data and skip mem-tables if writes were done with 
disableWAL = true.
-  * Add DBOptions::sst_file_manager. Use NewSstFileManager() in 
include/rocksdb/sst_file_manager.h to create a SstFileManager that can be used 
to track the total size of SST files and control the SST files deletion rate.
-
-
-
-
-
-## 4.4.0 (1/14/2016)
-
-### Public API Changes
-
-  * Change names in CompactionPri and add a new one.
-  * Deprecate options.soft_rate_limit and add 
options.soft_pending_compaction_bytes_limit.
-  * If options.max_write_buffer_number > 3, writes will be slowed down when 
writing to the last write buffer to delay a full stop.
-  * Introduce CompactionJobInfo::compaction_reason, this field include the 
reason to trigger the compaction.
-  * After slow down is triggered, if estimated pending compaction bytes keep 
increasing, slowdown more.
-  * Increase default options.delayed_write_rate to 2MB/s.
-  * Added a new parameter --path to ldb tool. --path accepts the name of 
either MANIFEST, SST or a WAL file. Either --db or --path can be used when 
calling ldb.
-
-
-
-## 4.3.0 (12/8/2015)
-
-### New Features
-
-  * CompactionFilter has new member function called IgnoreSnapshots which 
allows CompactionFilter to be called even if there are snapshots later than the 
key.
-  * RocksDB will now persist options under the same directory as the RocksDB 
database on successful DB::Open, CreateColumnFamily, DropColumnFamily, and 
SetOptions.
-  * Introduce LoadLatestOptions() in rocksdb/utilities/options_util.h. This 
function can construct the latest DBOptions / ColumnFamilyOptions used by the 
specified RocksDB intance.
-  * Introduce CheckOptionsCompatibility() in rocksdb/utilities/options_util.h. 
This function checks whether the input set of options is able to open the 
specified DB successfully.
-
-### Public API Changes
-
-  * When options.db_write_buffer_size triggers, only the column family with 
the largest column family size will be flushed, not all the column families.

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/docs/_posts/2016-07-26-rocksdb-4-8-released.markdown
--
diff --git 
a/thirdparty/rocksdb/docs/_posts/2016-07-26-rocksdb-4-8-released.markdown 
b/thirdparty/rocksdb/docs/_posts/2016-07-26-rocksdb-4-8-released.markdown
deleted file mode 100644
index b42a66e..000
--- a/thirdparty/rocksdb/docs/_posts/2016-07-26-rocksdb-4-8-released.markdown
+++ /dev/null
@@ -1,48 +0,0 @@

-title: RocksDB 4.8 Released!
-layout: post
-author: yiwu
-category: blog
-redirect_from:
-  - /blog/3239/rocksdb-4-8-released/

-
-## 4.8.0 (5/2/2016)
-
-### 
[](https://github.com/facebook/rocksdb/blob/master/HISTORY.md#public-api-change-1)Public
 API Change
-
-  * Allow preset compression dictionary for improved compression of 
block-based tables. This is supported for zlib, zstd, and lz4. The compression 
dictionary's size is configurable via CompressionOptions::max_dict_bytes.
-  * Delete deprecated classes for creating backups (BackupableDB) and 
restoring from backups (RestoreBackupableDB). Now, BackupEngine should be used 
for creating backups, and BackupEngineReadOnly should be used for restorations. 
For more details, see 
[https://github.com/facebook/rocksdb/wiki/How-to-backup-RocksDB%3F](https://github.com/facebook/rocksdb/wiki/How-to-backup-RocksDB%3F)
-  * Expose estimate of per-level compression ratio via DB property: 

[12/24] nifi-minifi-cpp git commit: MINIFI-372: Remove documentation and test utilities

2017-10-18 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d3a13a49/thirdparty/rocksdb/third-party/gtest-1.7.0/fused-src/gtest/gtest.h
--
diff --git a/thirdparty/rocksdb/third-party/gtest-1.7.0/fused-src/gtest/gtest.h 
b/thirdparty/rocksdb/third-party/gtest-1.7.0/fused-src/gtest/gtest.h
deleted file mode 100644
index e3f0cfb..000
--- a/thirdparty/rocksdb/third-party/gtest-1.7.0/fused-src/gtest/gtest.h
+++ /dev/null
@@ -1,20725 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: w...@google.com (Zhanyong Wan)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file defines the public API for Google Test.  It should be
-// included by any test program that uses Google Test.
-//
-// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
-// leave some internal implementation details in this header file.
-// They are clearly marked by comments like this:
-//
-//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-//
-// Such code is NOT meant to be used by a user directly, and is subject
-// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
-// program!
-//
-// Acknowledgment: Google Test borrowed the idea of automatic test
-// registration from Barthelemy Dagenais' (barthel...@prologique.com)
-// easyUnit framework.
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
-#define GTEST_INCLUDE_GTEST_GTEST_H_
-
-#include 
-#include 
-#include 
-
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: w...@google.com (Zhanyong Wan), eef...@gmail.com (Sean Mcafee)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file declares functions and macros used internally by
-// Google Test.  They are subject to change without notice.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
-#define 

[nifi-minifi-cpp] Git Push Summary

2017-11-27 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/MINIFICPP-304-RC2-0.3.0 [created] 0e4ce79b7


[nifi-minifi-cpp] Git Push Summary

2017-11-27 Thread phrocker
Repository: nifi-minifi-cpp
Updated Tags:  refs/tags/minifi-cpp-0.3.0-RC2 [created] 0e4ce79b7


nifi-minifi-cpp git commit: MINIFICPP-315 - allow plain b suffix on properties

2017-11-28 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 5a80197e1 -> f5bf3c8b6


MINIFICPP-315 - allow plain b suffix on properties

This closes #196.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/f5bf3c8b
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/f5bf3c8b
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/f5bf3c8b

Branch: refs/heads/master
Commit: f5bf3c8b63a33f9a50d1cbcdd2d6d389a170d6ef
Parents: 5a80197
Author: Dustin Rodrigues 
Authored: Sat Nov 18 17:04:25 2017 -0500
Committer: Marc Parisi 
Committed: Tue Nov 28 12:32:43 2017 -0500

--
 libminifi/include/core/Property.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/f5bf3c8b/libminifi/include/core/Property.h
--
diff --git a/libminifi/include/core/Property.h 
b/libminifi/include/core/Property.h
index 9eee1b5..7ee0c15 100644
--- a/libminifi/include/core/Property.h
+++ b/libminifi/include/core/Property.h
@@ -217,7 +217,10 @@ class Property {
 }
 
 char end0 = toupper(pEnd[0]);
-if ((end0 == 'K') || (end0 == 'M') || (end0 == 'G') || (end0 == 'T') || 
(end0 == 'P')) {
+if (end0 == 'B') {
+  output = ival;
+  return true;
+} else if ((end0 == 'K') || (end0 == 'M') || (end0 == 'G') || (end0 == 
'T') || (end0 == 'P')) {
   if (pEnd[1] == '\0') {
 unsigned long int multiplier = 1000;
 



nifi-minifi-cpp git commit: MINIFICPP-327: Rename PutKafka to PublishKafka

2017-11-28 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 77f32f10e -> 0756097aa


MINIFICPP-327: Rename PutKafka to PublishKafka

This closes #209.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/0756097a
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/0756097a
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/0756097a

Branch: refs/heads/master
Commit: 0756097aacef069ef61990309d9456a8d0ee7790
Parents: 77f32f1
Author: Bin Qiu 
Authored: Tue Nov 28 07:25:15 2017 -0800
Committer: Marc Parisi 
Committed: Tue Nov 28 14:05:48 2017 -0500

--
 CMakeLists.txt |   2 +-
 README.md  |   2 +-
 extensions/librdkafka/PublishKafka.cpp | 280 
 extensions/librdkafka/PublishKafka.h   | 180 ++
 extensions/librdkafka/PutKafka.cpp | 274 ---
 extensions/librdkafka/PutKafka.h   | 179 --
 extensions/librdkafka/RdKafkaLoader.h  |   8 +-
 7 files changed, 466 insertions(+), 459 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/0756097a/CMakeLists.txt
--
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e2c68f5..59253eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -150,7 +150,7 @@ endif(ENABLE_PCAP)
 ## Create LibRdKafka Extension
 option(ENABLE_LIBRDKAFKA "Enables the librdkafka extension." OFF)
 if (ENABLE_LIBRDKAFKA)
-   createExtension(RDKAFKA-EXTENSIONS "RDKAFKA EXTENSIONS" "This Enables 
librdkafka functionality including PutKafka" "extensions/librdkafka" 
"${TEST_DIR}/kafka-tests" "TRUE" "thirdparty/librdkafka-0.11.1")
+   createExtension(RDKAFKA-EXTENSIONS "RDKAFKA EXTENSIONS" "This Enables 
librdkafka functionality including PublishKafka" "extensions/librdkafka" 
"${TEST_DIR}/kafka-tests" "TRUE" "thirdparty/librdkafka-0.11.1")
 endif()
 
 ## Scripting extensions

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/0756097a/README.md
--
diff --git a/README.md b/README.md
index a21306c..ea5e45f 100644
--- a/README.md
+++ b/README.md
@@ -63,7 +63,7 @@ Perspectives of the role of MiNiFi should be from the 
perspective of the agent a
   * FocusArchive
   * UnfocusArchive
   * ManipulateArchive
-  * PutKafka 
+  * PublishKafka 
 * Provenance events generation is supported and are persisted using RocksDB. 
Volatile repositories can be used on systems without persistent storage.
 
 ## System Requirements

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/0756097a/extensions/librdkafka/PublishKafka.cpp
--
diff --git a/extensions/librdkafka/PublishKafka.cpp 
b/extensions/librdkafka/PublishKafka.cpp
new file mode 100644
index 000..dc99a80
--- /dev/null
+++ b/extensions/librdkafka/PublishKafka.cpp
@@ -0,0 +1,280 @@
+/**
+ * @file PublishKafka.cpp
+ * PublishKafka class implementation
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+#include "PublishKafka.h"
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "utils/TimeUtil.h"
+#include "utils/StringUtils.h"
+#include "core/ProcessContext.h"
+#include "core/ProcessSession.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace processors {
+
+core::Property PublishKafka::SeedBrokers("Known Brokers", "A comma-separated 
list of known Kafka Brokers in the format :", "");
+core::Property PublishKafka::Topic("Topic Name", "The Kafka Topic of 
interest", "");
+core::Property PublishKafka::DeliveryGuarantee("Delivery Guarantee", 
"Specifies the requirement for guaranteeing that a message is sent to Kafka", 
DELIVERY_ONE_NODE);
+core::Property PublishKafka::MaxMessageSize("Max Request Size", "Maximum Kafka 

nifi-minifi-cpp git commit: MINIFICPP-318 specify python2 as python interpreter for integration test virtualenv in docker-verify target

2017-11-28 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master bccced673 -> 77f32f10e


MINIFICPP-318 specify python2 as python interpreter for integration test 
virtualenv in docker-verify target

This closes #204.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/77f32f10
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/77f32f10
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/77f32f10

Branch: refs/heads/master
Commit: 77f32f10e78c8726642f6d178a2ac64502b358cc
Parents: bccced6
Author: Kevin Doran 
Authored: Wed Nov 22 22:12:22 2017 -0500
Committer: Marc Parisi 
Committed: Tue Nov 28 13:51:52 2017 -0500

--
 docker/DockerVerify.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/77f32f10/docker/DockerVerify.sh
--
diff --git a/docker/DockerVerify.sh b/docker/DockerVerify.sh
index edc983a..0707a12 100755
--- a/docker/DockerVerify.sh
+++ b/docker/DockerVerify.sh
@@ -22,7 +22,7 @@ docker_dir="$( cd ${0%/*} && pwd )"
 # Create virutal environment for testing
 if [[ ! -d ./test-env-py2 ]]; then
   echo "Creating virtual environment in ./test-env-py2" 1>&2
-  virtualenv ./test-env-py2
+  virtualenv --python=python2 ./test-env-py2
 fi
 
 echo "Activating virtual environment..." 1>&2



nifi-minifi-cpp git commit: MINIFICPP-325: Up semantic version

2017-11-28 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master f5bf3c8b6 -> bccced673


MINIFICPP-325: Up semantic version

This closes #208.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/bccced67
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/bccced67
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/bccced67

Branch: refs/heads/master
Commit: bccced673f92b14b9c7b3cf5f0aa064f22c5f595
Parents: f5bf3c8
Author: Marc Parisi 
Authored: Mon Nov 27 15:22:15 2017 -0500
Committer: Marc Parisi 
Committed: Tue Nov 28 13:49:30 2017 -0500

--
 CMakeLists.txt   | 2 +-
 README.md| 8 
 docker/DockerVerify.sh   | 2 +-
 libminifi/CMakeLists.txt | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/bccced67/CMakeLists.txt
--
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a9103d..e2c68f5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,7 +21,7 @@ cmake_minimum_required(VERSION 3.0)
 project(nifi-minifi-cpp)
 set(PROJECT_NAME "nifi-minifi-cpp")
 set(PROJECT_VERSION_MAJOR 0)
-set(PROJECT_VERSION_MINOR 3)
+set(PROJECT_VERSION_MINOR 4)
 set(PROJECT_VERSION_PATCH 0)
 option(SKIP_TESTS "Skips building all tests." OFF)
 

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/bccced67/README.md
--
diff --git a/README.md b/README.md
index 7faa40a..a21306c 100644
--- a/README.md
+++ b/README.md
@@ -42,7 +42,7 @@ Specific goals for MiNiFi are comprised of:
 Perspectives of the role of MiNiFi should be from the perspective of the agent 
acting immediately at, or directly adjacent to, source sensors, systems, or 
servers.
 
 ## Caveats
-* 0.3.0 represents a non-GA release, APIs and interfaces are subject to change
+* 0.4.0 represents a non-GA release, APIs and interfaces are subject to change
 * Build and usage currently only supports Linux and OS X environments. MiNiFi 
C++ can be built and run through the Windows Subsystem for Linux but we provide 
no support for this platform.
 * The processors currently implemented include:
   * AppendHostInfo
@@ -294,11 +294,11 @@ $ sudo brew install libpcap
 ```
 ~/Development/code/apache/nifi-minifi-cpp/build
 $ make docker
-NiFi-MiNiFi-CPP Version: 0.3.0
+NiFi-MiNiFi-CPP Version: 0.4.0
 Current Working Directory: 
/Users/jdyer/Development/github/nifi-minifi-cpp/docker
 CMake Source Directory: /Users/jdyer/Development/github/nifi-minifi-cpp
-MiNiFi Package: nifi-minifi-cpp-0.3.0-bin.tar.gz
-Docker Command: 'docker build --build-arg UID=1000 --build-arg GID=1000 
--build-arg MINIFI_VERSION=0.3.0 --build-arg 
MINIFI_PACKAGE=nifi-minifi-cpp-0.3.0-bin.tar.gz -t apacheminificpp:0.3.0 .'
+MiNiFi Package: nifi-minifi-cpp-0.4.0-bin.tar.gz
+Docker Command: 'docker build --build-arg UID=1000 --build-arg GID=1000 
--build-arg MINIFI_VERSION=0.4.0 --build-arg 
MINIFI_PACKAGE=nifi-minifi-cpp-0.4.0-bin.tar.gz -t apacheminificpp:0.4.0 .'
 Sending build context to Docker daemon 777.2 kB
 Step 1 : FROM alpine:3.5
  ---> 88e169ea8f46

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/bccced67/docker/DockerVerify.sh
--
diff --git a/docker/DockerVerify.sh b/docker/DockerVerify.sh
index f7014fd..edc983a 100755
--- a/docker/DockerVerify.sh
+++ b/docker/DockerVerify.sh
@@ -47,7 +47,7 @@ pip install --upgrade \
 m2crypto \
 watchdog
 
-export MINIFI_VERSION=0.3.0
+export MINIFI_VERSION=0.4.0
 export PYTHONPATH="${PYTHONPATH}:${docker_dir}/test/integration"
 
 exec pytest -s -v "${docker_dir}"/test/integration

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/bccced67/libminifi/CMakeLists.txt
--
diff --git a/libminifi/CMakeLists.txt b/libminifi/CMakeLists.txt
index df775a7..b184337 100644
--- a/libminifi/CMakeLists.txt
+++ b/libminifi/CMakeLists.txt
@@ -22,7 +22,7 @@ cmake_minimum_required (VERSION 2.6)
 project(nifi-libcore-minifi)
 set(PROJECT_NAME "nifi-libcore-minifi")
 set(PROJECT_VERSION_MAJOR 0)
-set(PROJECT_VERSION_MINOR 3)
+set(PROJECT_VERSION_MINOR 4)
 set(PROJECT_VERSION_PATCH 0)
 
  Establish Project Configuration 



nifi-minifi-cpp git commit: MINIFICPP-335: Providing XCode 9.1 build in Travis.

2017-11-29 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 0756097aa -> 231ccaa14


MINIFICPP-335: Providing XCode 9.1 build in Travis.

This closes #210.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/231ccaa1
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/231ccaa1
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/231ccaa1

Branch: refs/heads/master
Commit: 231ccaa1442cd32740ab2c4502e8d7ee8c39612f
Parents: 0756097
Author: Aldrin Piri 
Authored: Wed Nov 29 10:27:11 2017 -0500
Committer: Marc Parisi 
Committed: Wed Nov 29 12:43:17 2017 -0500

--
 .travis.yml | 20 
 1 file changed, 20 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/231ccaa1/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index 290b66d..6ff8cb2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -90,6 +90,26 @@ matrix:
 - package='libpng'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
 - package='libpcap'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
 - package='xz'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+- os: osx
+  osx_image: xcode9.1
+  env:
+- CMAKE_BUILD_OPTIONS="${CMAKE_BUILD_OPTIONS} -DENABLE_LUA_SCRIPTING=1"
+  # https://docs.travis-ci.com/user/osx-ci-environment/#Homebrew
+  before_install:
+- brew update
+- package='ossp-uuid'; [[ $(brew ls --versions ${package}) ]] && { 
brew outdated ${package} || brew upgrade ${package}; } || brew install 
${package}
+- package='boost'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+- package='cmake'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+- package='ccache'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+- package='openssl'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+- package='doxygen'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+- package='graphviz'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+- package='python'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+- package='lua'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+- package='libusb'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+- package='libpng'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+- package='libpcap'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+- package='xz'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
 
 script:
   - mkdir ./build && cd ./build && cmake .. ${CMAKE_BUILD_OPTIONS} && make -j2 
VERBOSE=1 && sudo make test ARGS="-j2 --output-on-failure" && make linter && 
make apache-rat && make docs



svn commit: r1816750 - /nifi/site/trunk/minifi/download.html

2017-11-30 Thread phrocker
Author: phrocker
Date: Thu Nov 30 19:29:21 2017
New Revision: 1816750

URL: http://svn.apache.org/viewvc?rev=1816750=rev
Log:
MINIFICPP-304: Close out MiNiFi CPP 0.3.0 Release

Modified:
nifi/site/trunk/minifi/download.html

Modified: nifi/site/trunk/minifi/download.html
URL: 
http://svn.apache.org/viewvc/nifi/site/trunk/minifi/download.html?rev=1816750=1816749=1816750=diff
==
--- nifi/site/trunk/minifi/download.html (original)
+++ nifi/site/trunk/minifi/download.html Thu Nov 30 19:29:21 2017
@@ -159,16 +159,16 @@
 
 MiNiFi C++
 
-  cpp-0.2.0
+  cpp-0.3.0
   
   
   Sources:
   
-  https://www.apache.org/dyn/closer.lua?path=/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-source.tar.gz;>nifi-minifi-cpp-0.2.0-source.tar.gz
-( https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-source.tar.gz.asc;>asc,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-source.tar.gz.md5;>md5,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-source.tar.gz.sha1;>sha1,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-source.tar.gz.sha256;>sha256
 )
+  https://www.apache.org/dyn/closer.lua?path=/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-source.tar.gz;>nifi-minifi-cpp-0.3.0-source.tar.gz
+( https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-source.tar.gz.asc;>asc,
+  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-source.tar.gz.md5;>md5,
+  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-source.tar.gz.sha1;>sha1,
+  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-source.tar.gz.sha256;>sha256
 )
   
   
   
@@ -176,30 +176,30 @@
   Binaries
   
   Linux - RHEL Based Distributions - x86_64
-  https://www.apache.org/dyn/closer.lua?path=/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-rhel-x86_64.tar.gz;>nifi-minifi-cpp-0.2.0-bin-linux-rhel-x86_64.tar.gz
-( https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-rhel-x86_64.tar.gz.asc;>asc,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-rhel-x86_64.tar.gz.md5;>md5,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-rhel-x86_64.tar.gz.sha1;>sha1,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-rhel-x86_64.tar.gz.sha256;>sha256
 )
+  https://www.apache.org/dyn/closer.lua?path=/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-bin-linux-rhel.tar.gz;>nifi-minifi-cpp-0.3.0-bin-linux-rhel.tar.gz
+( https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-bin-linux-rhel.tar.gz.asc;>asc,
+  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-bin-linux-rhel.tar.gz.md5;>md5,
+  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-bin-linux-rhel.tar.gz.sha1;>sha1,
+  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-bin-linux-rhel.tar.gz.sha256;>sha256
 )
   
   Linux - Debian Based Distributions - x86_64
-  https://www.apache.org/dyn/closer.lua?path=/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-debian-x86_64.tar.gz;>nifi-minifi-cpp-0.2.0-bin-linux-debian-x86_64.tar.gz
-( https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-debian-x86_64.tar.gz.asc;>asc,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-debian-x86_64.tar.gz.md5;>md5,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-debian-x86_64.tar.gz.sha1;>sha1,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-debian-x86_64.tar.gz.sha256;>sha256
 )
+  https://www.apach

nifi-site git commit: MINIFICPP-304: Update download links for latest MiNiFi C++ Release

2017-11-30 Thread phrocker
Repository: nifi-site
Updated Branches:
  refs/heads/master 2e8841a5e -> 818a8fe36


MINIFICPP-304: Update download links for latest MiNiFi C++ Release


Project: http://git-wip-us.apache.org/repos/asf/nifi-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-site/commit/818a8fe3
Tree: http://git-wip-us.apache.org/repos/asf/nifi-site/tree/818a8fe3
Diff: http://git-wip-us.apache.org/repos/asf/nifi-site/diff/818a8fe3

Branch: refs/heads/master
Commit: 818a8fe3676e58fd1a54080ac98805cc18adfb3a
Parents: 2e8841a
Author: Marc Parisi 
Authored: Thu Nov 30 14:18:45 2017 -0500
Committer: Marc Parisi 
Committed: Thu Nov 30 14:18:45 2017 -0500

--
 src/pages/html/minifi/download.hbs | 44 -
 1 file changed, 22 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-site/blob/818a8fe3/src/pages/html/minifi/download.hbs
--
diff --git a/src/pages/html/minifi/download.hbs 
b/src/pages/html/minifi/download.hbs
index 93a1a8a..60c35bf 100644
--- a/src/pages/html/minifi/download.hbs
+++ b/src/pages/html/minifi/download.hbs
@@ -60,16 +60,16 @@ title: Apache NiFi - MiNiFi Downloads
 
 MiNiFi C++
 
-  cpp-0.2.0
+  cpp-0.3.0
   
   
   Sources:
   
-  https://www.apache.org/dyn/closer.lua?path=/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-source.tar.gz;>nifi-minifi-cpp-0.2.0-source.tar.gz
-( https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-source.tar.gz.asc;>asc,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-source.tar.gz.md5;>md5,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-source.tar.gz.sha1;>sha1,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-source.tar.gz.sha256;>sha256
 )
+  https://www.apache.org/dyn/closer.lua?path=/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-source.tar.gz;>nifi-minifi-cpp-0.3.0-source.tar.gz
+( https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-source.tar.gz.asc;>asc,
+  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-source.tar.gz.md5;>md5,
+  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-source.tar.gz.sha1;>sha1,
+  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-source.tar.gz.sha256;>sha256
 )
   
   
   
@@ -77,30 +77,30 @@ title: Apache NiFi - MiNiFi Downloads
   Binaries
   
   Linux - RHEL Based Distributions - x86_64
-  https://www.apache.org/dyn/closer.lua?path=/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-rhel-x86_64.tar.gz;>nifi-minifi-cpp-0.2.0-bin-linux-rhel-x86_64.tar.gz
-( https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-rhel-x86_64.tar.gz.asc;>asc,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-rhel-x86_64.tar.gz.md5;>md5,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-rhel-x86_64.tar.gz.sha1;>sha1,
-  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.2.0/nifi-minifi-cpp-0.2.0-bin-linux-rhel-x86_64.tar.gz.sha256;>sha256
 )
+  https://www.apache.org/dyn/closer.lua?path=/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-bin-linux-rhel.tar.gz;>nifi-minifi-cpp-0.3.0-bin-linux-rhel.tar.gz
+( https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-bin-linux-rhel.tar.gz.asc;>asc,
+  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-bin-linux-rhel.tar.gz.md5;>md5,
+  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-bin-linux-rhel.tar.gz.sha1;>sha1,
+  https://www.apache.org/dist/nifi/nifi-minifi-cpp/0.3.0/nifi-minifi-cpp-0.3.0-bin-linux-rhel.tar.gz.sha256;>sha256
 )
   
   Linux - Debian Based Distributions - x86_64
-  

[nifi-minifi-cpp] Git Push Summary

2017-11-30 Thread phrocker
Repository: nifi-minifi-cpp
Updated Tags:  refs/tags/rel/minifi-cpp-0.3.0 [created] 50a0011eb


nifi-minifi-cpp git commit: MINIFICPP-307 - support text mode in GenerateFlowFile

2017-11-27 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 997b956d4 -> 5a80197e1


MINIFICPP-307 - support text mode in GenerateFlowFile

MINIFICPP-307 - fix linter issues, typo

This closes #195.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/5a80197e
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/5a80197e
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/5a80197e

Branch: refs/heads/master
Commit: 5a80197e170645c33262460753c7d8bbedff5018
Parents: 997b956
Author: Dustin Rodrigues 
Authored: Sat Nov 18 14:45:52 2017 -0500
Committer: Marc Parisi 
Committed: Mon Nov 27 17:56:26 2017 -0500

--
 libminifi/src/processors/GenerateFlowFile.cpp | 38 +-
 1 file changed, 29 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/5a80197e/libminifi/src/processors/GenerateFlowFile.cpp
--
diff --git a/libminifi/src/processors/GenerateFlowFile.cpp 
b/libminifi/src/processors/GenerateFlowFile.cpp
index 3741a8f..32ca26b 100644
--- a/libminifi/src/processors/GenerateFlowFile.cpp
+++ b/libminifi/src/processors/GenerateFlowFile.cpp
@@ -45,6 +45,8 @@ core::Property GenerateFlowFile::BatchSize("Batch Size", "The 
number of FlowFile
 core::Property GenerateFlowFile::DataFormat("Data Format", "Specifies whether 
the data should be Text or Binary", GenerateFlowFile::DATA_FORMAT_BINARY);
 core::Property GenerateFlowFile::UniqueFlowFiles("Unique FlowFiles", "If true, 
each FlowFile that is generated will be unique. If false, a random value will 
be generated and all FlowFiles", "true");
 core::Relationship GenerateFlowFile::Success("success", "success operational 
on the flow record");
+const unsigned int TEXT_LEN = 90;
+static const char TEXT_CHARS[TEXT_LEN+1] = 
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()-_=+/?.,';:\"?<>\n\t
 ";
 
 void GenerateFlowFile::initialize() {
   // Set the supported properties
@@ -64,6 +66,7 @@ void GenerateFlowFile::onTrigger(core::ProcessContext 
*context, core::ProcessSes
   int64_t batchSize = 1;
   bool uniqueFlowFile = true;
   int64_t fileSize = 1024;
+  bool textData = false;
 
   std::string value;
   if (context->getProperty(FileSize.getName(), value)) {
@@ -72,6 +75,9 @@ void GenerateFlowFile::onTrigger(core::ProcessContext 
*context, core::ProcessSes
   if (context->getProperty(BatchSize.getName(), value)) {
 core::Property::StringToInt(value, batchSize);
   }
+  if (context->getProperty(DataFormat.getName(), value)) {
+textData = (value == GenerateFlowFile::DATA_FORMAT_TEXT);
+  }
   if (context->getProperty(UniqueFlowFiles.getName(), value)) {
 org::apache::nifi::minifi::utils::StringUtils::StringToBool(value, 
uniqueFlowFile);
   }
@@ -84,10 +90,17 @@ void GenerateFlowFile::onTrigger(core::ProcessContext 
*context, core::ProcessSes
 uint64_t dataSize = fileSize;
 GenerateFlowFile::WriteCallback callback(data, dataSize);
 char *current = data;
-for (int i = 0; i < fileSize; i += sizeof(int)) {
-  int randValue = random();
-  *(reinterpret_cast(current)) = randValue;
-  current += sizeof(int);
+if (textData) {
+  for (int i = 0; i < fileSize; i++) {
+int randValue = random();
+data[i] = TEXT_CHARS[randValue % TEXT_LEN];
+  }
+} else {
+  for (int i = 0; i < fileSize; i += sizeof(int)) {
+int randValue = random();
+*(reinterpret_cast(current)) = randValue;
+current += sizeof(int);
+  }
 }
 for (int i = 0; i < batchSize; i++) {
   // For each batch
@@ -101,14 +114,21 @@ void GenerateFlowFile::onTrigger(core::ProcessContext 
*context, core::ProcessSes
 delete[] data;
   } else {
 if (!_data) {
-  // We have not create the unique data yet
+  // We have not created the unique data yet
   _data = new char[fileSize];
   _dataSize = fileSize;
   char *current = _data;
-  for (int i = 0; i < fileSize; i += sizeof(int)) {
-int randValue = random();
-*(reinterpret_cast(current)) = randValue;
-current += sizeof(int);
+  if (textData) {
+for (int i = 0; i < fileSize; i++) {
+  int randValue = random();
+  _data[i] = TEXT_CHARS[randValue % TEXT_LEN];
+}
+  } else {
+for (int i = 0; i < fileSize; i += sizeof(int)) {
+  int randValue = random();
+  *(reinterpret_cast(current)) = randValue;
+  current += sizeof(int);
+}
   }
 }
 GenerateFlowFile::WriteCallback callback(_data, _dataSize);



nifi-minifi-cpp git commit: MINIFICPP-330 Implemented Expression Language substring operations

2017-12-18 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master d616effd3 -> dc131d5ac


MINIFICPP-330 Implemented Expression Language substring operations

This closes #219.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/dc131d5a
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/dc131d5a
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/dc131d5a

Branch: refs/heads/master
Commit: dc131d5ac92d0173a2fe891df0a77e7d4eff684d
Parents: d616eff
Author: Andy I. Christianson 
Authored: Tue Dec 12 12:04:46 2017 -0500
Committer: Marc Parisi 
Committed: Mon Dec 18 10:48:05 2017 -0500

--
 extensions/expression-language/Expression.cpp   | 61 +++--
 extensions/expression-language/Parser.yy| 15 +++--
 .../ExpressionLanguageTests.cpp | 69 
 3 files changed, 137 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/dc131d5a/extensions/expression-language/Expression.cpp
--
diff --git a/extensions/expression-language/Expression.cpp 
b/extensions/expression-language/Expression.cpp
index 8c03422..806ff6a 100644
--- a/extensions/expression-language/Expression.cpp
+++ b/extensions/expression-language/Expression.cpp
@@ -64,12 +64,44 @@ std::string expr_toUpper(const std::vector 
) {
   return result;
 }
 
+std::string expr_substring(const std::vector ) {
+  if (args.size() < 3) {
+return args[0].substr(std::stoul(args[1]));
+  } else {
+return args[0].substr(std::stoul(args[1]), std::stoul(args[2]));
+  }
+}
+
+std::string expr_substringBefore(const std::vector ) {
+  return args[0].substr(0, args[0].find(args[1]));
+}
+
+std::string expr_substringBeforeLast(const std::vector ) {
+  size_t last_pos = 0;
+  while (args[0].find(args[1], last_pos + 1) != std::string::npos) {
+last_pos = args[0].find(args[1], last_pos + 1);
+  }
+  return args[0].substr(0, last_pos);
+}
+
+std::string expr_substringAfter(const std::vector ) {
+  return args[0].substr(args[0].find(args[1]) + args[1].length());
+}
+
+std::string expr_substringAfterLast(const std::vector ) {
+  size_t last_pos = 0;
+  while (args[0].find(args[1], last_pos + 1) != std::string::npos) {
+last_pos = args[0].find(args[1], last_pos + 1);
+  }
+  return args[0].substr(last_pos + args[1].length());
+}
+
 template &)>
 Expression make_dynamic_function_incomplete(const std::string _name,
 const std::vector 
,
 std::size_t num_args) {
-  if (args.size() == num_args) {
-return make_dynamic([=](const Parameters ) -> std::string {
+  if (args.size() >= num_args) {
+auto result = make_dynamic([=](const Parameters ) -> std::string {
   std::vector evaluated_args;
 
   for (const auto  : args) {
@@ -78,6 +110,14 @@ Expression make_dynamic_function_incomplete(const 
std::string _name,
 
   return T(evaluated_args);
 });
+
+result.complete = [function_name, args](Expression expr) -> Expression {
+  std::vector complete_args = {expr};
+  complete_args.insert(complete_args.end(), args.begin(), args.end());
+  return make_dynamic_function(function_name, complete_args);
+};
+
+return result;
   } else {
 auto result = make_dynamic([](const Parameters ) -> std::string {
   throw std::runtime_error("Attempted to call incomplete function");
@@ -93,11 +133,22 @@ Expression make_dynamic_function_incomplete(const 
std::string _name,
   }
 }
 
-Expression make_dynamic_function(const std::string _name, const 
std::vector ) {
+Expression make_dynamic_function(const std::string _name,
+ const std::vector ) {
   if (function_name == "hostname") {
 return make_dynamic_function_incomplete(function_name, 
args, 0);
   } else if (function_name == "toUpper") {
 return make_dynamic_function_incomplete(function_name, args, 
1);
+  } else if (function_name == "substring") {
+return make_dynamic_function_incomplete(function_name, 
args, 2);
+  } else if (function_name == "substringBefore") {
+return 
make_dynamic_function_incomplete(function_name, args, 2);
+  } else if (function_name == "substringBeforeLast") {
+return 
make_dynamic_function_incomplete(function_name, args, 
2);
+  } else if (function_name == "substringAfter") {
+return 
make_dynamic_function_incomplete(function_name, args, 2);
+  } else if (function_name == "substringAfterLast") {
+return 
make_dynamic_function_incomplete(function_name, args, 
2);
   } else {
 std::string msg("Unknown expression function: ");
 

nifi-minifi-cpp git commit: MINIFICPP-350: fix PutFile and Expression compilation warnings

2017-12-18 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 726a1c6da -> d616effd3


MINIFICPP-350: fix PutFile and Expression compilation warnings

This closes #221.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/d616effd
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/d616effd
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/d616effd

Branch: refs/heads/master
Commit: d616effd352fd7f0f34c4cc52fbfa3180a73f3ac
Parents: 726a1c6
Author: Dustin Rodrigues 
Authored: Fri Dec 15 21:41:34 2017 -0500
Committer: Marc Parisi 
Committed: Mon Dec 18 09:36:37 2017 -0500

--
 extensions/expression-language/Expression.cpp | 2 +-
 libminifi/include/processors/PutFile.h| 4 +---
 libminifi/src/processors/PutFile.cpp  | 6 ++
 3 files changed, 4 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d616effd/extensions/expression-language/Expression.cpp
--
diff --git a/extensions/expression-language/Expression.cpp 
b/extensions/expression-language/Expression.cpp
index 9151948..8c03422 100644
--- a/extensions/expression-language/Expression.cpp
+++ b/extensions/expression-language/Expression.cpp
@@ -142,7 +142,7 @@ Expression Expression::operator+(const Expression 
_expr) const {
   result.append(other_val_fn(params));
   return result;
 });
-  } else if (!isDynamic() && !other_expr.isDynamic()) {
+  } else { // !isDynamic() && !other_expr.isDynamic()
 std::string result(val_);
 result.append(other_expr.val_);
 return make_static(result);

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d616effd/libminifi/include/processors/PutFile.h
--
diff --git a/libminifi/include/processors/PutFile.h 
b/libminifi/include/processors/PutFile.h
index c2f4d88..c84ee87 100644
--- a/libminifi/include/processors/PutFile.h
+++ b/libminifi/include/processors/PutFile.h
@@ -81,8 +81,7 @@ class PutFile : public core::Processor {
   class ReadCallback : public InputStreamCallback {
public:
 ReadCallback(const std::string _file,
- const std::string _file,
- bool try_mkdirs);
+ const std::string _file);
 ~ReadCallback();
 virtual int64_t process(std::shared_ptr stream);
 bool commit();
@@ -93,7 +92,6 @@ class PutFile : public core::Processor {
 std::string tmp_file_;
 std::string dest_file_;
 std::string dest_dir_;
-bool try_mkdirs_;
   };
 
   /**

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d616effd/libminifi/src/processors/PutFile.cpp
--
diff --git a/libminifi/src/processors/PutFile.cpp 
b/libminifi/src/processors/PutFile.cpp
index b0e4f15..9ffbbd7 100644
--- a/libminifi/src/processors/PutFile.cpp
+++ b/libminifi/src/processors/PutFile.cpp
@@ -238,7 +238,7 @@ bool PutFile::putFile(core::ProcessSession *session,
 }
   }
 
-  ReadCallback cb(tmpFile, destFile, try_mkdirs_);
+  ReadCallback cb(tmpFile, destFile);
   session->read(flowFile, );
 
   logger_->log_info("Committing %s", destFile);
@@ -252,11 +252,9 @@ bool PutFile::putFile(core::ProcessSession *session,
 }
 
 PutFile::ReadCallback::ReadCallback(const std::string _file,
-const std::string _file,
-bool try_mkdirs)
+const std::string _file)
 : tmp_file_(tmp_file),
   dest_file_(dest_file),
-  try_mkdirs_(try_mkdirs),
   logger_(logging::LoggerFactory::getLogger()) {
 }
 



nifi-minifi-cpp git commit: MINIFICPP-41: First iteration of C api MINIFICPP-41: Improve build process and make function names clearer

2017-12-18 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 2981bc1d4 -> 088e1be7c


MINIFICPP-41: First iteration of C api
MINIFICPP-41: Improve build process and make function names clearer

This closes #217.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/088e1be7
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/088e1be7
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/088e1be7

Branch: refs/heads/master
Commit: 088e1be7ca9deac9f104ebf315a88bd311e6a623
Parents: 2981bc1
Author: Marc Parisi 
Authored: Tue Dec 5 13:57:06 2017 -0500
Committer: Marc Parisi 
Committed: Mon Dec 18 13:55:28 2017 -0500

--
 CMakeLists.txt  |   3 +
 LibExample/CMakeLists.txt   |  61 +
 LibExample/generate_flow.c  |  67 +
 LibExample/transmit_flow.c  |  92 +++
 libminifi/CMakeLists.txt|   4 +
 libminifi/include/capi/Instance.h   | 134 ++
 libminifi/include/capi/Plan.h   | 117 
 libminifi/include/capi/ReflexiveSession.h   |  77 ++
 libminifi/include/capi/api.h| 154 +++
 libminifi/include/capi/expect.h |  32 +++
 libminifi/include/core/ProcessContext.h |   4 +-
 libminifi/include/core/ProcessSession.h |   6 +-
 .../include/sitetosite/SiteToSiteFactory.h  |   3 +
 libminifi/src/RemoteProcessorGroupPort.cpp  |   1 +
 libminifi/src/capi/Plan.cpp | 216 +++
 libminifi/src/capi/api.cpp  | 264 +++
 16 files changed, 1231 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/088e1be7/CMakeLists.txt
--
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3463d69..eabc1ba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -206,6 +206,9 @@ endif()
 ## NOW WE CAN ADD LIBRARIES AND EXTENSIONS TO MAIN
 
 add_subdirectory(main)
+if (NOT DISABLE_CURL)
+  add_subdirectory(LibExample)
+endif()
 
 
 # Generate source assembly

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/088e1be7/LibExample/CMakeLists.txt
--
diff --git a/LibExample/CMakeLists.txt b/LibExample/CMakeLists.txt
new file mode 100644
index 000..4ba26bd
--- /dev/null
+++ b/LibExample/CMakeLists.txt
@@ -0,0 +1,61 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+#
+
+cmake_minimum_required(VERSION 2.6)
+
+IF(POLICY CMP0048)
+  CMAKE_POLICY(SET CMP0048 OLD)
+ENDIF(POLICY CMP0048)
+
+include_directories(../libminifi/include  ../libminifi/include/c2  
../libminifi/include/c2/protocols/  ../libminifi/include/core/state 
./libminifi/include/core/statemanagement/metrics  
../libminifi/include/core/yaml  ../libminifi/include/core  
../thirdparty/spdlog-20170710/include ../thirdparty/concurrentqueue 
../thirdparty/yaml-cpp-yaml-cpp-20171024/include 
../thirdparty/civetweb-1.9.1/include ../thirdparty/jsoncpp/include  
../thirdparty/)
+
+include(CheckCXXCompilerFlag)
+CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+if(COMPILER_SUPPORTS_CXX11)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Os")
+elseif(COMPILER_SUPPORTS_CXX0X)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Os")
+else()
+ message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. 
Please use a different C++ compiler.")
+endif()
+
+add_executable(transmit_flow transmit_flow.c)
+
+# Link against minifi, yaml-cpp, civetweb-cpp, uuid, openssl, jsoncpp and 
rocksdb
+target_link_libraries(transmit_flow capi core-minifi minifi)
+
+if (APPLE)
+   target_link_libraries (transmit_flow -Wl,-all_load minifi-http-curl)
+else ()
+   

nifi-minifi-cpp git commit: MINIFICPP-346: Add raspi distro

2017-12-19 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 088e1be7c -> 43bd2270c


MINIFICPP-346: Add raspi distro

This closes #222.

Approved by achristianson on GH.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/43bd2270
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/43bd2270
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/43bd2270

Branch: refs/heads/master
Commit: 43bd2270c1e9734bab3c0d96292f1f667517a32d
Parents: 088e1be
Author: Marc Parisi 
Authored: Tue Dec 19 01:48:28 2017 +
Committer: Marc Parisi 
Committed: Tue Dec 19 10:11:16 2017 -0500

--
 bootstrap.sh | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/43bd2270/bootstrap.sh
--
diff --git a/bootstrap.sh b/bootstrap.sh
index e58756b..00830bb 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -115,6 +115,8 @@ OS_REVISION=`echo $EVR   | cut -d. -f3`
 
 if [[ "$OS" = "Darwin" ]]; then
   source darwin.sh
+elif [[ "$OS" = Rasp* ]]; then
+  source ubuntu.sh
 elif [[ "$OS" = Ubuntu* ]]; then
   source ubuntu.sh
 elif [[ "$OS" = Red* ]]; then
@@ -189,7 +191,8 @@ add_dependency GPS_ENABLED "gpsd"
 
 add_disabled_option KAFKA_ENABLED ${FALSE} "ENABLE_LIBRDKAFKA" "3.4.0"
 
-add_disabled_option BUSTACHE_ENABLED ${FALSE} "ENABLE_BUSTACHE"
+#add_disabled_option BUSTACHE_ENABLED ${FALSE} "ENABLE_BUSTACHE"
+#add_dependency BUSTACHE_ENABLED "boost"
 
 ## currently need to limit on certain platforms
 #add_disabled_option TENSORFLOW_ENABLED ${FALSE} "ENABLE_TENSORFLOW"
@@ -283,11 +286,6 @@ print_feature_status(){
 }
 
 
-   CLANG_VERSION=`clang --version | head -n 1 | awk '{print $4}'`
- CLANG_MAJOR=`echo $CLANG_VERSION | cut -d. -f1`
-   CLANG_MINOR=`echo $CLANG_VERSION | cut -d. -f2`
-   CLANG_REVISION=`echo $CLANG_VERSION | cut -d. -f3`
-   
 ### parse the command line arguments
 
 while :; do



nifi-minifi-cpp git commit: MINIFICPP-346: Add automated detection that we cannot build bustache via bootstrap and eliminate it from travis

2017-12-13 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master df353561c -> 726a1c6da


MINIFICPP-346: Add automated detection that we cannot build bustache via 
bootstrap and eliminate it from travis

MINIFICPP-346: Remote make docs to address slowdown and timeouts

Approved on Github by jdye64

This closes #220.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/726a1c6d
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/726a1c6d
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/726a1c6d

Branch: refs/heads/master
Commit: 726a1c6da8b201d6e47cc1cd72723a9fb5d1bfac
Parents: df35356
Author: Marc Parisi 
Authored: Wed Dec 13 14:37:57 2017 -0500
Committer: Marc Parisi 
Committed: Wed Dec 13 20:00:46 2017 -0500

--
 .travis.yml  |  2 +-
 bootstrap.sh | 25 +
 darwin.sh| 18 +-
 3 files changed, 35 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/726a1c6d/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index fc45af9..698a07b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -121,4 +121,4 @@ matrix:
 - package='xz'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
 
 script:
-  - ./bootstrap.sh -e -t && cd build  && make -j2 VERBOSE=1 && sudo make test 
ARGS="-j2 --output-on-failure" && make linter && make apache-rat && make docs
+  - ./bootstrap.sh -e -t && cd build  && make -j2 VERBOSE=1 && sudo make test 
ARGS="-j2 --output-on-failure" && make linter && make apache-rat

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/726a1c6d/bootstrap.sh
--
diff --git a/bootstrap.sh b/bootstrap.sh
index bcce694..e58756b 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -189,6 +189,8 @@ add_dependency GPS_ENABLED "gpsd"
 
 add_disabled_option KAFKA_ENABLED ${FALSE} "ENABLE_LIBRDKAFKA" "3.4.0"
 
+add_disabled_option BUSTACHE_ENABLED ${FALSE} "ENABLE_BUSTACHE"
+
 ## currently need to limit on certain platforms
 #add_disabled_option TENSORFLOW_ENABLED ${FALSE} "ENABLE_TENSORFLOW"
 
@@ -281,6 +283,11 @@ print_feature_status(){
 }
 
 
+   CLANG_VERSION=`clang --version | head -n 1 | awk '{print $4}'`
+ CLANG_MAJOR=`echo $CLANG_VERSION | cut -d. -f1`
+   CLANG_MINOR=`echo $CLANG_VERSION | cut -d. -f2`
+   CLANG_REVISION=`echo $CLANG_VERSION | cut -d. -f3`
+   
 ### parse the command line arguments
 
 while :; do
@@ -336,10 +343,11 @@ show_supported_features() {
   echo "H. USB Camera support ..$(print_feature_status USB_ENABLED)"
   echo "I. GPS support .$(print_feature_status GPS_ENABLED)"
   echo "J. TensorFlow Support ..$(print_feature_status 
TENSORFLOW_ENABLED)"
-  echo "K. Enable all extensions"
-  echo "L. Portable Build ..$(print_feature_status PORTABLE_BUILD)"
-  echo "M. Build with Debug symbols $(print_feature_status DEBUG_SYMBOLS)"
-  echo "N. Continue with these options"
+  echo "K. Bustache Support $(print_feature_status 
BUSTACHE_ENABLED)"
+  echo "L. Enable all extensions"
+  echo "M. Portable Build ..$(print_feature_status PORTABLE_BUILD)"
+  echo "N. Build with Debug symbols $(print_feature_status DEBUG_SYMBOLS)"
+  echo "O. Continue with these options"
   echo "Q. Exit"
   echo "* Extension cannot be installed due to"
   echo -e "  version of cmake or other software\r\n"
@@ -359,10 +367,11 @@ read_options(){
 h) ToggleFeature USB_ENABLED ;;
 i) ToggleFeature GPS_ENABLED ;;
 j) ToggleFeature TENSORFLOW_ENABLED ;;
-k) EnableAllFeatures ;;
-l) ToggleFeature PORTABLE_BUILD ;;
-m) ToggleFeature DEBUG_SYMBOLS ;;
-n) FEATURES_SELECTED="true" ;;
+k) ToggleFeature BUSTACHE_ENABLED ;;
+l) EnableAllFeatures ;;
+m) ToggleFeature PORTABLE_BUILD ;;
+n) ToggleFeature DEBUG_SYMBOLS ;;
+o) FEATURES_SELECTED="true" ;;
 q) exit 0;;
 *) echo -e "${RED}Please enter an option A-L...${NO_COLOR}" && sleep 2
   esac

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/726a1c6d/darwin.sh
--
diff --git a/darwin.sh b/darwin.sh
index 90f748b..85032f8 100644
--- a/darwin.sh
+++ b/darwin.sh
@@ -1,7 +1,23 @@
 #!/bin/bash
 
 verify_enable() {
-  echo "true"
+  feature="$1"
+  feature_status=${!1}
+  if [ "$feature" = "BUSTACHE_ENABLED" ]; then
+   BUSTACHE_MAX="9"
+## we should check the xcode version
+CLANG_VERSION=`clang --version | head -n 1 

nifi-minifi-cpp git commit: MINIFICPP-328 Added processor documentation

2017-12-13 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 002b07434 -> c719b40a7


MINIFICPP-328 Added processor documentation

This closes #214.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/c719b40a
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/c719b40a
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/c719b40a

Branch: refs/heads/master
Commit: c719b40a7f9dd23f54e0222876680aedb988b786
Parents: 002b074
Author: Andy I. Christianson 
Authored: Thu Nov 30 13:57:24 2017 -0500
Committer: Marc Parisi 
Committed: Wed Dec 13 12:55:29 2017 -0500

--
 PROCESSORS.md | 725 +
 README.md |  44 ++--
 2 files changed, 749 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/c719b40a/PROCESSORS.md
--
diff --git a/PROCESSORS.md b/PROCESSORS.md
new file mode 100644
index 000..09c7d24
--- /dev/null
+++ b/PROCESSORS.md
@@ -0,0 +1,725 @@
+
+
+# Processors
+
+## Table of Contents
+
+- [AppendHostInfo](#appendhostinfo)
+- [ExecuteProcess](#executeprocess)
+- [ExecuteScript](#executescript)
+- [GetFile](#getfile)
+- [GetUSBCamera](#getusbcamera)
+- [GenerateFlowFile](#generateflowfile)
+- [InvokeHTTP](#invokehttp)
+- [LogAttribute](#logattribute)
+- [ListenHTTP](#listenhttp)
+- [ListenSyslog](#listensyslog)
+- [PutFile](#putfile)
+- [TailFile](#tailfile)
+- [MergeContent](#mergecontent)
+- [ExtractText](#extracttext)
+- [CompressContent](#compresscontent)
+- [FocusArchiveEntry](#focusarchiveentry)
+- [UnfocusArchiveEntry](#unfocusarchiveentry)
+- [ManipulateArchive](#manipulatearchive)
+- [PublishKafka](#publishkafka)
+
+## AppendHostInfo
+
+### Description
+
+Appends host information such as IP address and hostname  as an attribute to
+incoming flowfiles.
+
+### Properties
+
+In the list below, the names of required properties appear in bold. Any other
+properties (not in bold) are considered optional. The table also indicates any
+default values, and whether a property supports the NiFi Expression Language.
+
+| Name | Default Value | Allowable Values | Description |
+| - | - | - | - |
+| **Network Interface Name** | eth0 | | Network interface from which to read 
an IP v4 address |
+| **Hostname Attribute** | source.hostname |  | Flowfile attribute to used to 
record the agent's hostname |
+| **IP Attribute** | source.ipv4 |  | Flowfile attribute to used to record the 
agent's IP address |
+
+### Relationships
+
+| Name | Description |
+| - | - |
+| success | All FlowFiles are routed to this relationship. |
+
+## ExecuteProcess
+
+### Description
+
+Runs an operating system command specified by the user and writes the output of
+that command to a FlowFile. If the command is expected to be long-running, the
+Processor can output the partial data on a specified interval. When this option
+is used, the output is expected to be in textual format, as it typically does
+not make sense to split binary data on arbitrary time-based intervals.
+
+### Properties
+
+In the list below, the names of required properties appear in bold. Any other
+properties (not in bold) are considered optional. The table also indicates any
+default values, and whether a property supports the NiFi Expression Language.
+
+| Name | Default Value | Allowable Values | Description |
+| - | - | - | - |
+| **Command** | | | Specifies the command to be executed; if just the name of 
an executable is provided, it must be in the user's environment PATH. |
+| Command Arguments | | | The arguments to supply to the executable delimited 
by white space. White space can be escaped by enclosing it in double-quotes. |
+| Working Directory | | | The directory to use as the current working 
directory when executing the command |
+| **Batch Duration** | 0  || If the process is expected to be long-running and 
produce textual output, a batch duration can be specified. |
+| **Redirect Error Stream** | false | | If true will redirect any error stream 
output of the process to the output stream. |
+
+### Relationships
+
+| Name | Description |
+| - | - |
+| success | All created FlowFiles are routed to this relationship. |
+
+## ExecuteScript
+
+### Description
+
+Executes a script given the flow file and a process session. The script is
+responsible for handling the incoming flow file (transfer to SUCCESS or remove,
+e.g.) as well as any flow files created by the script. If the handling is
+incomplete or incorrect, the session will be rolled back.
+
+Scripts must define an onTrigger function which accepts NiFi Context and
+Property objects. For efficiency, 

nifi-minifi-cpp git commit: MINIFICPP-339: Add bootstrap script

2017-12-13 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master c719b40a7 -> 342cee09a


MINIFICPP-339: Add bootstrap script

MINIFICPP-339: Update readme and options

MINIFICPP-339: Add rhel6 controls

MINIFICPP-339: Run bash beautify

This closes #218.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/342cee09
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/342cee09
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/342cee09

Branch: refs/heads/master
Commit: 342cee09a41a9641ad59ddd7c91333c73166a1e9
Parents: c719b40
Author: Marc Parisi 
Authored: Fri Dec 8 13:16:13 2017 -0500
Committer: Marc Parisi 
Committed: Wed Dec 13 14:23:05 2017 -0500

--
 .travis.yml  |   2 +-
 README.md|  39 +++
 bootstrap.sh | 471 ++
 centos.sh| 144 +
 darwin.sh|  71 +
 extensions/librdkafka/CMakeLists.txt |   4 -
 extensions/usb-camera/CMakeLists.txt |   4 -
 fedora.sh|  69 +
 rheldistro.sh| 113 +++
 ubuntu.sh|  69 +
 10 files changed, 977 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/342cee09/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index c732db9..219d973 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -120,4 +120,4 @@ matrix:
 - package='xz'; [[ $(brew ls --versions ${package}) ]] && { brew 
outdated ${package} || brew upgrade ${package}; } || brew install ${package}
 
 script:
-  - mkdir ./build && cd ./build && cmake .. ${CMAKE_BUILD_OPTIONS} && make -j2 
VERBOSE=1 && sudo make test ARGS="-j2 --output-on-failure" && make linter && 
make apache-rat && make docs
+  - ./bootstrap.sh -e -t && cd build  && make -j2 VERBOSE=1 && sudo make test 
ARGS="-j2 --output-on-failure" && make linter && make apache-rat && make docs

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/342cee09/README.md
--
diff --git a/README.md b/README.md
index 9993832..4872dd3 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,7 @@ MiNiFi is a child project effort of Apache NiFi.  This 
repository is for a nativ
 - [Caveats](#caveats)
 - [Getting Started](#getting-started)
   - [System Requirements](#system-requirements)
+  - [Bootstrapping](#bootstrapping)
   - [Building](#building)
   - [Cleaning](#cleaning)
   - [Configuring](#configuring)
@@ -215,6 +216,44 @@ $ sudo brew install libpcap
 
 ## Getting Started
 
+### Bootstrapping
+
+- MiNiFi C++ offers a bootstrap script in the root of our github repo that 
will boot strap the cmake and build process for you without the need to install 
dependencies yourself. To use this process, please run the command boostrap.sh 
from the root of the MiNiFi C++ source tree.
+
+
+- Per the table, below, you will be presented with a menu guided bootstrap 
process. You may enable and disable extensions ( further defined below ). Once 
you are finished selecting the features you wish to build, enter N to continue 
with the process. CMAKE dependencies will be resolved for your distro. You may 
enter command line options -n to force yes to all prompts ( including the 
package installation prompts ) and -b to automatically run make once the cmake 
process is complete. Alternatively, you may include the package argument to 
boostrap, -p, which will run make package.
+
+- If you provide -b or -p to bootstrap.sh, you do not need to follow the 
Building section, below. If you do not provide these arguments you may skip the 
cmake .. section from Building.
+
+  ```
+  # ~/Development/code/apache/nifi-minifi-cpp on git:master
+  $ ./bootstrap.sh
+  # CMAKE Build dir exists, should we overwrite your build directory before we 
begin?
+If you have already bootstrapped, bootstrapping again isn't necessary to 
run make [ Y/N ] Y
+  $  
+ Select MiNiFi C++ Features to toggle.
+
+A. Persistent Repositories .Enabled
+B. Lib Curl Features ...Enabled
+C. Lib Archive Features Enabled
+D. Execute Script support ..Enabled
+E. Expression Langauge support .Enabled
+F. Kafka support ...Disabled
+G. PCAP support Disabled
+H. USB Camera support ..Disabled
+I. GPS support .Disabled
+J. TensorFlow Support ..Disabled
+

[2/2] nifi-minifi-cpp git commit: MINIFICPP-269 Implement ApplyTemplate processor

2017-12-13 Thread phrocker
MINIFICPP-269 Implement ApplyTemplate processor

Move ENABLE_BUSTACHE to travis root env

This closes #157.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/d4f0bcfd
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/d4f0bcfd
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/d4f0bcfd

Branch: refs/heads/master
Commit: d4f0bcfd3cdbf469589bbce41fe5664873fcfa9d
Parents: 342cee0
Author: Caleb Johnson 
Authored: Tue Oct 17 19:13:32 2017 +
Committer: Marc Parisi 
Committed: Wed Dec 13 14:44:48 2017 -0500

--
 .travis.yml |   3 +-
 CMakeLists.txt  |   6 +
 LICENSE |  26 +
 extensions/bustache/ApplyTemplate.cpp   | 100 +++
 extensions/bustache/ApplyTemplate.h |  88 +++
 extensions/bustache/CMakeLists.txt  |  62 ++
 extensions/bustache/TemplateLoader.cpp  |  28 +
 extensions/bustache/TemplateLoader.h|  66 ++
 .../test/bustache-tests/ApplyTemplateTests.cpp  | 132 
 libminifi/test/bustache-tests/CMakeLists.txt|  42 ++
 thirdparty/bustache/CMakeLists.txt  |  64 ++
 thirdparty/bustache/README.md   | 267 +++
 thirdparty/bustache/cmake/FindCatch.cmake   |  13 +
 .../bustache/cmake/Modules/FindCatch.cmake  |  14 +
 thirdparty/bustache/doc/benchmark.png   |   0
 thirdparty/bustache/example/in.mustache |  39 +
 thirdparty/bustache/example/main.cpp|  82 +++
 thirdparty/bustache/include/bustache/ast.hpp|  86 +++
 thirdparty/bustache/include/bustache/debug.hpp  |  92 +++
 .../include/bustache/detail/any_context.hpp |  55 ++
 .../include/bustache/detail/variant.hpp | 362 ++
 thirdparty/bustache/include/bustache/format.hpp | 158 
 .../bustache/include/bustache/generate.hpp  | 430 +++
 .../include/bustache/generate/ostream.hpp   |  60 ++
 .../include/bustache/generate/string.hpp| 108 +++
 thirdparty/bustache/include/bustache/model.hpp  | 165 +
 thirdparty/bustache/src/format.cpp  | 484 +
 thirdparty/bustache/src/generate.cpp|  77 ++
 thirdparty/bustache/test/CMakeLists.txt |  22 +
 thirdparty/bustache/test/benchmark.cpp  | 238 +++
 thirdparty/bustache/test/specs.cpp  | 714 +++
 thirdparty/bustache/test/variant.cpp| 233 ++
 32 files changed, 4315 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d4f0bcfd/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index 219d973..fc45af9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,7 +21,8 @@ cache:
   timeout: 300
 
 env:
-   CMAKE_BUILD_OPTIONS="-DENABLE_PCAP=TRUE"
+   global:
+  CMAKE_BUILD_OPTIONS="-DENABLE_PCAP=TRUE"
 
 matrix:
 include:

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d4f0bcfd/CMakeLists.txt
--
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 175b945..5ce20bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -193,6 +193,12 @@ if (ENABLE_TENSORFLOW)
 createExtension(TENSORFLOW-EXTENSIONS "TENSORFLOW EXTENSIONS" "This 
enables TensorFlow support" "extensions/tensorflow" 
"${TEST_DIR}/tensorflow-tests")
 endif()
 
+## Bustache/template extensions
+option(ENABLE_BUSTACHE "Enables Bustache (ApplyTemplate) support." OFF)
+if (ENABLE_BUSTACHE)
+createExtension(BUSTACHE-EXTENSIONS "BUSTACHE EXTENSIONS" "This enables 
bustache functionality including ApplyTemplate." "extensions/bustache" 
"${TEST_DIR}/bustache-tests" "TRUE" "thirdparty/bustache")
+endif()
+
 ## NOW WE CAN ADD LIBRARIES AND EXTENSIONS TO MAIN
 
 add_subdirectory(main)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d4f0bcfd/LICENSE
--
diff --git a/LICENSE b/LICENSE
index b90200c..b4a2c77 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1011,3 +1011,29 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 
+This product bundles 'bustache' which is available under a Boost Software 
License.
+Bustache Copyright (c) 2014-2017 Jamboree
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, 

[1/2] nifi-minifi-cpp git commit: MINIFICPP-269 Implement ApplyTemplate processor

2017-12-13 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 342cee09a -> d4f0bcfd3


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d4f0bcfd/thirdparty/bustache/include/bustache/generate/ostream.hpp
--
diff --git a/thirdparty/bustache/include/bustache/generate/ostream.hpp 
b/thirdparty/bustache/include/bustache/generate/ostream.hpp
new file mode 100644
index 000..8f1a83e
--- /dev/null
+++ b/thirdparty/bustache/include/bustache/generate/ostream.hpp
@@ -0,0 +1,60 @@
+/*//
+Copyright (c) 2016 Jamboree
+
+Distributed under the Boost Software License, Version 1.0. (See 
accompanying
+file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//*/
+#ifndef BUSTACHE_GENERATE_OSTREAM_HPP_INCLUDED
+#define BUSTACHE_GENERATE_OSTREAM_HPP_INCLUDED
+
+#include 
+#include 
+
+namespace bustache { namespace detail
+{
+template
+struct ostream_sink
+{
+std::basic_ostream& out;
+
+void operator()(char const* it, char const* end) const
+{
+out.write(it, end - it);
+}
+
+template
+void operator()(T data) const
+{
+out << data;
+}
+
+void operator()(bool data) const
+{
+out << (data ? "true" : "false");
+}
+};
+}}
+
+namespace bustache
+{
+template
+void generate_ostream
+(
+std::basic_ostream& out, format const& fmt,
+value::view const& data, Context const& context, option_type flag
+)
+{
+detail::ostream_sink sink{out};
+generate(sink, fmt, data, context, flag);
+}
+
+// This is instantiated in src/generate.cpp.
+extern template
+void generate_ostream
+(
+std::ostream& out, format const& fmt,
+value::view const& data, detail::any_context const& context, 
option_type flag
+);
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/d4f0bcfd/thirdparty/bustache/include/bustache/generate/string.hpp
--
diff --git a/thirdparty/bustache/include/bustache/generate/string.hpp 
b/thirdparty/bustache/include/bustache/generate/string.hpp
new file mode 100644
index 000..cd1ddb4
--- /dev/null
+++ b/thirdparty/bustache/include/bustache/generate/string.hpp
@@ -0,0 +1,108 @@
+/*//
+Copyright (c) 2016 Jamboree
+
+Distributed under the Boost Software License, Version 1.0. (See 
accompanying
+file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//*/
+#ifndef BUSTACHE_GENERATE_STRING_HPP_INCLUDED
+#define BUSTACHE_GENERATE_STRING_HPP_INCLUDED
+
+#include  // for snprintf
+#include 
+#include 
+
+namespace bustache { namespace detail
+{
+template
+struct string_sink
+{
+String& out;
+
+void operator()(char const* it, char const* end) const
+{
+out.insert(out.end(), it, end);
+}
+
+void operator()(int data) const
+{
+append_num("%d", data);
+}
+
+void operator()(double data) const
+{
+append_num("%g", data);
+}
+
+void operator()(bool data) const
+{
+data ? append("true") : append("false");
+}
+
+template
+void append(char const ()[N]) const
+{
+out.insert(out.end(), str, str + (N - 1));
+}
+
+template
+void append_num(char const* fmt, T data) const
+{
+char buf[64];
+char* p;
+auto old_size = out.size();
+auto capacity = out.capacity();
+auto bufsize = capacity - old_size;
+if (bufsize)
+{
+out.resize(capacity);
+p = () + old_size;
+}
+else
+{
+bufsize = sizeof(buf);
+p = buf;
+}
+auto n = std::snprintf(p, bufsize, fmt, data);
+if (n < 0) // error
+return;
+if (unsigned(n + 1) <= bufsize)
+{
+if (p == buf)
+{
+out.insert(out.end(), p, p + n);
+return;
+}
+}
+else
+{
+out.resize(old_size + n + 1); // '\0' will be written
+std::snprintf(() + old_size, n + 1, fmt, data);
+}
+out.resize(old_size + n);
+}
+};
+}}
+
+namespace bustache
+{
+template

[39/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/resources/cert/client.crt
--
diff --git a/thirdparty/civetweb-1.10/resources/cert/client.crt 
b/thirdparty/civetweb-1.10/resources/cert/client.crt
new file mode 100644
index 000..f6bbdd8
--- /dev/null
+++ b/thirdparty/civetweb-1.10/resources/cert/client.crt
@@ -0,0 +1,19 @@
+-BEGIN CERTIFICATE-
+MIIDBjCCAe4CCQCFpskbTEyGpTANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJB
+VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
+cyBQdHkgTHRkMB4XDTE3MDkwMzE5MjIwNVoXDTI3MDkwMTE5MjIwNVowRTELMAkG
+A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0
+IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
+ANyFUuYxv/uexSr/K9aSmcnEcylNH4S3NdlvMwFvW3XFqAV05tV6HnPnSELEk6t3
+8aMDUGKDBrrjwsVK6+S7OyrkioXeB9dWldHbqD7o3MkIM3sUxUtaR6x0RMZ+sIX4
+XpE0xULcip1bG0etP4Z2frEP2IOOValQcm4SCnKYZJyTr/oR31NmlIPU/47s74U6
+rqwwUE92bzvf1jGeUHEn7IAgSJNIUBNsOIdRQAMBuTJIAmG2qawXaetjLi/NBwNS
+d0OX2v3o9SrA+ZhQYpPG5xp3B3ncHgVvmhmp7hUdlYbiemcUHn18hZjxPVZLbtY8
+gQldrWyMZkVabSZjuIH3IKcCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAUZsxxYVK
+l0tH8E0FCnRJTvG6gjOeiqJRIk7Mmg+hfFZK/ewqBixxg1OBM/xmPXfnI/ULRz74
+UMXnyDIsGakzrFDqWqPt3xots35yHHo2ZkVao6gV4qx0Reu86qeN5iRvG0EjoGMD
+7XRaw56E0XhvMBJW1CiUg944HSw4ptJli0dJCYa+P9s1Fop3lA0d9+dwKMKUyCDr
+yBz4XjyO9jXSQC/t0fkxC4gHhdH/ZaAq0Lem6Xxc40ZwoVc1+dHWFxn8d6L/RYvb
+16gOuw6s2Xt9h2K8OFKzehOgNZAkI2oUELRFUx9Wc8/Bcl6uEkBmPHRqeX5l35jo
+ztBrpAEsCy0cGg==
+-END CERTIFICATE-

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/resources/cert/client.csr
--
diff --git a/thirdparty/civetweb-1.10/resources/cert/client.csr 
b/thirdparty/civetweb-1.10/resources/cert/client.csr
new file mode 100644
index 000..beb8466
--- /dev/null
+++ b/thirdparty/civetweb-1.10/resources/cert/client.csr
@@ -0,0 +1,16 @@
+-BEGIN CERTIFICATE REQUEST-
+MIICijCCAXICAQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx
+ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcN
+AQEBBQADggEPADCCAQoCggEBANyFUuYxv/uexSr/K9aSmcnEcylNH4S3NdlvMwFv
+W3XFqAV05tV6HnPnSELEk6t38aMDUGKDBrrjwsVK6+S7OyrkioXeB9dWldHbqD7o
+3MkIM3sUxUtaR6x0RMZ+sIX4XpE0xULcip1bG0etP4Z2frEP2IOOValQcm4SCnKY
+ZJyTr/oR31NmlIPU/47s74U6rqwwUE92bzvf1jGeUHEn7IAgSJNIUBNsOIdRQAMB
+uTJIAmG2qawXaetjLi/NBwNSd0OX2v3o9SrA+ZhQYpPG5xp3B3ncHgVvmhmp7hUd
+lYbiemcUHn18hZjxPVZLbtY8gQldrWyMZkVabSZjuIH3IKcCAwEAAaAAMA0GCSqG
+SIb3DQEBCwUAA4IBAQB/bapQm4nxXA01msL6nkjiVaeh/mj8Cr8sPFtQXVu+hxl9
+mjbisxDXwPhiFOiTlokQkINf+RMxQsVNr2y/sGZrSMimabwODDXnPpyir4b2WOWp
+VQQWbgnMVnvgKsjBpLLDr8VnLBiQ3mED+2QV0bxxJSgvvEuiZx/BlCgiu77D/8kj
+XUY/CXIBi00fIYigpRRdv2WtMQjtQe2fCSZZKOWu2ZWu2o24kEk28x5LO/WaJ4Ft
+lUHFOIp/wkKz/US4mbdQaD0bsg7MirAyGrCmZIHqQDhdDWq+o/brI7N/8yOk3qwc
+qPGkr9PYIPnuzZwStLJlPxKGXjCA40HpdmWA0kyc
+-END CERTIFICATE REQUEST-

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/resources/cert/client.key
--
diff --git a/thirdparty/civetweb-1.10/resources/cert/client.key 
b/thirdparty/civetweb-1.10/resources/cert/client.key
new file mode 100644
index 000..f041acc
--- /dev/null
+++ b/thirdparty/civetweb-1.10/resources/cert/client.key
@@ -0,0 +1,27 @@
+-BEGIN RSA PRIVATE KEY-
+MIIEpAIBAAKCAQEA3IVS5jG/+57FKv8r1pKZycRzKU0fhLc12W8zAW9bdcWoBXTm
+1Xoec+dIQsSTq3fxowNQYoMGuuPCxUrr5Ls7KuSKhd4H11aV0duoPujcyQgzexTF
+S1pHrHRExn6whfhekTTFQtyKnVsbR60/hnZ+sQ/Yg45VqVBybhIKcphknJOv+hHf
+U2aUg9T/juzvhTqurDBQT3ZvO9/WMZ5QcSfsgCBIk0hQE2w4h1FAAwG5MkgCYbap
+rBdp62MuL80HA1J3Q5fa/ej1KsD5mFBik8bnGncHedweBW+aGanuFR2VhuJ6ZxQe
+fXyFmPE9Vktu1jyBCV2tbIxmRVptJmO4gfcgpwIDAQABAoIBAEpiBlZzTYi4Q1V/
+gO/9vzYZt6akxw7jJZzUL2Y6g6U0KLq+deZoLMF3sB4lZJIgATe1NHYmMCz2Coq1
+/N/Ib+rF8Bu7ivWN1TdWWmft8Bs3UvYfSXVjXG3FQjWaIjzuTCe6nxcwgOkXBBqn
+S5g1fAKJj8TATBCyfAa4uyFwWe+eGRs0W9pOMP8eU0EtvTer34rSU4L/LG3d7UcI
+upm/0T5QeLqv6Htv8UbHNQto701vJQVdWLavALMXGfGO112yTSz7OpitKpBEYDrV
+3+781zYm8AKkFIsRMXVK2HiBEF43zIrnNuoozsKpps/tZdlv9VqCSJ4hIaHm9mxJ
+3zMN3OECgYEA8dr5w68jTLrthDZ2qOG/6tZw9fMfXoF7hSUXplgxMN5Sohfr23Xm
+/IHVm7oiqhDNNZzplGyux7jB00x2/1ltOzay5mx4PMMLlsDBgiURgUwqS8C8dPVh
+0sN2RytdKGDmFP6lnKS7c15CEw1ChvdL4RwtqzjTKE0ZOK3zUY5/MykCgYEA6Wru
+Dusip4p4PA1K6eiCoC6SaqCuQCB7ZR5WPR5szAFkgoW63rNtC8S4Bl1qXXUb/v/V
+ptaVsGrqBc8/CxvCac1KCREbcyjuVWUAfw2VwdwgDbfrEieWrZNvsDs86EgB+Bo4
+Jm/cUjrFqSTJAbtvp4SYl1reax86XmCsHhNNf08CgYEApAhxd9/0IBlz+ET8K8SY
+5sy0ZouTjgRh40bqCF8uVcej4d45kGoh1Ma2Ot1+nzuwApm+7nTcAgd0JjxpRPzB
+EfUiVxfgYM2ksYVgeUVs3vXqheBdsTGwPENnmBN4Jme6BSlE573uiOu4ArXulh1p
+sG7tJoDu7hmEbqXELl9oNCkCgYEA51zWGnN3JhpakyuZ1cBhueRvvMEH9wg7Rz+K
+u4oszQmUVsu3Locqzz9uKODvTTOHTHrJi1WnifZvgNKr6pbZXYXenJ4YV01676nt
+lAIjLsTCANcMajJTaDl7u3L8LEEzsnhKr86w09Dtm3qawtzHD4Seu2eWjxelA2dP
+M4BukIECgYAn5n+HhCi5JD3I1VCX70uE5nj8alYyQ85qE57Lopmau1RyVfP4oeCt

[31/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/config/genconfig.py
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/config/genconfig.py 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/config/genconfig.py
new file mode 100644
index 000..9c99648
--- /dev/null
+++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/config/genconfig.py
@@ -0,0 +1,1537 @@
+#!/usr/bin/env python2
+#
+#  Process Duktape option metadata and produce various useful outputs:
+#
+#- duk_config.h with specific or autodetected platform, compiler, and
+#  architecture; forced options; sanity checks; etc
+#- option documentation for Duktape 1.x feature options (DUK_OPT_xxx)
+#- option documentation for Duktape 1.x/2.x config options (DUK_USE_xxx)
+#
+#  Genconfig tries to build all outputs based on modular metadata, so that
+#  managing a large number of config options (which is hard to avoid given
+#  the wide range of targets Duktape supports) remains maintainable.
+#
+#  Genconfig does *not* try to support all exotic platforms out there.
+#  Instead, the goal is to allow the metadata to be extended, or to provide
+#  a reasonable starting point for manual duk_config.h tweaking.
+#
+#  For Duktape 1.3 release the main goal was to autogenerate a Duktape 1.2
+#  compatible "autodetect" header from legacy snippets, with other outputs
+#  being experimental.  For Duktape 1.4 duk_config.h is always created from
+#  modular sources.
+#
+
+import os
+import sys
+import re
+import json
+import yaml
+import optparse
+import tarfile
+import tempfile
+import atexit
+import shutil
+try:
+   from StringIO import StringIO
+except ImportError:
+   from io import StringIO
+
+#
+#  Globals holding scanned metadata, helper snippets, etc
+#
+
+# Metadata to scan from config files.
+use_defs = None
+use_defs_list = None
+opt_defs = None
+opt_defs_list = None
+use_tags = None
+use_tags_list = None
+tags_meta = None
+required_use_meta_keys = [
+   'define',
+   'introduced',
+   'default',
+   'tags',
+   'description'
+]
+allowed_use_meta_keys = [
+   'define',
+   'feature_enables',
+   'feature_disables',
+   'feature_snippet',
+   'feature_no_default',
+   'related_feature_defines',
+   'introduced',
+   'deprecated',
+   'removed',
+   'unused',
+   'requires',
+   'conflicts',
+   'related',
+   'default',
+   'tags',
+   'description',
+]
+required_opt_meta_keys = [
+   'define',
+   'introduced',
+   'tags',
+   'description'
+]
+allowed_opt_meta_keys = [
+   'define',
+   'introduced',
+   'deprecated',
+   'removed',
+   'unused',
+   'requires',
+   'conflicts',
+   'related',
+   'tags',
+   'description'
+]
+
+# Preferred tag order for option documentation.
+doc_tag_order = [
+   'portability',
+   'memory',
+   'lowmemory',
+   'ecmascript',
+   'execution',
+   'debugger',
+   'debug',
+   'development'
+]
+
+# Preferred tag order for generated C header files.
+header_tag_order = doc_tag_order
+
+# Helper headers snippets.
+helper_snippets = None
+
+# Assume these provides come from outside.
+assumed_provides = {
+   'DUK_SINGLE_FILE': True, # compiling Duktape from a single 
source file (duktape.c) version
+   'DUK_COMPILING_DUKTAPE': True,   # compiling Duktape (not user 
application)
+   'DUK_CONFIG_H_INCLUDED': True,   # artifact, include guard
+}
+
+# Platform files must provide at least these (additional checks
+# in validate_platform_file()).  Fill-ins provide missing optionals.
+platform_required_provides = [
+   'DUK_USE_OS_STRING'  # must be #define'd
+]
+
+# Architecture files must provide at least these (additional checks
+# in validate_architecture_file()).  Fill-ins provide missing optionals.
+architecture_required_provides = [
+   'DUK_USE_ARCH_STRING'
+]
+
+# Compiler files must provide at least these (additional checks
+# in validate_compiler_file()).  Fill-ins provide missing optionals.
+compiler_required_provides = [
+   # Compilers need a lot of defines; missing defines are automatically
+   # filled in with defaults (which are mostly compiler independent), so
+   # the requires define list is not very large.
+
+   'DUK_USE_COMPILER_STRING',# must be #define'd
+   'DUK_USE_BRANCH_HINTS',   # may be #undef'd, as long as provided
+   'DUK_USE_VARIADIC_MACROS',# may be #undef'd, as long as provided
+   'DUK_USE_UNION_INITIALIZERS'  # may be #undef'd, as long as provided
+]
+
+#
+#  Miscellaneous helpers
+#
+
+def get_auto_delete_tempdir():
+   tmpdir = tempfile.mkdtemp(suffix='-genconfig')
+   def _f(dirname):
+   #print('Deleting temporary directory: %r' % 

[45/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/docs/api/mg_check_feature.md
--
diff --git a/thirdparty/civetweb-1.10/docs/api/mg_check_feature.md 
b/thirdparty/civetweb-1.10/docs/api/mg_check_feature.md
new file mode 100644
index 000..1da1b07
--- /dev/null
+++ b/thirdparty/civetweb-1.10/docs/api/mg_check_feature.md
@@ -0,0 +1,40 @@
+# Civetweb API Reference
+
+### `mg_check_feature( feature );`
+
+### Parameters
+
+| Parameter | Type | Description |
+| :--- | :--- | :--- |
+|**`feature`**|`unsigned`| A value indicating the feature to be checked |
+
+### Return Value
+
+| Type | Description |
+| :--- | :--- |
+|`unsigned`| A value indicating if a feature is available. A positive value 
indicates available, while **0** is returned for an unavailable feature |
+
+### Description
+
+The function `mg_check_feature()` can be called from an application program to 
check of specific features have been compiled in the civetweb version which the 
application has been linked to. The feature to check is provided as an unsigned 
integer parameter. If the function is available in the currently linked library 
version, a value **> 0** is returned. Otherwise the function 
`mg_check_feature()` returns the value **0**.
+
+The following parameter values can be used:
+
+| Value | Compilation option | Description |
+| :---: | :---: | :--- |
+| **1** | NO_FILES | *Able to serve files*.  If this feature is available, the 
webserver is able to serve files directly from a directory tree. |
+| **2** | NO_SSL | *Support for HTTPS*. If this feature is available, the 
webserver van use encryption in the client-server connection. SSLv2, SSLv3, 
TLSv1.0, TLSv1.1 and TLSv1.2 are supported depending on the SSL library 
CivetWeb has been compiled with, but which protocols are used effectively when 
the server is running is dependent on the options used when the server is 
started. |
+| **4** | NO_CGI | *Support for CGI*. If this feature is available, external 
CGI scripts can be called by the webserver. |
+| **8** | USE_IPV6 | *Support IPv6*. The CivetWeb library is capable of 
communicating over both IPv4 and IPv6, but IPv6 support is only available if it 
has been enabled at compile time. |
+| **16** | USE_WEBSOCKET | Support for web sockets. WebSockets support is 
available in the CivetWeb library if the proper options has been used during 
cimpile time. |
+| **32** | USE_LUA | *Support for Lua scripts and Lua server pages*. CivetWeb 
supports server side scripting through the Lua language, if that has been 
enabled at compile time. Lua is an efficient scripting language which is less 
resource heavy than for example PHP. |
+| **64** | USE_DUKTAPE | *Support for server side JavaScript*. Server side 
JavaScript can be used for dynamic page generation if the proper options have 
been set at compile time. Please note that client side JavaScript execution is 
always available if it has been enabled in the connecting browser. |
+| **128** | NO_CACHING | *Support for caching*. The webserver will support 
caching, if it has not been disabled while compiling the library. |
+
+Parameter values other than the values mentioned above will give undefined 
results. Thereforealthough the parameter values for the 
`mg_check_feature()` function are effectively bitmasks, you should't assume 
that combining two of those values with an OR to a new value will give any 
meaningful results when the function returns.
+
+### See Also
+
+* [`mg_get_option();`](mg_get_option.md)
+* [~~`mg_get_valid_option_names();`~~](mg_get_valid_option_names.md)
+* [`mg_get_valid_options();`](mg_get_valid_options.md)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/docs/api/mg_client_cert.md
--
diff --git a/thirdparty/civetweb-1.10/docs/api/mg_client_cert.md 
b/thirdparty/civetweb-1.10/docs/api/mg_client_cert.md
new file mode 100644
index 000..c81fbd0
--- /dev/null
+++ b/thirdparty/civetweb-1.10/docs/api/mg_client_cert.md
@@ -0,0 +1,21 @@
+# Civetweb API Reference
+
+### `struct mg_client_cert;`
+
+### Fields
+
+| Field | Type | Description |
+| :--- | :--- | :--- |
+|**`subject`**|`const char *`| The subject of the certificate |
+|**`issuer`**|`const char *`| The issuer of the certificate |
+|**`serial`**|`const char *`| The serial number of the certificate |
+|**`finger`**|`const char *`| The fingerprint of the certificate |
+
+### Description
+
+The structure `client_cert` is used as a sub-structure in the 
[`mg_request_info`](mg_request_info.md) structure to store information of an 
optional client supplied certificate.
+
+### See Also
+
+* [`struct mg_request_info;`](mg_request_info.md)
+* [`mg_get_request_info();`](mg_get_request_info.md)


[16/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_api_stack.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_api_stack.c
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_api_stack.c
new file mode 100644
index 000..6e8ff3e
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_api_stack.c
@@ -0,0 +1,4658 @@
+/*
+ *  API calls related to general value stack manipulation: resizing the value
+ *  stack, pushing and popping values, type checking and reading values,
+ *  coercing values, etc.
+ *
+ *  Also contains internal functions (such as duk_get_tval()), defined
+ *  in duk_api_internal.h, with semantics similar to the public API.
+ */
+
+/* XXX: repetition of stack pre-checks -> helper or macro or inline */
+/* XXX: shared api error strings, and perhaps even throw code for rare cases? 
*/
+
+#include "duk_internal.h"
+
+/*
+ *  Forward declarations
+ */
+
+DUK_LOCAL_DECL duk_idx_t duk__push_c_function_raw(duk_context *ctx, 
duk_c_function func, duk_idx_t nargs, duk_uint_t flags);
+
+/*
+ *  Global state for working around missing variadic macros
+ */
+
+#ifndef DUK_USE_VARIADIC_MACROS
+DUK_EXTERNAL const char *duk_api_global_filename = NULL;
+DUK_EXTERNAL duk_int_t duk_api_global_line = 0;
+#endif
+
+/*
+ *  Misc helpers
+ */
+
+/* Check that there's room to push one value. */
+#if defined(DUK_USE_VALSTACK_UNSAFE)
+/* Faster but value stack overruns are memory unsafe. */
+#define DUK__CHECK_SPACE() do { \
+   DUK_ASSERT(!(thr->valstack_top >= thr->valstack_end)); \
+   } while (0)
+#else
+#define DUK__CHECK_SPACE() do { \
+   if (DUK_UNLIKELY(thr->valstack_top >= thr->valstack_end)) { \
+   DUK_ERROR_API(thr, DUK_STR_PUSH_BEYOND_ALLOC_STACK); \
+   } \
+   } while (0)
+#endif
+
+DUK_LOCAL_DECL duk_heaphdr *duk__get_tagged_heaphdr_raw(duk_context *ctx, 
duk_idx_t index, duk_uint_t tag);
+
+DUK_LOCAL duk_int_t duk__api_coerce_d2i(duk_context *ctx, duk_idx_t index, 
duk_bool_t require) {
+   duk_hthread *thr;
+   duk_tval *tv;
+   duk_small_int_t c;
+   duk_double_t d;
+
+   thr = (duk_hthread *) ctx;
+
+   tv = duk_get_tval(ctx, index);
+   if (tv == NULL) {
+   goto error_notnumber;
+   }
+
+   /*
+*  Special cases like NaN and +/- Infinity are handled explicitly
+*  because a plain C coercion from double to int handles these cases
+*  in undesirable ways.  For instance, NaN may coerce to INT_MIN
+*  (not zero), and INT_MAX + 1 may coerce to INT_MIN (not INT_MAX).
+*
+*  This double-to-int coercion differs from ToInteger() because it
+*  has a finite range (ToInteger() allows e.g. +/- Infinity).  It
+*  also differs from ToInt32() because the INT_MIN/INT_MAX clamping
+*  depends on the size of the int type on the platform.  In particular,
+*  on platforms with a 64-bit int type, the full range is allowed.
+*/
+
+#if defined(DUK_USE_FASTINT)
+   if (DUK_TVAL_IS_FASTINT(tv)) {
+   duk_int64_t t = DUK_TVAL_GET_FASTINT(tv);
+#if (DUK_INT_MAX <= 0x7fffL)
+   /* Clamping only necessary for 32-bit ints. */
+   if (t < DUK_INT_MIN) {
+   t = DUK_INT_MIN;
+   } else if (t > DUK_INT_MAX) {
+   t = DUK_INT_MAX;
+   }
+#endif
+   return (duk_int_t) t;
+   }
+#endif
+
+   if (DUK_TVAL_IS_NUMBER(tv)) {
+   d = DUK_TVAL_GET_NUMBER(tv);
+   c = (duk_small_int_t) DUK_FPCLASSIFY(d);
+   if (c == DUK_FP_NAN) {
+   return 0;
+   } else if (d < (duk_double_t) DUK_INT_MIN) {
+   /* covers -Infinity */
+   return DUK_INT_MIN;
+   } else if (d > (duk_double_t) DUK_INT_MAX) {
+   /* covers +Infinity */
+   return DUK_INT_MAX;
+   } else {
+   /* coerce towards zero */
+   return (duk_int_t) d;
+   }
+   }
+
+ error_notnumber:
+
+   if (require) {
+   DUK_ERROR_REQUIRE_TYPE_INDEX(thr, index, "number", 
DUK_STR_NOT_NUMBER);
+   /* not reachable */
+   }
+   return 0;
+}
+
+DUK_LOCAL duk_uint_t duk__api_coerce_d2ui(duk_context *ctx, duk_idx_t index, 
duk_bool_t require) {
+   duk_hthread *thr;
+   duk_tval *tv;
+   duk_small_int_t c;
+   duk_double_t d;
+
+   /* Same as above but for unsigned int range. */
+
+   thr = (duk_hthread *) ctx;
+
+   tv = duk_get_tval(ctx, index);
+   if (tv == NULL) {
+   goto error_notnumber;
+   }
+
+#if 

[24/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/extras/README.rst
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/extras/README.rst 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/extras/README.rst
new file mode 100644
index 000..1b70160
--- /dev/null
+++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/extras/README.rst
@@ -0,0 +1,13 @@
+==
+Duktape extras
+==
+
+Extra modules and utilities.  Extras provide functionality that doesn't
+comfortably fit into the main Duktape library, perhaps for footprint or
+portability reasons, but are still useful for most users.
+
+Extras are maintained and will be bug fixed.  However, they don't have the
+same semantic versioning guarantees like the main Duktape library.  Extras
+may be dropped without warning as Duktape is versioned.  For instance, if
+an extra breaks due to Duktape changes and there is no time to fix it, the
+missing extra won't block a release and will be dropped.



[02/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_hbuffer_alloc.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_hbuffer_alloc.c
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_hbuffer_alloc.c
new file mode 100644
index 000..425ad33
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_hbuffer_alloc.c
@@ -0,0 +1,132 @@
+/*
+ *  duk_hbuffer allocation and freeing.
+ */
+
+#include "duk_internal.h"
+
+/* Allocate a new duk_hbuffer of a certain type and return a pointer to it
+ * (NULL on error).  Write buffer data pointer to 'out_bufdata' (only if
+ * allocation successful).
+ */
+DUK_INTERNAL duk_hbuffer *duk_hbuffer_alloc(duk_heap *heap, duk_size_t size, 
duk_small_uint_t flags, void **out_bufdata) {
+   duk_hbuffer *res = NULL;
+   duk_size_t header_size;
+   duk_size_t alloc_size;
+
+   DUK_ASSERT(heap != NULL);
+   DUK_ASSERT(out_bufdata != NULL);
+
+   DUK_DDD(DUK_DDDPRINT("allocate hbuffer"));
+
+   /* Size sanity check.  Should not be necessary because caller is
+* required to check this, but we don't want to cause a segfault
+* if the size wraps either in duk_size_t computation or when
+* storing the size in a 16-bit field.
+*/
+   if (size > DUK_HBUFFER_MAX_BYTELEN) {
+   DUK_D(DUK_DPRINT("hbuffer alloc failed: size too large: %ld", 
(long) size));
+   return NULL;  /* no need to write 'out_bufdata' */
+   }
+
+   if (flags & DUK_BUF_FLAG_EXTERNAL) {
+   header_size = sizeof(duk_hbuffer_external);
+   alloc_size = sizeof(duk_hbuffer_external);
+   } else if (flags & DUK_BUF_FLAG_DYNAMIC) {
+   header_size = sizeof(duk_hbuffer_dynamic);
+   alloc_size = sizeof(duk_hbuffer_dynamic);
+   } else {
+   header_size = sizeof(duk_hbuffer_fixed);
+   alloc_size = sizeof(duk_hbuffer_fixed) + size;
+   DUK_ASSERT(alloc_size >= sizeof(duk_hbuffer_fixed));  /* no 
wrapping */
+   }
+
+   res = (duk_hbuffer *) DUK_ALLOC(heap, alloc_size);
+   if (!res) {
+   goto error;
+   }
+
+   /* zero everything unless requested not to do so */
+#if defined(DUK_USE_ZERO_BUFFER_DATA)
+   DUK_MEMZERO((void *) res,
+   (flags & DUK_BUF_FLAG_NOZERO) ? header_size : alloc_size);
+#else
+   DUK_MEMZERO((void *) res, header_size);
+#endif
+
+   if (flags & DUK_BUF_FLAG_EXTERNAL) {
+   duk_hbuffer_external *h;
+   h = (duk_hbuffer_external *) res;
+   DUK_UNREF(h);
+   *out_bufdata = NULL;
+#if defined(DUK_USE_EXPLICIT_NULL_INIT)
+#if defined(DUK_USE_HEAPPTR16)
+/* the compressed pointer is zeroed which maps to NULL, so nothing to do. */
+#else
+   DUK_HBUFFER_EXTERNAL_SET_DATA_PTR(heap, h, NULL);
+#endif
+#endif
+   DUK_ASSERT(DUK_HBUFFER_EXTERNAL_GET_DATA_PTR(heap, h) == NULL);
+   } else if (flags & DUK_BUF_FLAG_DYNAMIC) {
+   duk_hbuffer_dynamic *h = (duk_hbuffer_dynamic *) res;
+   void *ptr;
+
+   if (size > 0) {
+   DUK_ASSERT(!(flags & DUK_BUF_FLAG_EXTERNAL));  /* alloc 
external with size zero */
+   DUK_DDD(DUK_DDDPRINT("dynamic buffer with nonzero size, 
alloc actual buffer"));
+#ifdef DUK_USE_ZERO_BUFFER_DATA
+   ptr = DUK_ALLOC_ZEROED(heap, size);
+#else
+   ptr = DUK_ALLOC(heap, size);
+#endif
+   if (!ptr) {
+   /* Because size > 0, NULL check is correct */
+   goto error;
+   }
+   *out_bufdata = ptr;
+
+   DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(heap, h, ptr);
+   } else {
+   *out_bufdata = NULL;
+#if defined(DUK_USE_EXPLICIT_NULL_INIT)
+#if defined(DUK_USE_HEAPPTR16)
+/* the compressed pointer is zeroed which maps to NULL, so nothing to do. */
+#else
+   DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(heap, h, NULL);
+#endif
+#endif
+   DUK_ASSERT(DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(heap, h) == 
NULL);
+   }
+   } else {
+   *out_bufdata = (void *) ((duk_hbuffer_fixed *) res + 1);
+   }
+
+   DUK_HBUFFER_SET_SIZE(res, size);
+
+   DUK_HEAPHDR_SET_TYPE(>hdr, DUK_HTYPE_BUFFER);
+   if (flags & DUK_BUF_FLAG_DYNAMIC) {
+   DUK_HBUFFER_SET_DYNAMIC(res);
+   if (flags & DUK_BUF_FLAG_EXTERNAL) {
+   DUK_HBUFFER_SET_EXTERNAL(res);
+   }
+   } else {
+   DUK_ASSERT(!(flags & DUK_BUF_FLAG_EXTERNAL));
+   }
+

[42/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/examples/_obsolete/upload/upload.c
--
diff --git a/thirdparty/civetweb-1.10/examples/_obsolete/upload/upload.c 
b/thirdparty/civetweb-1.10/examples/_obsolete/upload/upload.c
new file mode 100644
index 000..56c4be4
--- /dev/null
+++ b/thirdparty/civetweb-1.10/examples/_obsolete/upload/upload.c
@@ -0,0 +1,110 @@
+/* Copyright (c) 2014 the Civetweb developers
+ * Copyright (c) 2004-2012 Sergey Lyubka
+ * This file is a part of civetweb project, http://github.com/bel2125/civetweb
+ */
+
+/* This example is deprecated and no longer maintained.
+ * All relevant parts have been merged into the embedded_c example. */
+
+
+#ifdef _WIN32
+#ifndef _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_WARNINGS
+#endif
+#include 
+#include 
+#define strtoll strtol
+typedef __int64 int64_t;
+#else
+#include 
+#include 
+#endif /* !_WIN32 */
+
+#include 
+#include 
+#include 
+#include 
+
+#include "civetweb.h"
+
+
+/* callback: used to generate all content */
+static int begin_request_handler(struct mg_connection *conn)
+{
+const char * tempPath = ".";
+#ifdef _WIN32
+const char * env = getenv("TEMP");
+if (!env) env = getenv("TMP");
+if (env) tempPath = env;
+#else
+tempPath = "/tmp";
+#endif
+
+if (!strcmp(mg_get_request_info(conn)->uri, "/handle_post_request")) {
+
+mg_printf(conn, "%s", "HTTP/1.0 200 OK\r\n\r\n");
+mg_upload(conn, tempPath);
+} else {
+/* Show HTML form. */
+/* See http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1 */
+static const char *html_form =
+"Upload example."
+""
+/* enctype="multipart/form-data" */
+""
+" "
+" "
+""
+""
+""
+"";
+
+mg_printf(conn, "HTTP/1.0 200 OK\r\n"
+  "Content-Length: %d\r\n"
+  "Content-Type: text/html\r\n\r\n%s",
+  (int) strlen(html_form), html_form);
+}
+
+/* Mark request as processed */
+return 1;
+}
+
+
+/* callback: called after uploading a file is completed */
+static void upload_handler(struct mg_connection *conn, const char *path)
+{
+mg_printf(conn, "Saved [%s]", path);
+}
+
+
+/* Main program: Set callbacks and start the server.  */
+int main(void)
+{
+/* Test server will use this port */
+const char * PORT = "8080";
+
+/* Startup options for the server */
+struct mg_context *ctx;
+const char *options[] = {
+"listening_ports", PORT,
+NULL};
+struct mg_callbacks callbacks;
+
+memset(, 0, sizeof(callbacks));
+callbacks.begin_request = begin_request_handler;
+callbacks.upload = upload_handler;
+
+/* Display a welcome message */
+printf("File upload demo.\n");
+printf("Open http://localhost:%s/ in your browser.\n\n", PORT);
+
+/* Start the server */
+ctx = mg_start(, NULL, options);
+
+/* Wait until thr user hits "enter", then stop the server */
+getchar();
+mg_stop(ctx);
+
+return 0;
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/examples/_obsolete/websocket/WebSockCallbacks.c
--
diff --git 
a/thirdparty/civetweb-1.10/examples/_obsolete/websocket/WebSockCallbacks.c 
b/thirdparty/civetweb-1.10/examples/_obsolete/websocket/WebSockCallbacks.c
new file mode 100644
index 000..bb81fb0
--- /dev/null
+++ b/thirdparty/civetweb-1.10/examples/_obsolete/websocket/WebSockCallbacks.c
@@ -0,0 +1,225 @@
+/* This example uses deprecated interfaces: global websocket callbacks.
+   They have been superseeded by URI specific callbacks.
+   See examples/embedded_c for an up to date example.
+   */
+
+#include 
+#include 
+#include 
+#include 
+#include "WebSockCallbacks.h"
+
+#ifdef _WIN32
+#include 
+#define mg_sleep(x) Sleep(x)
+#else
+#include 
+#include 
+#define mg_sleep(x) usleep((x)*1000)
+#endif
+
+
+static void
+send_to_all_websockets(struct mg_context *ctx, const char *data, int data_len)
+{
+
+   int i;
+   tWebSockContext *ws_ctx = (tWebSockContext *)mg_get_user_data(ctx);
+
+   mg_lock_context(ctx);
+   for (i = 0; i < MAX_NUM_OF_WEBSOCKS; i++) {
+   if (ws_ctx->socketList[i]
+   && (ws_ctx->socketList[i]->webSockState == 2)) {
+   mg_websocket_write(ws_ctx->socketList[i]->conn,
+  WEBSOCKET_OPCODE_TEXT,
+  data,
+  data_len);
+   }
+   }
+   mg_unlock_context(ctx);
+}
+
+
+void
+websocket_ready_handler(struct mg_connection *conn, void *_ignored)
+{
+
+   int i;
+   const struct mg_request_info *rq = mg_get_request_info(conn);
+   

[28/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/debugger/static/style.css
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/debugger/static/style.css
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/debugger/static/style.css
new file mode 100644
index 000..a105947
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/debugger/static/style.css
@@ -0,0 +1,516 @@
+// 
http://stackoverflow.com/questions/71074/how-to-remove-firefoxs-dotted-outline-on-buttons-as-well-as-links/3844452#3844452
+:focus {
+   outline: none;
+}
+::-moz-focus-inner {
+   border: 0;
+}
+
+@keyframes pulsate {
+   from { opacity: 1; }
+   to { opacity: 0.25; }
+}
+
+#part-header {
+   background: #44;
+   color: #ff;
+   font: 24pt monospace;
+   border-bottom: 2px solid #cc;
+   padding: 20px 0px 20px 10px;
+}
+
+/* http://css-tricks.com/snippets/css/a-guide-to-flexbox/ */
+#part-middle {
+   display: flex;
+   flex-direction: row;
+   flex-wrap: nowrap;
+   justify-content: space-between;
+   align-items: stretch;
+   align-content: stretch;
+
+   min-height: 800px;
+
+   border-top: 1px solid #ff;
+   padding: 8px;
+   margin-top: 2px;
+}
+#left-area {
+   flex: 0 0 11em;
+   margin-right: 20px;
+   margin-bottom: 10px;
+}
+#center-area {
+   flex: 1 1 0;
+   margin-bottom: 10px;
+}
+#right-area {
+   flex: 0 0 40em;
+   margin-left: 20px;
+   margin-bottom: 10px;
+}
+
+#part-footer {
+   clear: both;
+   border-top: 2px solid #bb;
+   background: #ee;
+   color: #55;
+   text-align: center;
+   padding-top: 12px;
+   padding-bottom: 12px;
+   line-height: 1.5;
+}
+
+#exec-status {
+   margin-top: 25px;
+   margin-bottom: 25px;
+}
+#exec-state {
+   display: inline-block;
+   vertical-align: middle;
+}
+#exec-other {
+   display: inline-block;
+   vertical-align: middle;
+   font-size: 125%;
+}
+#current-state {
+   background: #228822;
+   color: #ff;
+   font: 16pt;
+   padding: 6pt;
+   border: 5px solid #228822;
+   border-radius: 10px;
+   font-size: 200%;
+   font-weight: bold;
+   margin-right: 10px;
+}
+#current-state.notrunning {
+   background: #88;
+   border: 5px solid #88;
+   border-radius: 10px;
+   animation: pulsate 0.7s cubic-bezier(0.75, 0, 0.75, 1) infinite 
alternate;
+}
+#exec-other:hover {
+   text-decoration: underline;
+   color: #ff;
+}
+
+#left-area button {
+   display: inline-block;
+   width: 100%;
+   min-width: 8em;
+   background: #226622;
+   color: #ff;
+   font: 16pt sans-serif;
+   font-weight: bold;
+   text-decoration: none;
+   margin: 10px 0 0 0;
+   padding: 0.4em;
+   border: 2px solid #00;
+   border-radius: 4px;
+}
+#left-area button a {
+   color: #ff;
+   text-decoration: none;
+}
+#left-area button:hover {
+   background: #55aa55;
+}
+#left-area button:disabled {
+   background: #55;
+   color: #88;
+}
+#left-area button:disabled a {
+   background: #55;
+   color: #88;
+}
+
+#pause-button.pending {
+   background: #ff;
+   animation: pulsate 0.2s cubic-bezier(0.75, 0, 0.75, 1) infinite 
alternate;
+}
+
+#attach-button {
+}
+#attach-button.enabled {
+   animation: pulsate 0.7s cubic-bezier(0.75, 0, 0.75, 1) infinite 
alternate;
+}
+
+.duktape-exec-line {
+   outline: 2px solid red;
+   background: #55;
+}
+.duktape-break-line {
+   outline: 2px solid white;
+}
+
+#output {
+   font: 9pt monospace;
+   color: #00;
+   border: 2px solid #cc;
+   border-radius: 5px;
+   padding: 3px;
+   height: 30ex;
+   overflow: scroll;
+   overflow-x: auto;
+   overflow-y: scroll;
+   white-space: pre;
+}
+#output .alert {
+   color: #ff;
+}
+/* Default color (should be overridden by level) */
+#output .log {
+   color: #00ff00;
+}
+/* Trace */
+#output .loglevel0 {
+   color: #cc;
+}
+/* Debug */
+#output .loglevel1 {
+   color: #cc;
+}
+/* Info */
+#output .loglevel2 {
+   color: #88;
+   font-weight: bold;
+}
+/* Warn */
+#output .loglevel3 {
+   color: #ff;
+   font-weight: bold;
+}
+/* Error */
+#output .loglevel4 {
+   color: #ff;
+   font-weight: bold;
+}
+/* Fatal */
+#output .loglevel5 {
+   background: #00;
+   color: #ff;
+   font-weight: bold;
+}
+#output .debugger-info {
+   color: #88;
+   font-weight: bold;
+   font-style: italic;
+}
+#output .debugger-debug {
+   color: #88;
+   font-weight: bold;
+   font-style: italic;
+}
+

[49/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/Qt/CivetWeb.pro
--
diff --git a/thirdparty/civetweb-1.10/Qt/CivetWeb.pro 
b/thirdparty/civetweb-1.10/Qt/CivetWeb.pro
new file mode 100644
index 000..6d5e1a2
--- /dev/null
+++ b/thirdparty/civetweb-1.10/Qt/CivetWeb.pro
@@ -0,0 +1,34 @@
+TEMPLATE = app
+CONFIG += console
+CONFIG -= app_bundle
+CONFIG -= qt
+
+SOURCES += \
+../src/md5.inl \
+../src/sha1.inl \
+../src/handle_form.inl \
+../src/mod_lua.inl \
+../src/mod_duktape.inl \
+../src/timer.inl \
+../src/civetweb.c \
+../src/main.c
+
+#include(deployment.pri)
+#qtcAddDeployment()
+
+HEADERS += \
+../include/civetweb.h
+
+INCLUDEPATH +=  \
+../include/
+
+win32 {
+LIBS += -lws2_32 -lComdlg32 -lUser32 -lShell32 -lAdvapi32
+} else {
+LIBS += -lpthread -ldl -lm
+}
+
+
+DEFINES += USE_IPV6
+DEFINES += USE_WEBSOCKET
+DEFINES += USE_SERVER_STATS

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/README.md
--
diff --git a/thirdparty/civetweb-1.10/README.md 
b/thirdparty/civetweb-1.10/README.md
new file mode 100644
index 000..4a334ca
--- /dev/null
+++ b/thirdparty/civetweb-1.10/README.md
@@ -0,0 +1,168 @@
+![CivetWeb](https://raw.githubusercontent.com/civetweb/civetweb/master/resources/civetweb_64x64.png
 "CivetWeb") CivetWeb
+===
+
+**The official home of CivetWeb is 
[https://github.com/civetweb/civetweb](https://github.com/civetweb/civetweb)**
+
+[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
+[![GitHub 
contributors](https://img.shields.io/github/contributors/civetweb/civetweb.svg)](https://github.com/civetweb/civetweb/blob/master/CREDITS.md)
+
+Continuous integration for Linux and OSX ([Travis 
CI](https://travis-ci.org/civetweb/civetweb)):
+
+[![Travis Build 
Status](https://travis-ci.org/civetweb/civetweb.svg?branch=master)](https://travis-ci.org/civetweb/civetweb)
+
+Continuous integration for Windows 
([AppVeyor](https://ci.appveyor.com/project/civetweb/civetweb)):
+
+[![Appveyor Build 
Status](https://ci.appveyor.com/api/projects/status/github/civetweb/civetweb?svg=true)](https://ci.appveyor.com/project/civetweb/civetweb/branch/master)
+
+Test coverage check 
([coveralls](https://coveralls.io/github/civetweb/civetweb), 
[codecov](https://codecov.io/gh/civetweb/civetweb/branch/master)) (currently in 
a setup and evaluation phase):
+
+[![Coveralls](https://img.shields.io/coveralls/civetweb/civetweb.svg?maxAge=3600)]()
+[![Coverage 
Status](https://coveralls.io/repos/github/civetweb/civetweb/badge.svg?branch=master)](https://coveralls.io/github/civetweb/civetweb?branch=master)
+
+[![codecov](https://codecov.io/gh/civetweb/civetweb/branch/master/graph/badge.svg)](https://codecov.io/gh/civetweb/civetweb)
+
+
+
+Static source code analysis 
([Coverity](https://scan.coverity.com/projects/5784)):
+
+[![Coverity Scan Build 
Status](https://scan.coverity.com/projects/5784/badge.svg)](https://scan.coverity.com/projects/5784)
+
+
+
+Project Mission
+-
+
+Project mission is to provide easy to use, powerful, C/C++ embeddable web
+server with optional CGI, SSL and Lua support.
+CivetWeb has a MIT license so you can innovate without restrictions.
+
+CivetWeb can be used by developers as a library, to add web server 
functionality to an existing application.
+It can also be used by end users as a stand-alone web server. It is available 
as single executable, no installation is required.
+
+
+Where to find the official version?
+---
+
+End users can download CivetWeb releases at SourceForge
+[https://sourceforge.net/projects/civetweb/](https://sourceforge.net/projects/civetweb/)
+
+Developers can contribute to CivetWeb via GitHub
+[https://github.com/civetweb/civetweb](https://github.com/civetweb/civetweb)
+
+Trouble tickets should be filed on GitHub
+[https://github.com/civetweb/civetweb/issues](https://github.com/civetweb/civetweb/issues)
+
+Announcements are at Google Groups
+[https://groups.google.com/d/forum/civetweb](https://groups.google.com/d/forum/civetweb).
 Some older support and discussion threads are there as well. However, recently 
support questions and discussions are usually [GitHub 
issues](https://github.com/civetweb/civetweb/issues).
+
+Source releases can be found on GitHub
+[https://github.com/civetweb/civetweb/releases](https://github.com/civetweb/civetweb/releases)
+
+A very brief overview can be found on GitHub Pages
+[http://civetweb.github.io/civetweb/](http://civetweb.github.io/civetweb/)
+
+
+Quick start documentation
+--
+
+- 
[docs/Installing.md](https://github.com/civetweb/civetweb/blob/master/docs/Installing.md)
 - Install Guide (for end users using pre-built binaries)
+- 

[05/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_debug.h
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_debug.h
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_debug.h
new file mode 100644
index 000..256d2dc
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_debug.h
@@ -0,0 +1,185 @@
+/*
+ *  Debugging macros, DUK_DPRINT() and its variants in particular.
+ *
+ *  DUK_DPRINT() allows formatted debug prints, and supports standard
+ *  and Duktape specific formatters.  See duk_debug_vsnprintf.c for details.
+ *
+ *  DUK_D(x), DUK_DD(x), and DUK_DDD(x) are used together with log macros
+ *  for technical reasons.  They are concretely used to hide 'x' from the
+ *  compiler when the corresponding log level is disabled.  This allows
+ *  clean builds on non-C99 compilers, at the cost of more verbose code.
+ *  Examples:
+ *
+ *DUK_D(DUK_DPRINT("foo"));
+ *DUK_DD(DUK_DDPRINT("foo"));
+ *DUK_DDD(DUK_DDDPRINT("foo"));
+ *
+ *  This approach is preferable to the old "double parentheses" hack because
+ *  double parentheses make the C99 solution worse: __FILE__ and __LINE__ can
+ *  no longer be added transparently without going through globals, which
+ *  works poorly with threading.
+ */
+
+#ifndef DUK_DEBUG_H_INCLUDED
+#define DUK_DEBUG_H_INCLUDED
+
+#ifdef DUK_USE_DEBUG
+
+#if defined(DUK_USE_DPRINT)
+#define DUK_D(x) x
+#else
+#define DUK_D(x) do { } while (0) /* omit */
+#endif
+
+#if defined(DUK_USE_DDPRINT)
+#define DUK_DD(x) x
+#else
+#define DUK_DD(x) do { } while (0) /* omit */
+#endif
+
+#if defined(DUK_USE_DDDPRINT)
+#define DUK_DDD(x) x
+#else
+#define DUK_DDD(x) do { } while (0) /* omit */
+#endif
+
+/*
+ *  Exposed debug macros: debugging enabled
+ */
+
+#define DUK_LEVEL_DEBUG1
+#define DUK_LEVEL_DDEBUG   2
+#define DUK_LEVEL_DDDEBUG  3
+
+#ifdef DUK_USE_VARIADIC_MACROS
+
+/* Note: combining __FILE__, __LINE__, and __func__ into fmt would be
+ * possible compile time, but waste some space with shared function names.
+ */
+#define DUK__DEBUG_LOG(lev,...)  duk_debug_log((duk_small_int_t) (lev), 
DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO, DUK_FUNC_MACRO, __VA_ARGS__);
+
+#define DUK_DPRINT(...)  DUK__DEBUG_LOG(DUK_LEVEL_DEBUG, __VA_ARGS__)
+
+#ifdef DUK_USE_DDPRINT
+#define DUK_DDPRINT(...) DUK__DEBUG_LOG(DUK_LEVEL_DDEBUG, __VA_ARGS__)
+#else
+#define DUK_DDPRINT(...)
+#endif
+
+#ifdef DUK_USE_DDDPRINT
+#define DUK_DDDPRINT(...)DUK__DEBUG_LOG(DUK_LEVEL_DDDEBUG, __VA_ARGS__)
+#else
+#define DUK_DDDPRINT(...)
+#endif
+
+#else  /* DUK_USE_VARIADIC_MACROS */
+
+#define DUK__DEBUG_STASH(lev)\
+   (void) DUK_SNPRINTF(duk_debug_file_stash, DUK_DEBUG_STASH_SIZE, "%s", 
(const char *) DUK_FILE_MACRO), \
+   duk_debug_file_stash[DUK_DEBUG_STASH_SIZE - 1] = (char) 0; \
+   (void) DUK_SNPRINTF(duk_debug_line_stash, DUK_DEBUG_STASH_SIZE, "%ld", 
(long) DUK_LINE_MACRO), \
+   duk_debug_line_stash[DUK_DEBUG_STASH_SIZE - 1] = (char) 0; \
+   (void) DUK_SNPRINTF(duk_debug_func_stash, DUK_DEBUG_STASH_SIZE, "%s", 
(const char *) DUK_FUNC_MACRO), \
+   duk_debug_func_stash[DUK_DEBUG_STASH_SIZE - 1] = (char) 0; \
+   (void) (duk_debug_level_stash = (lev))
+
+/* Without variadic macros resort to comma expression trickery to handle debug
+ * prints.  This generates a lot of harmless warnings.  These hacks are not
+ * needed normally because DUK_D() and friends will hide the entire debug log
+ * statement from the compiler.
+ */
+
+#ifdef DUK_USE_DPRINT
+#define DUK_DPRINT  DUK__DEBUG_STASH(DUK_LEVEL_DEBUG), (void) duk_debug_log  
/* args go here in parens */
+#else
+#define DUK_DPRINT  0 && /* args go here as a comma expression in parens */
+#endif
+
+#ifdef DUK_USE_DDPRINT
+#define DUK_DDPRINT  DUK__DEBUG_STASH(DUK_LEVEL_DDEBUG), (void) duk_debug_log  
/* args go here in parens */
+#else
+#define DUK_DDPRINT  0 && /* args */
+#endif
+
+#ifdef DUK_USE_DDDPRINT
+#define DUK_DDDPRINT  DUK__DEBUG_STASH(DUK_LEVEL_DDDEBUG), (void) 
duk_debug_log  /* args go here in parens */
+#else
+#define DUK_DDDPRINT  0 && /* args */
+#endif
+
+#endif  /* DUK_USE_VARIADIC_MACROS */
+
+#else  /* DUK_USE_DEBUG */
+
+/*
+ *  Exposed debug macros: debugging disabled
+ */
+
+#define DUK_D(x) do { } while (0) /* omit */
+#define DUK_DD(x) do { } while (0) /* omit */
+#define DUK_DDD(x) do { } while (0) /* omit */
+
+#ifdef DUK_USE_VARIADIC_MACROS
+
+#define DUK_DPRINT(...)
+#define DUK_DDPRINT(...)
+#define DUK_DDDPRINT(...)
+
+#else  /* DUK_USE_VARIADIC_MACROS */
+
+#define DUK_DPRINT0 && /* args go here as a comma expression in parens */
+#define DUK_DDPRINT   0 && /* args */
+#define DUK_DDDPRINT  0 && /* args */
+
+#endif  /* DUK_USE_VARIADIC_MACROS */
+
+#endif  /* DUK_USE_DEBUG */
+
+/*
+ *  

[37/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/civetweb_private_lua.h
--
diff --git a/thirdparty/civetweb-1.10/src/civetweb_private_lua.h 
b/thirdparty/civetweb-1.10/src/civetweb_private_lua.h
new file mode 100644
index 000..47c6566
--- /dev/null
+++ b/thirdparty/civetweb-1.10/src/civetweb_private_lua.h
@@ -0,0 +1,11 @@
+/* "civetweb_private_lua.h" */
+/* Project internal header to allow main.c to call a non-public function in
+ * mod_lua.inl */
+
+#ifndef CIVETWEB_PRIVATE_LUA_H
+#define CIVETWEB_PRIVATE_LUA_H
+
+int run_lua(const char *file_name);
+
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/file_ops.inl
--
diff --git a/thirdparty/civetweb-1.10/src/file_ops.inl 
b/thirdparty/civetweb-1.10/src/file_ops.inl
new file mode 100644
index 000..cfaadea
--- /dev/null
+++ b/thirdparty/civetweb-1.10/src/file_ops.inl
@@ -0,0 +1 @@
+/* currently not required */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/handle_form.inl
--
diff --git a/thirdparty/civetweb-1.10/src/handle_form.inl 
b/thirdparty/civetweb-1.10/src/handle_form.inl
new file mode 100644
index 000..2a213ad
--- /dev/null
+++ b/thirdparty/civetweb-1.10/src/handle_form.inl
@@ -0,0 +1,949 @@
+/* Copyright (c) 2016-2017 the Civetweb developers
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+
+static int
+url_encoded_field_found(const struct mg_connection *conn,
+const char *key,
+size_t key_len,
+const char *filename,
+size_t filename_len,
+char *path,
+size_t path_len,
+struct mg_form_data_handler *fdh)
+{
+   char key_dec[1024];
+   char filename_dec[1024];
+   int key_dec_len;
+   int filename_dec_len;
+   int ret;
+
+   key_dec_len =
+   mg_url_decode(key, (int)key_len, key_dec, (int)sizeof(key_dec), 1);
+
+   if (((size_t)key_dec_len >= (size_t)sizeof(key_dec)) || (key_dec_len < 
0)) {
+   return FORM_FIELD_STORAGE_SKIP;
+   }
+
+   if (filename) {
+   filename_dec_len = mg_url_decode(filename,
+(int)filename_len,
+filename_dec,
+(int)sizeof(filename_dec),
+1);
+
+   if (((size_t)filename_dec_len >= (size_t)sizeof(filename_dec))
+   || (filename_dec_len < 0)) {
+   /* Log error message and skip this field. */
+   mg_cry(conn, "%s: Cannot decode filename", __func__);
+   return FORM_FIELD_STORAGE_SKIP;
+   }
+   } else {
+   filename_dec[0] = 0;
+   }
+
+   ret =
+   fdh->field_found(key_dec, filename_dec, path, path_len, 
fdh->user_data);
+
+   if ((ret & 0xF) == FORM_FIELD_STORAGE_GET) {
+   if (fdh->field_get == NULL) {
+   mg_cry(conn, "%s: Function \"Get\" not available", 
__func__);
+   return FORM_FIELD_STORAGE_SKIP;
+   }
+   }
+   if ((ret & 0xF) == FORM_FIELD_STORAGE_STORE) {
+   if (fdh->field_store == NULL) {
+   mg_cry(conn, "%s: Function \"Store\" not available", 
__func__);
+   return FORM_FIELD_STORAGE_SKIP;
+   }
+   }
+
+   return ret;
+}
+
+
+static int
+url_encoded_field_get(const struct mg_connection *conn,
+ 

[07/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_builtins.h
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_builtins.h
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_builtins.h
new file mode 100644
index 000..9bea59d
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_builtins.h
@@ -0,0 +1,854 @@
+/*
+ *  Automatically generated by genbuiltins.py, do not edit!
+ */
+
+#ifndef DUK_BUILTINS_H_INCLUDED
+#define DUK_BUILTINS_H_INCLUDED
+
+#if defined(DUK_USE_ROM_STRINGS)
+#error ROM support not enabled, rerun make_dist.py with --rom-support
+#else  /* DUK_USE_ROM_STRINGS */
+#define DUK_STRIDX_UC_UNDEFINED   0
  /* 'Undefined' */
+#define DUK_HEAP_STRING_UC_UNDEFINED(heap)
DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_UNDEFINED)
+#define DUK_HTHREAD_STRING_UC_UNDEFINED(thr)  
DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_UNDEFINED)
+#define DUK_STRIDX_UC_NULL1
  /* 'Null' */
+#define DUK_HEAP_STRING_UC_NULL(heap) 
DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_NULL)
+#define DUK_HTHREAD_STRING_UC_NULL(thr)   
DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_NULL)
+#define DUK_STRIDX_UC_ARGUMENTS   2
  /* 'Arguments' */
+#define DUK_HEAP_STRING_UC_ARGUMENTS(heap)
DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_ARGUMENTS)
+#define DUK_HTHREAD_STRING_UC_ARGUMENTS(thr)  
DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_ARGUMENTS)
+#define DUK_STRIDX_UC_OBJECT  3
  /* 'Object' */
+#define DUK_HEAP_STRING_UC_OBJECT(heap)   
DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_OBJECT)
+#define DUK_HTHREAD_STRING_UC_OBJECT(thr) 
DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_OBJECT)
+#define DUK_STRIDX_UC_FUNCTION4
  /* 'Function' */
+#define DUK_HEAP_STRING_UC_FUNCTION(heap) 
DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_FUNCTION)
+#define DUK_HTHREAD_STRING_UC_FUNCTION(thr)   
DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_FUNCTION)
+#define DUK_STRIDX_ARRAY  5
  /* 'Array' */
+#define DUK_HEAP_STRING_ARRAY(heap)   
DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ARRAY)
+#define DUK_HTHREAD_STRING_ARRAY(thr) 
DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ARRAY)
+#define DUK_STRIDX_UC_STRING  6
  /* 'String' */
+#define DUK_HEAP_STRING_UC_STRING(heap)   
DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_STRING)
+#define DUK_HTHREAD_STRING_UC_STRING(thr) 
DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_STRING)
+#define DUK_STRIDX_UC_BOOLEAN 7
  /* 'Boolean' */
+#define DUK_HEAP_STRING_UC_BOOLEAN(heap)  
DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_BOOLEAN)
+#define DUK_HTHREAD_STRING_UC_BOOLEAN(thr)
DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_BOOLEAN)
+#define DUK_STRIDX_UC_NUMBER  8
  /* 'Number' */
+#define DUK_HEAP_STRING_UC_NUMBER(heap)   
DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_NUMBER)
+#define DUK_HTHREAD_STRING_UC_NUMBER(thr) 
DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_NUMBER)
+#define DUK_STRIDX_DATE   9
  /* 'Date' */
+#define DUK_HEAP_STRING_DATE(heap)
DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DATE)
+#define DUK_HTHREAD_STRING_DATE(thr)  
DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DATE)
+#define DUK_STRIDX_REG_EXP10   
  /* 'RegExp' */
+#define DUK_HEAP_STRING_REG_EXP(heap) 
DUK_HEAP_GET_STRING((heap),DUK_STRIDX_REG_EXP)
+#define DUK_HTHREAD_STRING_REG_EXP(thr)   
DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_REG_EXP)
+#define DUK_STRIDX_UC_ERROR   11   
  /* 'Error' */
+#define DUK_HEAP_STRING_UC_ERROR(heap) 

[40/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/include/civetweb.h
--
diff --git a/thirdparty/civetweb-1.10/include/civetweb.h 
b/thirdparty/civetweb-1.10/include/civetweb.h
new file mode 100644
index 000..b0f5ee7
--- /dev/null
+++ b/thirdparty/civetweb-1.10/include/civetweb.h
@@ -0,0 +1,1367 @@
+/* Copyright (c) 2013-2017 the Civetweb developers
+ * Copyright (c) 2004-2013 Sergey Lyubka
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef CIVETWEB_HEADER_INCLUDED
+#define CIVETWEB_HEADER_INCLUDED
+
+#define CIVETWEB_VERSION "1.10"
+#define CIVETWEB_VERSION_MAJOR (1)
+#define CIVETWEB_VERSION_MINOR (10)
+#define CIVETWEB_VERSION_PATCH (0)
+#define CIVETWEB_VERSION_RELEASED
+
+#ifndef CIVETWEB_API
+#if defined(_WIN32)
+#if defined(CIVETWEB_DLL_EXPORTS)
+#define CIVETWEB_API __declspec(dllexport)
+#elif defined(CIVETWEB_DLL_IMPORTS)
+#define CIVETWEB_API __declspec(dllimport)
+#else
+#define CIVETWEB_API
+#endif
+#elif __GNUC__ >= 4
+#define CIVETWEB_API __attribute__((visibility("default")))
+#else
+#define CIVETWEB_API
+#endif
+#endif
+
+#include 
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Initialize this library. This should be called once before any other
+ * function from this library. This function is not guaranteed to be
+ * thread safe.
+ * Parameters:
+ *   features: bit mask for features to be initialized.
+ * Return value:
+ *   initialized features
+ *   0: error
+ */
+CIVETWEB_API unsigned mg_init_library(unsigned features);
+
+
+/* Un-initialize this library.
+ * Return value:
+ *   0: error
+ */
+CIVETWEB_API unsigned mg_exit_library(void);
+
+
+struct mg_context;/* Handle for the HTTP service itself */
+struct mg_connection; /* Handle for the individual connection */
+
+
+/* Maximum number of headers */
+#define MG_MAX_HEADERS (64)
+
+struct mg_header {
+   const char *name;  /* HTTP header name */
+   const char *value; /* HTTP header value */
+};
+
+
+/* This structure contains information about the HTTP request. */
+struct mg_request_info {
+   const char *request_method; /* "GET", "POST", etc */
+   const char *request_uri;/* URL-decoded URI (absolute or relative,
+* as in the request) */
+   const char *local_uri;  /* URL-decoded URI (relative). Can be NULL
+* if the request_uri does not address a
+* resource at the server host. */
+#if defined(MG_LEGACY_INTERFACE)
+   const char *uri; /* Deprecated: use local_uri instead */
+#endif
+   const char *http_version; /* E.g. "1.0", "1.1" */
+   const char *query_string; /* URL part after '?', not including '?', or
+NULL */
+   const char *remote_user;  /* Authenticated user, or NULL if no auth
+used */
+   char remote_addr[48]; /* Client's IP address as a string. */
+
+#if defined(MG_LEGACY_INTERFACE)
+   long remote_ip; /* Client's IP address. Deprecated: use remote_addr 
instead
+  */
+#endif
+
+   long long content_length; /* Length (in bytes) of the request body,
+can be -1 if no length was given. */
+   int remote_port;  /* Client's port */
+   int is_ssl;   /* 1 if SSL-ed, 0 if not */
+   void *user_data;  /* User data pointer passed to mg_start() */
+   void *conn_data;  /* Connection-specific user data */
+
+   int num_headers; /* Number of HTTP headers */
+   struct mg_header
+   http_headers[MG_MAX_HEADERS]; /* Allocate maximum headers */
+
+   struct mg_client_cert *client_cert; /* Client certificate information */
+
+   const char *acceptedWebSocketSubprotocol; /* 

[46/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/docs/Building.md
--
diff --git a/thirdparty/civetweb-1.10/docs/Building.md 
b/thirdparty/civetweb-1.10/docs/Building.md
new file mode 100644
index 000..9d7b56f
--- /dev/null
+++ b/thirdparty/civetweb-1.10/docs/Building.md
@@ -0,0 +1,216 @@
+Building CivetWeb
+=
+
+This guide covers the build instructions for the stand-alone web server.
+See 
[Embedding.md](https://github.com/civetweb/civetweb/blob/master/docs/Embedding.md)
 for information on extending an existing C or C++ application. A brief 
overview of the source code files can be found in 
[Embedding.md](https://github.com/civetweb/civetweb/blob/master/docs/Embedding.md)
 as well.
+
+ Where to get the source code?
+
+The latest version can be found at
+https://github.com/civetweb/civetweb
+
+Released versions can be found at
+https://github.com/civetweb/civetweb/releases
+
+
+Building for Windows
+-
+
+ Using Visual Studio
+
+Open the *VS/civetweb.sln* in Visual Studio.
+To include SSL support, you may have to add an extra library for the 
cryptography support. You might wish to use yaSSL.  However, it is GPL licensed 
or uses a commercial license. See 
[yaSSL.md](https://github.com/civetweb/civetweb/blob/master/docs/yaSSL.md) for 
more information.
+Alternatively, you might wish to use OpenSSL. See 
[OpenSSL.md](https://github.com/civetweb/civetweb/blob/master/docs/OpenSSL.md) 
for more information.
+
+ Using MinGW-w64 or TDM-GCC
+In the start menu locate and run the "Run terminal" batch file. For TDM-GCC 
this is named "MinGW Command Prompt".
+Navigate to the civetweb sources directory and run:
+```
+mingw32-make CC=gcc
+```
+
+ Using Qt Creator
+Open the Qt Designer project in the Qt folder
+
+ Using CMake
+Except for the components in the `third_party` folder (e.g., Lua and Duktape), 
CivetWeb can also be built with CMake.
+CMake can be used for all supported operating systems.
+
+
+Building for Linux, BSD, and OSX
+-
+
+## Using Make
+
+```
+make help
+```
+Get a list of all supported make option
+
+```
+make build
+```
+compile the code
+
+```
+make install
+```
+Install on the system, Linux only.
+
+```
+make lib WITH_CPP=1 WITH_IPV6=1
+make clean slib WITH_CPP=1 WITH_LUA=1 WITH_WEBSOCKET=1
+```
+Build the static and shared libraries.
+The *WITH_CPP* make option is to include the CivetServer class.
+The additional make options configure the library just as it would the 
application.
+
+The *slib* option should be done on a separate clean build as position
+independent code (PIC) is required for it.  Trying to run it after
+building the static library or the server will result in a link error.
+
+```
+make clean
+```
+Clean up files generated during the build
+
+## Setting build options
+
+Make options can be set on the command line with the make command like so.
+```
+make build WITH_LUA=1
+```
+
+
+| Make Options  | Description   |
+| - | - |
+| WITH_LUA=1| build with Lua support|
+| WITH_DUKTAPE=1| build with server-side JavaScript support |
+| WITH_DEBUG=1  | build with GDB debug support  |
+| WITH_IPV6=1   | with IPV6 support |
+| WITH_WEBSOCKET=1  | build with web socket support |
+| WITH_SERVER_STATS=1   | build with support for server statistics  |
+| WITH_CPP=1| build libraries with c++ classes  |
+| CONFIG_FILE=file  | use 'file' as the config file |
+| CONFIG_FILE2=file | use 'file' as the backup config file  |
+| HTMLDIR=/path | place to install initial web pages|
+| DOCUMENT_ROOT=/path   | HTMLDIR override, config option, install  |
+|   | nothing is installed here.|
+| PORTS=8080| listening ports override when installing  |
+| SSL_LIB=libssl.so.0   | use versioned SSL library |
+| CRYPTO_LIB=libcrypto.so.0 | system versioned CRYPTO library   |
+| PREFIX=/usr/local | sets the install directory|
+| COPT='-DNO_SSL'   | method to insert compile flags|
+
+Note that the WITH_* options used for *make* are not identical to the
+preprocessor defines in the source code - usually USE_* is used there.
+
+## Changing PREFIX
+
+To change the target destination pass the `PREFIX` option to the command `make 
install` (not `make build`). Example usage:
+
+```
+$ make build
+$ make -n install PREFIX=/opt/civetweb
+```
+Note: The `-n` corresponds to the `--dry-run` option (it does not make any 
changes): You can see where `make install` would install. Example output of the 
above command:
+
+```
+$ make -n 

[34/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/sha1.inl
--
diff --git a/thirdparty/civetweb-1.10/src/sha1.inl 
b/thirdparty/civetweb-1.10/src/sha1.inl
new file mode 100644
index 000..e491a06
--- /dev/null
+++ b/thirdparty/civetweb-1.10/src/sha1.inl
@@ -0,0 +1,322 @@
+/*
+SHA-1 in C
+By Steve Reid 
+100% Public Domain
+
+-
+Modified 7/98
+By James H. Brown 
+Still 100% Public Domain
+
+Corrected a problem which generated improper hash values on 16 bit machines
+Routine SHA1Update changed from
+void SHA1Update(SHA_CTX* context, unsigned char* data, unsigned int
+len)
+to
+void SHA1Update(SHA_CTX* context, unsigned char* data, unsigned
+long len)
+
+The 'len' parameter was declared an int which works fine on 32 bit machines.
+However, on 16 bit machines an int is too small for the shifts being done
+against
+it.  This caused the hash function to generate incorrect values if len was
+greater than 8191 (8K - 1) due to the 'len << 3' on line 3 of SHA1Update().
+
+Since the file IO in main() reads 16K at a time, any file 8K or larger would
+be guaranteed to generate the wrong hash (e.g. Test Vector #3, a million
+"a"s).
+
+I also changed the declaration of variables i & j in SHA1Update to
+unsigned long from unsigned int for the same reason.
+
+These changes should make no difference to any 32 bit implementations since
+an
+int and a long are the same size in those environments.
+
+--
+I also corrected a few compiler warnings generated by Borland C.
+1. Added #include  for exit() prototype
+2. Removed unused variable 'j' in SHA1Final
+3. Changed exit(0) to return(0) at end of main.
+
+ALL changes I made can be located by searching for comments containing 'JHB'
+-
+Modified 8/98
+By Steve Reid 
+Still 100% public domain
+
+1- Removed #include  and used return() instead of exit()
+2- Fixed overwriting of finalcount in SHA1Final() (discovered by Chris Hall)
+3- Changed email address from st...@edmweb.com to sr...@sea-to-sky.net
+
+-
+Modified 4/01
+By Saul Kravitz 
+Still 100% PD
+Modified to run on Compaq Alpha hardware.
+
+-
+Modified 07/2002
+By Ralph Giles 
+Still 100% public domain
+modified for use with stdint types, autoconf
+code cleanup, removed attribution comments
+switched SHA1Final() argument order for consistency
+use SHA1_ prefix for public api
+move public api to sha1.h
+*/
+
+/*
+11/2016 adapted for CivetWeb:
+  include sha1.h in sha1.c,
+  rename to sha1.inl
+  remove unused #ifdef sections
+  make endian independent
+  align buffer to 4 bytes
+  remove unused variable assignments
+*/
+
+/*
+Test Vectors (from FIPS PUB 180-1)
+"abc"
+  A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
+"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
+  84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
+A million repetitions of "a"
+  34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
+*/
+
+#include 
+#include 
+
+typedef struct {
+   uint32_t state[5];
+   uint32_t count[2];
+   uint8_t buffer[64];
+} SHA_CTX;
+
+#define SHA1_DIGEST_SIZE 20
+
+#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits
+
+/* blk0() and blk() perform the initial expand. */
+/* I got the idea of expanding during the round function from SSLeay */
+
+
+typedef union {
+   uint8_t c[64];
+   uint32_t l[16];
+} CHAR64LONG16;
+
+
+static uint32_t
+blk0(CHAR64LONG16 *block, int i)
+{
+   static const uint32_t n = 1u;
+   if ((*((uint8_t *)())) == 1) {
+   /* little endian / intel byte order */
+   block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00)
+ | (rol(block->l[i], 8) & 0x00FF00FF);
+   }
+   return block->l[i];
+}
+
+#define blk(block, i)  
\
+   (block->l[i & 15] = rol(block->l[(i + 13) & 15] ^ block->l[(i + 8) & 
15]   \
+   ^ block->l[(i + 2) & 15] ^ block->l[i & 
15],   \
+   1))
+
+/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
+#define R0(v, w, x, y, z, i)   
\
+   z += ((w & (x ^ y)) ^ y) + blk0(block, i) + 0x5A827999 + rol(v, 5); 
   \
+   w = rol(w, 30);
+#define R1(v, w, x, y, z, i)   
\
+   z += ((w & (x ^ y)) ^ y) + blk(block, i) + 0x5A827999 + rol(v, 5);  
   \
+   w = rol(w, 30);
+#define R2(v, w, x, y, z, i)   
\
+   z += (w ^ x ^ y) + blk(block, i) + 0x6ED9EBA1 + rol(v, 5);  
   \
+   w = rol(w, 30);
+#define R3(v, w, x, y, z, i)   
\
+   z += 

[44/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/docs/api/mg_set_request_handler.md
--
diff --git a/thirdparty/civetweb-1.10/docs/api/mg_set_request_handler.md 
b/thirdparty/civetweb-1.10/docs/api/mg_set_request_handler.md
new file mode 100644
index 000..95a09a0
--- /dev/null
+++ b/thirdparty/civetweb-1.10/docs/api/mg_set_request_handler.md
@@ -0,0 +1,26 @@
+# Civetweb API Reference
+
+### `mg_set_request_handler( ctx, uri, handler, cbdata );`
+
+### Parameters
+
+| Parameter | Type | Description |
+| :--- | :--- | :--- |
+|**`ctx`**|`struct mg_context *`|The context where the handler must be active|
+|**`uri`**|`const char *`|The URI to hook the handler on|
+|**`handler`**|`mg_request_handler`|Callback function doing the heavy lifting|
+|**`cbdata`**|`void *`|Optional user supplied data|
+
+`int mg_request_handler( struct mg_connection *conn, void *cbdata );`
+
+### Return Value
+
+*none*
+
+### Description
+
+The function `mg_set_request_handler()` hooks a callback function on a URI. 
That callback function is called whenever a client requests the specific URI. 
The callback function receives the connection information and optional user 
supplied data as parameters and can serve information back to the client. When 
the callback function does not send any information back to the client, it 
should return **0** to signal Civetweb that the Civetweb core should handle the 
request. A return value between 1 and 999 is used to tell Civetweb that the 
request has been handled and no further processing is necessary. The returned 
code is stored as the status code in the access log, it is therefore 
recommended, although not mandatory to return a status code which matches the 
state of the request.
+
+### See Also
+
+* [`mg_set_auth_handler();`](mg_set_auth_handler.md)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/docs/api/mg_set_user_connection_data.md
--
diff --git a/thirdparty/civetweb-1.10/docs/api/mg_set_user_connection_data.md 
b/thirdparty/civetweb-1.10/docs/api/mg_set_user_connection_data.md
new file mode 100644
index 000..adafc22
--- /dev/null
+++ b/thirdparty/civetweb-1.10/docs/api/mg_set_user_connection_data.md
@@ -0,0 +1,44 @@
+# Civetweb API Reference
+
+### `mg_set_user_connection_data( conn, data );`
+
+### Parameters
+
+| Parameter | Type | Description |
+| :--- | :--- | :--- |
+|**`conn`**|`struct mg_connection *`|connection to add the user data|
+|**`data`**|`void *`|Pointer to the user data|
+
+### Return Value
+
+*none*
+
+### Description
+
+The function `mg_set_user_connection_data()` can be used to set a user defined
+data pointer attached to a connection.  This value can be read using 
+`mg_get_user_connection_data()`.
+Any call to `mg_set_user_connection_data()` will overwrite a previously
+assigned user data pointer.
+
+`mg_set_user_connection_data()` requires a non-const 
+`struct mg_connection *` to set the user data pointer.  It is save to use the
+`const struct mg_connection *` passed to a websocket connect handler (with a
+const cast), since `const` just means you must not use `mg_read()` or
+`mg_write()` in this context.
+
+Alternatively, you can use the `init_connection` callback in 
+`struct mg_callbacks` to set the user data pointer.
+In this case, typically `init_connection` is used to allocate memory for
+a user defined `struct`, while `connection_close` is used to free this
+memory again.
+
+
+### See Also
+
+* [`mg_get_user_connection_data();`](mg_get_user_connection_data.md)
+* [`struct mg_callbacks`](mg_callbacks.md)
+* [`mg_set_websocket_handler();`](mg_set_websocket_handler.md)
+* [`mg_read();`](mg_read.md)
+* [`mg_write();`](mg_write.md)
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/docs/api/mg_set_websocket_handler.md
--
diff --git a/thirdparty/civetweb-1.10/docs/api/mg_set_websocket_handler.md 
b/thirdparty/civetweb-1.10/docs/api/mg_set_websocket_handler.md
new file mode 100644
index 000..f838c81
--- /dev/null
+++ b/thirdparty/civetweb-1.10/docs/api/mg_set_websocket_handler.md
@@ -0,0 +1,30 @@
+# Civetweb API Reference
+
+### `mg_set_websocket_handler( ctx, uri, connect_handler, ready_handler, 
data_handler, close_handler, cbdata );`
+
+### Parameters
+
+| Parameter | Type | Description |
+| :--- | :--- | :--- |
+|**`ctx`**|`mg_context *`|The context in which to add the handlers|
+|**`uri`**|`const char *`|The URI for which the handlers should be activated|
+|**`connect_handler`**|`mg_websocket_connect_handler`|Handler called when a 
connect is signalled|
+|**`ready_handler`**|`mg_websocket_ready_handler`|Handler called when the 
connection is ready|
+|**`data_handler`**|`mg_websocket_data_handler`|Handler called 

[26/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/cpp-exceptions/README.rst
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/cpp-exceptions/README.rst
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/cpp-exceptions/README.rst
new file mode 100644
index 000..bbc26a0
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/cpp-exceptions/README.rst
@@ -0,0 +1,29 @@
+=
+C++ exceptions for long control transfers
+=
+
+Normally Duktape uses ``setjmp()`` / ``longjmp()`` or their variants for
+internal long control transfers.  One downside of these functions is that
+C++ automatic destructors (scope-based resource management, SBRM, a special
+case of RAII) in Duktape/C functions won't be executed which is awkward for
+C++ programmers.
+
+When ``DUK_USE_CPP_EXCEPTIONS`` (``DUK_OPT_CPP_EXCEPTIONS``) is defined, and
+both Duktape and application code is compiled using a C++ compiler, Duktape
+uses C++ ``try-catch`` and ``throw`` for internal long control transfers.
+This allows automatic destructors to run as expected.  The config option is
+not enabled by default because C++ exceptions are sometimes disabled even
+when a C++ compiler is used (e.g. for performance reasons).
+
+The ``cpp_exceptions.cpp`` example illustrates how C++ exceptions can be
+used in Duktape/C functions at the moment:
+
+* Duktape uses C++ try/catch/throw internally; this is not visible to user
+  code directly.
+
+* Automatic destructors (scope-based resource management) work as expected.
+
+* C++ exceptions can be used in Duktape/C functions normally, but user
+  exceptions must be caught before they reach Duktape.  If this is not
+  done, such exceptions are caught by Duktape and converted to API errors
+  (in other words, they won't propagate "through" Duktape at the moment).

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/cpp-exceptions/cpp_exceptions.cpp
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/cpp-exceptions/cpp_exceptions.cpp
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/cpp-exceptions/cpp_exceptions.cpp
new file mode 100644
index 000..6fb3194
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/cpp-exceptions/cpp_exceptions.cpp
@@ -0,0 +1,274 @@
+/*
+ *  Example of how to use DUK_USE_CPP_EXCEPTIONS to support automatic
+ *  variables (e.g. destructor calls) in Duktape/C functions.
+ *
+ *  Compile with -DDUK_OPT_CPP_EXCEPTIONS:
+ *
+ *$ g++ -otest -DDUK_OPT_CPP_EXCEPTIONS -I/src/ \
+ *  /src/duktape.c cpp_exceptions.cpp -lm
+ *
+ *  or ensure duk_config.h has DUK_USE_CPP_EXCEPTIONS enabled using
+ *  genconfig.  When executed you should see something like:
+ *
+ *$ ./test
+ *my_class instance created
+ *my_class instance destroyed  <== destructor gets called
+ *--> rc=1 (SyntaxError: parse error (line 1))
+ *[...]
+ *
+ *  Duktape uses a custom exception class (duk_internal_exception) which
+ *  doesn't inherit from any base class, so that catching any base classes
+ *  in user code won't accidentally catch exceptions thrown by Duktape.
+ */
+
+#if !defined(__cplusplus)
+#error compile using a c++ compiler
+#endif
+
+#include 
+#include 
+#include "duktape.h"
+
+#if defined(__cplusplus) && (__cplusplus >= 201103L)
+#define NOEXCEPT noexcept
+#else
+#define NOEXCEPT throw()
+#endif
+
+/*
+ *  Example class with a destructor
+ */
+
+class my_class {
+ public:
+   my_class();
+   ~my_class();
+};
+
+my_class::my_class() {
+   printf("my_class instance created\n");
+}
+
+my_class::~my_class() {
+   printf("my_class instance destroyed\n");
+}
+
+/*
+ *  SyntaxError caused by eval exits Duktape/C function but destructors
+ *  are executed.
+ */
+
+duk_ret_t test1(duk_context *ctx) {
+   my_class myclass;
+
+   duk_eval_string(ctx, "aiee=");
+
+   return 0;
+}
+
+/*
+ *  You can use C++ exceptions inside Duktape/C functions for your own
+ *  purposes but you should catch them before they propagate to Duktape.
+ */
+
+duk_ret_t test2(duk_context *ctx) {
+   my_class myclass;
+
+   try {
+   throw 123;
+   } catch (int myvalue) {
+   printf("Caught: %d\n", myvalue);
+   }
+
+   return 0;
+}
+
+/*
+ *  If you let your own C++ exceptions propagate out of a Duktape/C function
+ *  it will be caught by Duktape and considered a programming error.  Duktape
+ *  will catch the exception and convert it to a Duktape error.
+ *
+ *  This may be allowed in a later version once all the 

[08/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_builtins.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_builtins.c
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_builtins.c
new file mode 100644
index 000..5003e8b
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_builtins.c
@@ -0,0 +1,776 @@
+/*
+ *  Automatically generated by genbuiltins.py, do not edit!
+ */
+
+#include "duk_internal.h"
+
+#if defined(DUK_USE_ROM_STRINGS)
+#error ROM support not enabled, rerun make_dist.py with --rom-support
+#else  /* DUK_USE_ROM_STRINGS */
+DUK_INTERNAL const duk_uint8_t duk_strings_data[1049] = {
+79,104,209,144,168,105,6,78,182,139,90,122,8,154,140,35,103,35,117,193,73,
+5,52,116,180,104,166,135,52,189,4,98,12,27,178,156,80,211,31,161,115,150,
+64,52,221,109,24,18,68,157,24,38,67,118,36,55,73,119,151,164,140,93,18,117,
+128,153,201,228,201,205,2,250,8,196,24,232,104,82,146,40,232,193,48,118,
+168,37,147,212,54,127,113,208,70,32,194,187,68,54,127,113,208,70,32,196,
+123,68,54,127,113,209,44,12,121,7,208,70,32,194,186,134,207,236,126,219,
+160,140,65,133,246,136,108,254,199,237,186,8,196,24,87,80,217,253,159,217,
+116,17,136,48,190,209,13,159,217,253,151,65,24,131,12,233,86,224,79,236,
+254,203,160,140,65,134,116,171,112,39,246,223,105,208,70,32,193,140,183,4,
+11,55,92,20,244,141,169,186,50,11,164,109,77,208,208,165,36,79,215,185,13,
+153,34,110,204,241,32,6,66,84,11,112,200,84,52,157,124,92,242,70,120,45,64,
+186,17,22,138,38,0,172,140,19,154,84,26,145,0,86,69,17,180,97,34,0,172,132,
+75,144,215,77,221,91,132,5,147,178,156,80,211,30,160,93,9,215,21,115,119,
+169,49,75,211,138,26,101,205,222,68,157,47,78,40,105,151,55,120,204,156,
+189,56,161,166,52,157,72,136,138,65,154,232,147,162,4,136,150,81,115,66,
+208,210,37,96,148,250,134,140,151,39,212,125,255,221,125,73,80,209,146,233,
+124,93,55,79,15,34,196,230,202,113,160,166,232,157,132,148,128,98,28,46,
+114,200,6,153,180,96,73,19,74,113,67,76,103,5,36,20,211,70,140,133,67,72,
+49,245,160,235,81,212,52,168,106,39,132,253,111,80,210,161,168,158,5,245,
+191,96,31,172,15,208,23,226,190,131,232,62,131,232,11,251,127,93,245,223,
+93,251,172,234,27,80,45,3,250,14,140,19,34,65,19,81,132,108,228,97,1,107,
+33,12,32,45,100,136,206,9,12,196,155,134,69,146,100,235,226,231,146,51,194,
+72,218,48,145,4,200,119,89,189,81,49,39,72,147,235,226,233,186,120,121,58,
+226,167,90,124,93,55,107,71,137,33,68,68,130,64,206,75,189,209,156,144,84,
+44,141,3,8,137,187,178,156,80,211,26,110,242,100,230,146,120,121,8,48,76,6,
+89,26,105,157,65,196,201,213,145,166,153,212,28,76,157,113,75,34,78,62,14,
+38,73,105,228,142,136,178,48,141,152,228,73,150,83,0,148,39,137,75,67,73,
+214,209,129,36,85,190,206,32,17,6,9,128,141,3,8,130,161,100,235,64,194,24,
+52,41,73,19,189,200,108,201,19,111,181,2,232,66,239,173,37,230,157,244,56,
+153,4,225,145,27,233,93,22,1,114,62,251,80,69,128,121,247,213,146,228,109,
+79,190,212,17,35,106,125,246,78,164,68,68,111,175,23,217,45,13,33,119,208,
+68,210,38,250,192,61,91,233,80,208,45,25,36,81,190,156,13,26,201,19,239,
+162,2,214,66,31,125,153,226,64,13,27,236,72,96,130,68,62,251,48,68,196,153,
+119,217,157,18,56,156,199,161,100,42,26,250,77,36,140,122,40,144,19,34,9,
+24,246,103,139,172,150,56,125,145,1,17,29,44,112,250,183,0,100,24,200,218,
+140,228,185,130,9,19,237,190,208,73,184,146,35,68,146,163,8,50,178,99,136,
+44,89,196,2,33,70,64,208,196,67,74,226,88,17,105,73,24,186,37,40,38,5,133,
+161,89,4,183,25,115,119,86,227,118,83,138,26,103,255,223,209,106,141,25,11,
+244,95,117,56,208,159,250,223,251,250,45,52,13,250,47,186,156,104,79,253,
+111,253,253,22,144,210,253,23,221,78,52,39,254,187,254,254,139,77,67,75,
+244,95,117,56,208,159,250,239,251,250,45,22,141,23,209,125,212,227,66,127,
+235,63,239,69,163,69,247,83,141,9,255,165,12,72,5,16,64,145,10,32,76,71,64,
+156,217,161,180,34,6,64,208,198,36,78,50,20,20,92,204,50,44,147,32,134,226,
+17,114,33,202,134,129,107,192,202,232,160,180,104,166,135,52,72,40,144,213,
+33,178,152,26,34,56,163,105,44,104,146,116,139,77,43,34,98,57,38,116,72,
+179,60,93,97,206,56,52,240,242,56,163,168,34,81,57,178,153,42,228,12,182,
+58,22,66,89,19,57,68,176,74,68,35,104,195,18,239,116,102,114,94,100,104,
+228,100,49,238,140,203,42,60,145,35,104,181,146,113,161,10,80,46,68,82,24,
+245,145,132,108,228,148,54,100,137,64,34,13,100,153,222,1,40,6,33,223,20,
+84,19,34,95,23,76,130,153,6,103,208,43,64,141,41,130,104,17,112,130,44,96,
+};
+#endif  /* DUK_USE_ROM_STRINGS */
+
+#if defined(DUK_USE_ROM_OBJECTS)
+#error ROM support not enabled, rerun make_dist.py with --rom-support
+#else  /* DUK_USE_ROM_OBJECTS */
+/* native functions: 149 */
+DUK_INTERNAL const duk_c_function duk_bi_native_functions[149] = {
+   duk_bi_array_constructor,
+   

[01/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master d4f0bcfd3 -> df353561c


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_heap_hashstring.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_heap_hashstring.c
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_heap_hashstring.c
new file mode 100644
index 000..5cad795
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_heap_hashstring.c
@@ -0,0 +1,120 @@
+/*
+ *  String hash computation (interning).
+ *
+ *  String hashing is performance critical because a string hash is computed
+ *  for all new strings which are candidates to be added to the string table.
+ *  However, strings actually added to the string table go through a codepoint
+ *  length calculation which dominates performance because it goes through
+ *  every byte of the input string (but only for strings added).
+ *
+ *  The string hash algorithm should be fast, but on the other hand provide
+ *  good enough hashes to ensure both string table and object property table
+ *  hash tables work reasonably well (i.e., there aren't too many collisions
+ *  with real world inputs).  Unless the hash is cryptographic, it's always
+ *  possible to craft inputs with maximal hash collisions.
+ *
+ *  NOTE: The hash algorithms must match src/dukutil.py:duk_heap_hashstring()
+ *  for ROM string support!
+ */
+
+#include "duk_internal.h"
+
+#if defined(DUK_USE_STRHASH_DENSE)
+/* Constants for duk_hashstring(). */
+#define DUK__STRHASH_SHORTSTRING   4096L
+#define DUK__STRHASH_MEDIUMSTRING  (256L * 1024L)
+#define DUK__STRHASH_BLOCKSIZE 256L
+
+DUK_INTERNAL duk_uint32_t duk_heap_hashstring(duk_heap *heap, const 
duk_uint8_t *str, duk_size_t len) {
+   duk_uint32_t hash;
+
+   /* Use Murmurhash2 directly for short strings, and use "block skipping"
+* for long strings: hash an initial part and then sample the rest of
+* the string with reasonably sized chunks.  An initial offset for the
+* sampling is computed based on a hash of the initial part of the 
string;
+* this is done to (usually) avoid the case where all long strings have
+* certain offset ranges which are never sampled.
+*
+* Skip should depend on length and bound the total time to roughly
+* logarithmic.  With current values:
+*
+*   1M string => 256 * 241 = 61696 bytes (0.06M) of hashing
+*   1G string => 256 * 16321 = 4178176 bytes (3.98M) of hashing
+*
+* XXX: It would be better to compute the skip offset more "smoothly"
+* instead of having a few boundary values.
+*/
+
+   /* note: mixing len into seed improves hashing when skipping */
+   duk_uint32_t str_seed = heap->hash_seed ^ ((duk_uint32_t) len);
+
+   if (len <= DUK__STRHASH_SHORTSTRING) {
+   hash = duk_util_hashbytes(str, len, str_seed);
+   } else {
+   duk_size_t off;
+   duk_size_t skip;
+
+   if (len <= DUK__STRHASH_MEDIUMSTRING) {
+   skip = (duk_size_t) (16 * DUK__STRHASH_BLOCKSIZE + 
DUK__STRHASH_BLOCKSIZE);
+   } else {
+   skip = (duk_size_t) (256 * DUK__STRHASH_BLOCKSIZE + 
DUK__STRHASH_BLOCKSIZE);
+   }
+
+   hash = duk_util_hashbytes(str, (duk_size_t) 
DUK__STRHASH_SHORTSTRING, str_seed);
+   off = DUK__STRHASH_SHORTSTRING + (skip * (hash % 256)) / 256;
+
+   /* XXX: inefficient loop */
+   while (off < len) {
+   duk_size_t left = len - off;
+   duk_size_t now = (duk_size_t) (left > 
DUK__STRHASH_BLOCKSIZE ? DUK__STRHASH_BLOCKSIZE : left);
+   hash ^= duk_util_hashbytes(str + off, now, str_seed);
+   off += skip;
+   }
+   }
+
+#if defined(DUK_USE_STRHASH16)
+   /* Truncate to 16 bits here, so that a computed hash can be compared
+* against a hash stored in a 16-bit field.
+*/
+   hash &= 0xUL;
+#endif
+   return hash;
+}
+
+#undef DUK__STRHASH_SHORTSTRING
+#undef DUK__STRHASH_MEDIUMSTRING
+#undef DUK__STRHASH_BLOCKSIZE
+#else  /* DUK_USE_STRHASH_DENSE */
+DUK_INTERNAL duk_uint32_t duk_heap_hashstring(duk_heap *heap, const 
duk_uint8_t *str, duk_size_t len) {
+   duk_uint32_t hash;
+   duk_size_t step;
+   duk_size_t off;
+
+   /* Slightly modified "Bernstein hash" from:
+*
+* 
http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
+*
+* Modifications: string skipping and reverse direction similar to
+* Lua 5.1.5, and different hash initializer.
+*
+* The reverse direction 

[12/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_error.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_error.c
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_error.c
new file mode 100644
index 000..b575fff
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_error.c
@@ -0,0 +1,383 @@
+/*
+ *  Error built-ins
+ */
+
+#include "duk_internal.h"
+
+DUK_INTERNAL duk_ret_t duk_bi_error_constructor_shared(duk_context *ctx) {
+   /* Behavior for constructor and non-constructor call is
+* the same except for augmenting the created error.  When
+* called as a constructor, the caller (duk_new()) will handle
+* augmentation; when called as normal function, we need to do
+* it here.
+*/
+
+   duk_hthread *thr = (duk_hthread *) ctx;
+   duk_small_int_t bidx_prototype = duk_get_current_magic(ctx);
+
+   /* same for both error and each subclass like TypeError */
+   duk_uint_t flags_and_class = DUK_HOBJECT_FLAG_EXTENSIBLE |
+
DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ERROR);
+
+   DUK_UNREF(thr);
+
+   duk_push_object_helper(ctx, flags_and_class, bidx_prototype);
+
+   /* If message is undefined, the own property 'message' is not set at
+* all to save property space.  An empty message is inherited anyway.
+*/
+   if (!duk_is_undefined(ctx, 0)) {
+   duk_to_string(ctx, 0);
+   duk_dup(ctx, 0);  /* [ message error message ] */
+   duk_xdef_prop_stridx(ctx, -2, DUK_STRIDX_MESSAGE, 
DUK_PROPDESC_FLAGS_WC);
+   }
+
+   /* Augment the error if called as a normal function.  __FILE__ and 
__LINE__
+* are not desirable in this case.
+*/
+
+#ifdef DUK_USE_AUGMENT_ERROR_CREATE
+   if (!duk_is_constructor_call(ctx)) {
+   duk_err_augment_error_create(thr, thr, NULL, 0, 1 
/*noblame_fileline*/);
+   }
+#endif
+
+   return 1;
+}
+
+DUK_INTERNAL duk_ret_t duk_bi_error_prototype_to_string(duk_context *ctx) {
+   /* XXX: optimize with more direct internal access */
+
+   duk_push_this(ctx);
+   (void) duk_require_hobject_or_lfunc_coerce(ctx, -1);
+
+   /* [ ... this ] */
+
+   duk_get_prop_stridx(ctx, -1, DUK_STRIDX_NAME);
+   if (duk_is_undefined(ctx, -1)) {
+   duk_pop(ctx);
+   duk_push_string(ctx, "Error");
+   } else {
+   duk_to_string(ctx, -1);
+   }
+
+   /* [ ... this name ] */
+
+   /* XXX: Are steps 6 and 7 in E5 Section 15.11.4.4 duplicated by
+* accident or are they actually needed?  The first ToString()
+* could conceivably return 'undefined'.
+*/
+   duk_get_prop_stridx(ctx, -2, DUK_STRIDX_MESSAGE);
+   if (duk_is_undefined(ctx, -1)) {
+   duk_pop(ctx);
+   duk_push_string(ctx, "");
+   } else {
+   duk_to_string(ctx, -1);
+   }
+
+   /* [ ... this name message ] */
+
+   if (duk_get_length(ctx, -2) == 0) {
+   /* name is empty -> return message */
+   return 1;
+   }
+   if (duk_get_length(ctx, -1) == 0) {
+   /* message is empty -> return name */
+   duk_pop(ctx);
+   return 1;
+   }
+   duk_push_string(ctx, ": ");
+   duk_insert(ctx, -2);  /* ... name ': ' message */
+   duk_concat(ctx, 3);
+
+   return 1;
+}
+
+#if defined(DUK_USE_TRACEBACKS)
+
+/*
+ *  Traceback handling
+ *
+ *  The unified helper decodes the traceback and produces various requested
+ *  outputs.  It should be optimized for size, and may leave garbage on stack,
+ *  only the topmost return value matters.  For instance, traceback separator
+ *  and decoded strings are pushed even when looking for filename only.
+ *
+ *  NOTE: although _Tracedata is an internal property, user code can currently
+ *  write to the array (or replace it with something other than an array).
+ *  The code below must tolerate arbitrary _Tracedata.  It can throw errors
+ *  etc, but cannot cause a segfault or memory unsafe behavior.
+ */
+
+/* constants arbitrary, chosen for small loads */
+#define DUK__OUTPUT_TYPE_TRACEBACK   (-1)
+#define DUK__OUTPUT_TYPE_FILENAME0
+#define DUK__OUTPUT_TYPE_LINENUMBER  1
+
+DUK_LOCAL duk_ret_t duk__error_getter_helper(duk_context *ctx, duk_small_int_t 
output_type) {
+   duk_hthread *thr = (duk_hthread *) ctx;
+   duk_idx_t idx_td;
+   duk_small_int_t i;  /* traceback depth fits into 16 bits */
+   duk_small_int_t t;  /* stack type fits into 16 bits */
+   duk_small_int_t count_func = 0;  /* traceback depth ensures fits into 
16 bits */
+   const char *str_tailcall = " 

[06/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_config.h
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_config.h
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_config.h
new file mode 100644
index 000..ef62235
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_config.h
@@ -0,0 +1,3804 @@
+/*
+ *  duk_config.h configuration header generated by genconfig.py.
+ *
+ *  Git commit: cad34ae155acb0846545ca6bf2d29f9463b22bbb
+ *  Git describe: v1.5.2
+ *  Git branch: HEAD
+ *
+ *  Supported platforms:
+ *  - Mac OSX, iPhone, Darwin
+ *  - OpenBSD
+ *  - Generic BSD
+ *  - Atari ST TOS
+ *  - AmigaOS
+ *  - Windows
+ *  - Flashplayer (Crossbridge)
+ *  - QNX
+ *  - TI-Nspire
+ *  - Emscripten
+ *  - Linux
+ *  - Solaris
+ *  - Generic POSIX
+ *  - Cygwin
+ *  - Generic UNIX
+ *  - Generic fallback
+ *
+ *  Supported architectures:
+ *  - x86
+ *  - x64
+ *  - x32
+ *  - ARM 32-bit
+ *  - ARM 64-bit
+ *  - MIPS 32-bit
+ *  - MIPS 64-bit
+ *  - PowerPC 32-bit
+ *  - PowerPC 64-bit
+ *  - SPARC 32-bit
+ *  - SPARC 64-bit
+ *  - SuperH
+ *  - Motorola 68k
+ *  - Emscripten
+ *  - Generic
+ *
+ *  Supported compilers:
+ *  - Clang
+ *  - GCC
+ *  - MSVC
+ *  - Emscripten
+ *  - TinyC
+ *  - VBCC
+ *  - Bruce's C compiler
+ *  - Generic
+ *
+ */
+
+#if !defined(DUK_CONFIG_H_INCLUDED)
+#define DUK_CONFIG_H_INCLUDED
+
+/*
+ *  Intermediate helper defines
+ */
+
+/* DLL build detection */
+#if defined(DUK_OPT_DLL_BUILD)
+#define DUK_F_DLL_BUILD
+#elif defined(DUK_OPT_NO_DLL_BUILD)
+#undef DUK_F_DLL_BUILD
+#else
+/* not configured for DLL build */
+#undef DUK_F_DLL_BUILD
+#endif
+
+/* Apple OSX, iOS */
+#if defined(__APPLE__)
+#define DUK_F_APPLE
+#endif
+
+/* OpenBSD */
+#if defined(__OpenBSD__) || defined(__OpenBSD)
+#define DUK_F_OPENBSD
+#endif
+
+/* NetBSD */
+#if defined(__NetBSD__) || defined(__NetBSD)
+#define DUK_F_NETBSD
+#endif
+
+/* FreeBSD */
+#if defined(__FreeBSD__) || defined(__FreeBSD)
+#define DUK_F_FREEBSD
+#endif
+
+/* BSD variant */
+#if defined(DUK_F_FREEBSD) || defined(DUK_F_NETBSD) || defined(DUK_F_OPENBSD) 
|| \
+defined(__bsdi__) || defined(__DragonFly__)
+#define DUK_F_BSD
+#endif
+
+/* Atari ST TOS.  __TOS__ defined by PureC.  No platform define in VBCC
+ * apparently, so to use with VBCC user must define __TOS__ manually.
+  */
+#if defined(__TOS__)
+#define DUK_F_TOS
+#endif
+
+/* Motorola 68K.  Not defined by VBCC, so user must define one of these
+ * manually when using VBCC.
+ */
+#if defined(__m68k__) || defined(M68000) || defined(__MC68K__)
+#define DUK_F_M68K
+#endif
+
+/* AmigaOS.  Neither AMIGA nor __amigaos__ is defined on VBCC, so user must
+ * define 'AMIGA' manually when using VBCC.
+ */
+#if defined(AMIGA) || defined(__amigaos__)
+#define DUK_F_AMIGAOS
+#endif
+
+/* PowerPC */
+#if defined(__powerpc) || defined(__powerpc__) || defined(__PPC__)
+#define DUK_F_PPC
+#if defined(__PPC64__) || defined(__LP64__) || defined(_LP64)
+#define DUK_F_PPC64
+#else
+#define DUK_F_PPC32
+#endif
+#endif
+
+/* Windows, both 32-bit and 64-bit */
+#if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) || \
+defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
+#define DUK_F_WINDOWS
+#if defined(_WIN64) || defined(WIN64)
+#define DUK_F_WIN64
+#else
+#define DUK_F_WIN32
+#endif
+#endif
+
+/* Flash player (e.g. Crossbridge) */
+#if defined(__FLASHPLAYER__)
+#define DUK_F_FLASHPLAYER
+#endif
+
+/* QNX */
+#if defined(__QNX__)
+#define DUK_F_QNX
+#endif
+
+/* TI-Nspire (using Ndless) */
+#if defined(_TINSPIRE)
+#define DUK_F_TINSPIRE
+#endif
+
+/* Emscripten (provided explicitly by user), improve if possible */
+#if defined(EMSCRIPTEN)
+#define DUK_F_EMSCRIPTEN
+#endif
+
+/* BCC (Bruce's C compiler): this is a "torture target" for compilation */
+#if defined(__BCC__) || defined(__BCC_VERSION__)
+#define DUK_F_BCC
+#endif
+
+/* Linux */
+#if defined(__linux) || defined(__linux__) || defined(linux)
+#define DUK_F_LINUX
+#endif
+
+/* illumos / Solaris */
+#if defined(__sun) && defined(__SVR4)
+#define DUK_F_SUN
+#endif
+
+/* POSIX */
+#if defined(__posix)
+#define DUK_F_POSIX
+#endif
+
+/* Cygwin */
+#if defined(__CYGWIN__)
+#define DUK_F_CYGWIN
+#endif
+
+/* Generic Unix (includes Cygwin) */
+#if defined(__unix) || defined(__unix__) || defined(unix) || \
+defined(DUK_F_LINUX) || defined(DUK_F_BSD)
+#define DUK_F_UNIX
+#endif
+
+/* stdint.h not available */
+#if defined(DUK_F_WINDOWS) && defined(_MSC_VER)
+#if (_MSC_VER < 1700)
+/* VS2012+ has stdint.h, < VS2012 does not (but it's available for download). 
*/
+#define DUK_F_NO_STDINT_H

[27/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/alloc-logging/log2gnuplot.py
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/alloc-logging/log2gnuplot.py
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/alloc-logging/log2gnuplot.py
new file mode 100644
index 000..0528259
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/alloc-logging/log2gnuplot.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python2
+#
+#  Analyze allocator logs and write total-bytes-in-use after every
+#  operation to stdout.  The output can be gnuplotted as:
+#
+#  $ python log2gnuplot.py /tmp/output.txt
+#  $ gnuplot
+#  > plot "output.txt" with lines
+#
+
+import os
+import sys
+
+def main():
+   allocated = 0
+
+   for line in sys.stdin:
+   line = line.strip()
+   parts = line.split(' ')
+
+   # A ptr/NULL/FAIL size
+   # F ptr/NULL size
+   # R ptr/NULL oldsize ptr/NULL/FAIL newsize
+
+   # Note: ajduk doesn't log oldsize (uses -1 instead)
+
+   if parts[0] == 'A':
+   if parts[1] != 'NULL' and parts[1] != 'FAIL':
+   allocated += long(parts[2])
+   elif parts[0] == 'F':
+   allocated -= long(parts[2])
+   elif parts[0] == 'R':
+   allocated -= long(parts[2])
+   if parts[3] != 'NULL' and parts[3] != 'FAIL':
+   allocated += long(parts[4])
+   print(allocated)
+
+   print(allocated)
+
+if __name__ == '__main__':
+   main()

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/alloc-torture/README.rst
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/alloc-torture/README.rst
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/alloc-torture/README.rst
new file mode 100644
index 000..f3278bb
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/alloc-torture/README.rst
@@ -0,0 +1,10 @@
+==
+Allocator with memory wiping and red zones
+==
+
+Example allocator that wipes memory on free and checks that no out-of-bounds
+writes have been made to bytes just before and after the allocated area.
+
+Valgrind is a better tool for detecting these memory issues, but it's not
+available for all targets so you can use something like this to detect
+memory lifecycle or out-of-bounds issues.

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/alloc-torture/duk_alloc_torture.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/alloc-torture/duk_alloc_torture.c
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/alloc-torture/duk_alloc_torture.c
new file mode 100644
index 000..abca2f7
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/alloc-torture/duk_alloc_torture.c
@@ -0,0 +1,182 @@
+/*
+ *  Example torture memory allocator with memory wiping and check for
+ *  out-of-bounds writes.
+ *
+ *  Allocation structure:
+ *
+ *[ alloc_hdr | red zone before | user area | red zone after ]
+ *
+ * ^ ^
+ * | `--- pointer returned to Duktape
+ * `--- underlying malloc ptr
+ */
+
+#include "duktape.h"
+#include 
+#include 
+#include 
+#include 
+
+#define  RED_ZONE_SIZE  16
+#define  RED_ZONE_BYTE  0x5a
+#define  INIT_BYTE  0xa5
+#define  WIPE_BYTE  0x27
+
+typedef struct {
+   /* The double value in the union is there to ensure alignment is
+* good for IEEE doubles too.  In many 32-bit environments 4 bytes
+* would be sufficiently aligned and the double value is unnecessary.
+*/
+   union {
+   size_t sz;
+   double d;
+   } u;
+} alloc_hdr;
+
+static void check_red_zone(alloc_hdr *hdr) {
+   size_t size;
+   int i;
+   int err;
+   unsigned char *p;
+   unsigned char *userptr;
+
+   size = hdr->u.sz;
+   userptr = (unsigned char *) hdr + sizeof(alloc_hdr) + RED_ZONE_SIZE;
+
+   err = 0;
+   p = (unsigned char *) hdr + sizeof(alloc_hdr);
+   for (i = 0; i < RED_ZONE_SIZE; i++) {
+   if (p[i] != RED_ZONE_BYTE) {
+   err = 1;
+   }
+   }
+   if (err) {
+   fprintf(stderr, "RED ZONE CORRUPTED 

[09/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_string.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_string.c
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_string.c
new file mode 100644
index 000..bf43750
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_string.c
@@ -0,0 +1,1314 @@
+/*
+ *  String built-ins
+ */
+
+/* XXX: There are several limitations in the current implementation for
+ * strings with >= 0x8000UL characters.  In some cases one would need
+ * to be able to represent the range [-0x,0x] and so on.
+ * Generally character and byte length are assumed to fit into signed 32
+ * bits (< 0x8000UL).  Places with issues are not marked explicitly
+ * below in all cases, look for signed type usage (duk_int_t etc) for
+ * offsets/lengths.
+ */
+
+#include "duk_internal.h"
+
+/*
+ *  Constructor
+ */
+
+DUK_INTERNAL duk_ret_t duk_bi_string_constructor(duk_context *ctx) {
+   /* String constructor needs to distinguish between an argument not 
given at all
+* vs. given as 'undefined'.  We're a vararg function to handle this 
properly.
+*/
+
+   if (duk_get_top(ctx) == 0) {
+   duk_push_hstring_stridx(ctx, DUK_STRIDX_EMPTY_STRING);
+   } else {
+   duk_to_string(ctx, 0);
+   }
+   DUK_ASSERT(duk_is_string(ctx, 0));
+   duk_set_top(ctx, 1);
+
+   if (duk_is_constructor_call(ctx)) {
+   duk_push_object_helper(ctx,
+  DUK_HOBJECT_FLAG_EXTENSIBLE |
+  DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ |
+  
DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_STRING),
+  DUK_BIDX_STRING_PROTOTYPE);
+
+   /* String object internal value is immutable */
+   duk_dup(ctx, 0);
+   duk_xdef_prop_stridx(ctx, -2, DUK_STRIDX_INT_VALUE, 
DUK_PROPDESC_FLAGS_NONE);
+   }
+   /* Note: unbalanced stack on purpose */
+
+   return 1;
+}
+
+DUK_INTERNAL duk_ret_t duk_bi_string_constructor_from_char_code(duk_context 
*ctx) {
+   duk_hthread *thr = (duk_hthread *) ctx;
+   duk_bufwriter_ctx bw_alloc;
+   duk_bufwriter_ctx *bw;
+   duk_idx_t i, n;
+   duk_ucodepoint_t cp;
+
+   /* XXX: It would be nice to build the string directly but ToUint16()
+* coercion is needed so a generic helper would not be very
+* helpful (perhaps coerce the value stack first here and then
+* build a string from a duk_tval number sequence in one go?).
+*/
+
+   n = duk_get_top(ctx);
+
+   bw = _alloc;
+   DUK_BW_INIT_PUSHBUF(thr, bw, n);  /* initial estimate for ASCII only 
codepoints */
+
+   for (i = 0; i < n; i++) {
+   /* XXX: could improve bufwriter handling to write multiple 
codepoints
+* with one ensure call but the relative benefit would be quite 
small.
+*/
+
+#if defined(DUK_USE_NONSTD_STRING_FROMCHARCODE_32BIT)
+   /* ToUint16() coercion is mandatory in the E5.1 specification, 
but
+* this non-compliant behavior makes more sense because we 
support
+* non-BMP codepoints.  Don't use CESU-8 because that'd create
+* surrogate pairs.
+*/
+
+   cp = (duk_ucodepoint_t) duk_to_uint32(ctx, i);
+   DUK_BW_WRITE_ENSURE_XUTF8(thr, bw, cp);
+#else
+   cp = (duk_ucodepoint_t) duk_to_uint16(ctx, i);
+   DUK_BW_WRITE_ENSURE_CESU8(thr, bw, cp);
+#endif
+   }
+
+   DUK_BW_COMPACT(thr, bw);
+   duk_to_string(ctx, -1);
+   return 1;
+}
+
+/*
+ *  toString(), valueOf()
+ */
+
+DUK_INTERNAL duk_ret_t duk_bi_string_prototype_to_string(duk_context *ctx) {
+   duk_tval *tv;
+
+   duk_push_this(ctx);
+   tv = duk_require_tval(ctx, -1);
+   DUK_ASSERT(tv != NULL);
+
+   if (DUK_TVAL_IS_STRING(tv)) {
+   /* return as is */
+   return 1;
+   } else if (DUK_TVAL_IS_OBJECT(tv)) {
+   duk_hobject *h = DUK_TVAL_GET_OBJECT(tv);
+   DUK_ASSERT(h != NULL);
+
+   /* Must be a "string object", i.e. class "String" */
+   if (DUK_HOBJECT_GET_CLASS_NUMBER(h) != 
DUK_HOBJECT_CLASS_STRING) {
+   goto type_error;
+   }
+
+   duk_get_prop_stridx(ctx, -1, DUK_STRIDX_INT_VALUE);
+   DUK_ASSERT(duk_is_string(ctx, -1));
+
+   return 1;
+   } else {
+   goto type_error;
+   }
+
+   /* never here, but fall through */
+
+ type_error:
+   return DUK_RET_TYPE_ERROR;
+}
+
+/*
+ *  Character and 

[29/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/debugger/duk_debug_meta.json
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/debugger/duk_debug_meta.json
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/debugger/duk_debug_meta.json
new file mode 100644
index 000..41de1c2
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/debugger/duk_debug_meta.json
@@ -0,0 +1,1497 @@
+{
+"opcodes": [
+{
+"args": [
+"A_R", 
+"BC_R"
+], 
+"name": "LDREG"
+}, 
+{
+"args": [
+"A_R", 
+"BC_R"
+], 
+"name": "STREG"
+}, 
+{
+"args": [
+"A_R", 
+"BC_C"
+], 
+"name": "LDCONST"
+}, 
+{
+"args": [
+"A_R", 
+"BC_LDINT"
+], 
+"name": "LDINT"
+}, 
+{
+"args": [
+"A_R", 
+"BC_LDINTX"
+], 
+"name": "LDINTX"
+}, 
+{
+"args": [
+"A_R", 
+"B_R", 
+"C_I"
+], 
+"name": "MPUTOBJ"
+}, 
+{
+"args": [
+"A_R", 
+"B_RI", 
+"C_I"
+], 
+"name": "MPUTOBJI"
+}, 
+{
+"args": [
+"A_R", 
+"B_R", 
+"C_I"
+], 
+"name": "MPUTARR"
+}, 
+{
+"args": [
+"A_R", 
+"B_RI", 
+"C_I"
+], 
+"name": "MPUTARRI"
+}, 
+{
+"args": [
+"B_R", 
+"C_I"
+], 
+"name": "NEW"
+}, 
+{
+"args": [
+"B_RI", 
+"C_I"
+], 
+"name": "NEWI"
+}, 
+{
+"args": [
+"A_R", 
+"B_RC", 
+"C_RC"
+], 
+"name": "REGEXP"
+}, 
+{
+"args": [
+"A_R", 
+"B_R"
+], 
+"name": "CSREG"
+}, 
+{
+"args": [
+"A_RI", 
+"B_R"
+], 
+"name": "CSREGI"
+}, 
+{
+"args": [
+"A_R", 
+"BC_C"
+], 
+"name": "GETVAR"
+}, 
+{
+"args": [
+"A_R", 
+"BC_C"
+], 
+"name": "PUTVAR"
+}, 
+{
+"args": [
+"A_H", 
+"B_RC", 
+"C_RC"
+], 
+"flags": [
+{
+"mask": 64, 
+"name": "writable"
+}, 
+{
+"mask": 128, 
+"name": "enumerable"
+}, 
+{
+"mask": 256, 
+"name": "configurable"
+}, 
+{
+"mask": 512, 
+"name": "accessor"
+}, 
+{
+"mask": 1024, 
+"name": "undef_value"
+}, 
+{
+"mask": 2048, 
+"name": "func_decl"
+}
+], 
+"name": "DECLVAR"
+}, 
+{
+"args": [
+"A_R", 
+"B_RC"
+], 
+"name": "DELVAR"
+}, 
+{
+"args": [
+"A_R", 
+"B_RC"
+], 
+"name": "CSVAR"
+}, 
+{
+"args": [
+"A_RI", 
+"B_RC"
+], 
+"name": "CSVARI"
+}, 
+{
+"args": [
+"A_R", 
+"BC_I"
+], 
+"name": "CLOSURE"
+}, 
+{
+"args": [
+"A_R", 
+"B_RC", 
+"C_RC"
+], 
+"name": "GETPROP"
+}, 
+{
+"args": [
+"A_R", 
+"B_RC", 
+"C_RC"
+], 
+"name": "PUTPROP"
+}, 
+{
+"args": [
+"A_R", 
+"B_R", 
+"C_RC"
+], 
+"name": "DELPROP"
+   

[38/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/civetweb.c
--
diff --git a/thirdparty/civetweb-1.10/src/civetweb.c 
b/thirdparty/civetweb-1.10/src/civetweb.c
new file mode 100644
index 000..43412b0
--- /dev/null
+++ b/thirdparty/civetweb-1.10/src/civetweb.c
@@ -0,0 +1,18064 @@
+/* Copyright (c) 2013-2017 the Civetweb developers
+ * Copyright (c) 2004-2013 Sergey Lyubka
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#if defined(_WIN32)
+#if !defined(_CRT_SECURE_NO_WARNINGS)
+#define _CRT_SECURE_NO_WARNINGS /* Disable deprecation warning in VS2005 */
+#endif
+#ifndef _WIN32_WINNT /* defined for tdm-gcc so we can use getnameinfo */
+#define _WIN32_WINNT 0x0501
+#endif
+#else
+#if defined(__GNUC__) && !defined(_GNU_SOURCE)
+#define _GNU_SOURCE /* for setgroups() */
+#endif
+#if defined(__linux__) && !defined(_XOPEN_SOURCE)
+#define _XOPEN_SOURCE 600 /* For flockfile() on Linux */
+#endif
+#ifndef _LARGEFILE_SOURCE
+#define _LARGEFILE_SOURCE /* For fseeko(), ftello() */
+#endif
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64 /* Use 64-bit file offsets by default */
+#endif
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS /*  wants this for C++ */
+#endif
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS /* C++ wants that for INT64_MAX */
+#endif
+#ifdef __sun
+#define __EXTENSIONS__  /* to expose flockfile and friends in stdio.h */
+#define __inline inline /* not recognized on older compiler versions */
+#endif
+#endif
+
+#if defined(USE_LUA)
+#define USE_TIMERS
+#endif
+
+#if defined(_MSC_VER)
+/* 'type cast' : conversion from 'int' to 'HANDLE' of greater size */
+#pragma warning(disable : 4306)
+/* conditional expression is constant: introduced by FD_SET(..) */
+#pragma warning(disable : 4127)
+/* non-constant aggregate initializer: issued due to missing C99 support */
+#pragma warning(disable : 4204)
+/* padding added after data member */
+#pragma warning(disable : 4820)
+/* not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */
+#pragma warning(disable : 4668)
+/* no function prototype given: converting '()' to '(void)' */
+#pragma warning(disable : 4255)
+/* function has been selected for automatic inline expansion */
+#pragma warning(disable : 4711)
+#endif
+
+
+/* This code uses static_assert to check some conditions.
+ * Unfortunately some compilers still do not support it, so we have a
+ * replacement function here. */
+#if defined(_MSC_VER) && (_MSC_VER >= 1600)
+#define mg_static_assert static_assert
+#elif defined(__cplusplus) && (__cplusplus >= 201103L)
+#define mg_static_assert static_assert
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
+#define mg_static_assert _Static_assert
+#else
+char static_assert_replacement[1];
+#define mg_static_assert(cond, txt)
\
+   extern char static_assert_replacement[(cond) ? 1 : -1]
+#endif
+
+mg_static_assert(sizeof(int) == 4 || sizeof(int) == 8,
+ "int data type size check");
+mg_static_assert(sizeof(void *) == 4 || sizeof(void *) == 8,
+ "pointer data type size check");
+mg_static_assert(sizeof(void *) >= sizeof(int), "data type size check");
+
+
+/* Alternative queue is well tested and should be the new default */
+#ifdef NO_ALTERNATIVE_QUEUE
+#ifdef ALTERNATIVE_QUEUE
+#error "Define ALTERNATIVE_QUEUE or NO_ALTERNATIVE_QUEUE or none, but not both"
+#endif
+#else
+#define ALTERNATIVE_QUEUE
+#endif
+
+
+/* DTL -- including winsock2.h works better if lean and mean */
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+
+#if defined(__SYMBIAN32__)
+/* According to https://en.wikipedia.org/wiki/Symbian#History,
+ * Symbian is no longer maintained since 2014-01-01.
+ * Recent versions of CivetWeb are no longer tested for Symbian.
+ * It makes no 

[41/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/examples/embedded_cpp/embedded_cpp.cpp
--
diff --git a/thirdparty/civetweb-1.10/examples/embedded_cpp/embedded_cpp.cpp 
b/thirdparty/civetweb-1.10/examples/embedded_cpp/embedded_cpp.cpp
new file mode 100644
index 000..d45a573
--- /dev/null
+++ b/thirdparty/civetweb-1.10/examples/embedded_cpp/embedded_cpp.cpp
@@ -0,0 +1,432 @@
+/* Copyright (c) 2013-2017 the Civetweb developers
+ * Copyright (c) 2013 No Face Press, LLC
+ * License http://opensource.org/licenses/mit-license.php MIT License
+ */
+
+// Simple example program on how to use Embedded C++ interface.
+
+#include "CivetServer.h"
+#include 
+
+#ifdef _WIN32
+#include 
+#else
+#include 
+#endif
+
+#define DOCUMENT_ROOT "."
+#define PORT "8081"
+#define EXAMPLE_URI "/example"
+#define EXIT_URI "/exit"
+bool exitNow = false;
+
+class ExampleHandler : public CivetHandler
+{
+  public:
+   bool
+   handleGet(CivetServer *server, struct mg_connection *conn)
+   {
+   mg_printf(conn,
+ "HTTP/1.1 200 OK\r\nContent-Type: "
+ "text/html\r\nConnection: close\r\n\r\n");
+   mg_printf(conn, "\r\n");
+   mg_printf(conn,
+ "This is an example text from a C++ 
handler\r\n");
+   mg_printf(conn,
+ "To see a page from the A handler click here\r\n");
+   mg_printf(conn,
+ "To see a page from the A handler with a parameter 
"
+ "click here\r\n");
+   mg_printf(conn,
+ "To see a page from the A/B handler click here\r\n");
+   mg_printf(conn,
+ "To see a page from the *.foo handler click here\r\n");
+   mg_printf(conn,
+ "To see a page from the WebSocket handler click here\r\n");
+   mg_printf(conn,
+ "To exit click here\r\n",
+ EXIT_URI);
+   mg_printf(conn, "\r\n");
+   return true;
+   }
+};
+
+class ExitHandler : public CivetHandler
+{
+  public:
+   bool
+   handleGet(CivetServer *server, struct mg_connection *conn)
+   {
+   mg_printf(conn,
+ "HTTP/1.1 200 OK\r\nContent-Type: "
+ "text/plain\r\nConnection: close\r\n\r\n");
+   mg_printf(conn, "Bye!\n");
+   exitNow = true;
+   return true;
+   }
+};
+
+class AHandler : public CivetHandler
+{
+  private:
+   bool
+   handleAll(const char *method,
+ CivetServer *server,
+ struct mg_connection *conn)
+   {
+   std::string s = "";
+   mg_printf(conn,
+ "HTTP/1.1 200 OK\r\nContent-Type: "
+ "text/html\r\nConnection: close\r\n\r\n");
+   mg_printf(conn, "");
+   mg_printf(conn, "This is the A handler for \"%s\" !", 
method);
+   if (CivetServer::getParam(conn, "param", s)) {
+   mg_printf(conn, "param set to %s", s.c_str());
+   } else {
+   mg_printf(conn, "param not set");
+   }
+   mg_printf(conn, "\n");
+   return true;
+   }
+
+  public:
+   bool
+   handleGet(CivetServer *server, struct mg_connection *conn)
+   {
+   return handleAll("GET", server, conn);
+   }
+   bool
+   handlePost(CivetServer *server, struct mg_connection *conn)
+   {
+   return handleAll("POST", server, conn);
+   }
+};
+
+class ABHandler : public CivetHandler
+{
+  public:
+   bool
+   handleGet(CivetServer *server, struct mg_connection *conn)
+   {
+   mg_printf(conn,
+ "HTTP/1.1 200 OK\r\nContent-Type: "
+ "text/html\r\nConnection: close\r\n\r\n");
+   mg_printf(conn, "");
+   mg_printf(conn, "This is the AB handler!!!");
+   mg_printf(conn, "\n");
+   return true;
+   }
+};
+
+class FooHandler : public CivetHandler
+{
+  public:
+   bool
+   handleGet(CivetServer *server, struct mg_connection *conn)
+   {
+   /* Handler may access the request info using 
mg_get_request_info */
+   const struct mg_request_info *req_info = 
mg_get_request_info(conn);
+
+   mg_printf(conn,
+ "HTTP/1.1 200 OK\r\nContent-Type: "
+ "text/html\r\nConnection: close\r\n\r\n");
+
+   mg_printf(conn, "\n");
+   mg_printf(conn, "This is the Foo GET handler!!!\n");
+   mg_printf(conn,
+ "The request was:%s %s 
HTTP/%s\n",
+ 

[10/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_logger.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_logger.c
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_logger.c
new file mode 100644
index 000..d2b89e5
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_logger.c
@@ -0,0 +1,300 @@
+/*
+ *  Logging support
+ */
+
+#include "duk_internal.h"
+
+/* 3-letter log level strings */
+DUK_LOCAL const duk_uint8_t duk__log_level_strings[] = {
+   (duk_uint8_t) DUK_ASC_UC_T, (duk_uint8_t) DUK_ASC_UC_R, (duk_uint8_t) 
DUK_ASC_UC_C,
+   (duk_uint8_t) DUK_ASC_UC_D, (duk_uint8_t) DUK_ASC_UC_B, (duk_uint8_t) 
DUK_ASC_UC_G,
+   (duk_uint8_t) DUK_ASC_UC_I, (duk_uint8_t) DUK_ASC_UC_N, (duk_uint8_t) 
DUK_ASC_UC_F,
+   (duk_uint8_t) DUK_ASC_UC_W, (duk_uint8_t) DUK_ASC_UC_R, (duk_uint8_t) 
DUK_ASC_UC_N,
+   (duk_uint8_t) DUK_ASC_UC_E, (duk_uint8_t) DUK_ASC_UC_R, (duk_uint8_t) 
DUK_ASC_UC_R,
+   (duk_uint8_t) DUK_ASC_UC_F, (duk_uint8_t) DUK_ASC_UC_T, (duk_uint8_t) 
DUK_ASC_UC_L
+};
+
+/* Constructor */
+DUK_INTERNAL duk_ret_t duk_bi_logger_constructor(duk_context *ctx) {
+   duk_hthread *thr = (duk_hthread *) ctx;
+   duk_idx_t nargs;
+
+   /* Calling as a non-constructor is not meaningful. */
+   if (!duk_is_constructor_call(ctx)) {
+   return DUK_RET_TYPE_ERROR;
+   }
+
+   nargs = duk_get_top(ctx);
+   duk_set_top(ctx, 1);
+
+   duk_push_this(ctx);
+
+   /* [ name this ] */
+
+   if (nargs == 0) {
+   /* Automatic defaulting of logger name from caller.  This would
+* work poorly with tail calls, but constructor calls are 
currently
+* never tail calls, so tail calls are not an issue now.
+*/
+
+   if (thr->callstack_top >= 2) {
+   duk_activation *act_caller = thr->callstack + 
thr->callstack_top - 2;
+   duk_hobject *func_caller;
+
+   func_caller = DUK_ACT_GET_FUNC(act_caller);
+   if (func_caller) {
+   /* Stripping the filename might be a good idea
+* ("/foo/bar/quux.js" -> logger name "quux"),
+* but now used verbatim.
+*/
+   duk_push_hobject(ctx, func_caller);
+   duk_get_prop_stridx(ctx, -1, 
DUK_STRIDX_FILE_NAME);
+   duk_replace(ctx, 0);
+   }
+   }
+   }
+   /* the stack is unbalanced here on purpose; we only rely on the
+* initial two values: [ name this ].
+*/
+
+   if (duk_is_string(ctx, 0)) {
+   duk_dup(ctx, 0);
+   duk_put_prop_stridx(ctx, 1, DUK_STRIDX_LC_N);
+   } else {
+   /* don't set 'n' at all, inherited value is used as name */
+   }
+
+   duk_compact(ctx, 1);
+
+   return 0;  /* keep default instance */
+}
+
+/* Default function to format objects.  Tries to use toLogString() but falls
+ * back to toString().  Any errors are propagated out without catching.
+ */
+DUK_INTERNAL duk_ret_t duk_bi_logger_prototype_fmt(duk_context *ctx) {
+   if (duk_get_prop_stridx(ctx, 0, DUK_STRIDX_TO_LOG_STRING)) {
+   /* [ arg toLogString ] */
+
+   duk_dup(ctx, 0);
+   duk_call_method(ctx, 0);
+
+   /* [ arg result ] */
+   return 1;
+   }
+
+   /* [ arg undefined ] */
+   duk_pop(ctx);
+   duk_to_string(ctx, 0);
+   return 1;
+}
+
+/* Default function to write a formatted log line.  Writes to stderr,
+ * appending a newline to the log line.
+ *
+ * The argument is a buffer whose visible size contains the log message.
+ * This function should avoid coercing the buffer to a string to avoid
+ * string table traffic.
+ */
+DUK_INTERNAL duk_ret_t duk_bi_logger_prototype_raw(duk_context *ctx) {
+   const char *data;
+   duk_size_t data_len;
+
+   DUK_UNREF(ctx);
+   DUK_UNREF(data);
+   DUK_UNREF(data_len);
+
+#ifdef DUK_USE_FILE_IO
+   data = (const char *) duk_require_buffer(ctx, 0, _len);
+   DUK_FWRITE((const void *) data, 1, data_len, DUK_STDERR);
+   DUK_FPUTC((int) '\n', DUK_STDERR);
+   DUK_FFLUSH(DUK_STDERR);
+#else
+   /* nop */
+#endif
+   return 0;
+}
+
+/* Log frontend shared helper, magic value indicates log level.  Provides
+ * frontend functions: trace(), debug(), info(), warn(), error(), fatal().
+ * This needs to have small footprint, reasonable performance, minimal
+ * memory churn, etc.
+ */
+DUK_INTERNAL duk_ret_t 

[15/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_api_string.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_api_string.c
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_api_string.c
new file mode 100644
index 000..3f1acac
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_api_string.c
@@ -0,0 +1,331 @@
+/*
+ *  String manipulation
+ */
+
+#include "duk_internal.h"
+
+DUK_LOCAL void duk__concat_and_join_helper(duk_context *ctx, duk_idx_t 
count_in, duk_bool_t is_join) {
+   duk_hthread *thr = (duk_hthread *) ctx;
+   duk_uint_t count;
+   duk_uint_t i;
+   duk_size_t idx;
+   duk_size_t len;
+   duk_hstring *h;
+   duk_uint8_t *buf;
+
+   DUK_ASSERT_CTX_VALID(ctx);
+
+   if (DUK_UNLIKELY(count_in <= 0)) {
+   if (count_in < 0) {
+   DUK_ERROR_API(thr, DUK_STR_INVALID_COUNT);
+   return;
+   }
+   DUK_ASSERT(count_in == 0);
+   duk_push_hstring_stridx(ctx, DUK_STRIDX_EMPTY_STRING);
+   return;
+   }
+   count = (duk_uint_t) count_in;
+
+   if (is_join) {
+   duk_size_t t1, t2, limit;
+   h = duk_to_hstring(ctx, -((duk_idx_t) count) - 1);
+   DUK_ASSERT(h != NULL);
+
+   /* A bit tricky overflow test, see doc/code-issues.rst. */
+   t1 = (duk_size_t) DUK_HSTRING_GET_BYTELEN(h);
+   t2 = (duk_size_t) (count - 1);
+   limit = (duk_size_t) DUK_HSTRING_MAX_BYTELEN;
+   if (DUK_UNLIKELY(t2 != 0 && t1 > limit / t2)) {
+   /* Combined size of separators already overflows */
+   goto error_overflow;
+   }
+   len = (duk_size_t) (t1 * t2);
+   } else {
+   len = (duk_size_t) 0;
+   }
+
+   for (i = count; i >= 1; i--) {
+   duk_size_t new_len;
+   duk_to_string(ctx, -((duk_idx_t) i));
+   h = duk_require_hstring(ctx, -((duk_idx_t) i));
+   new_len = len + (duk_size_t) DUK_HSTRING_GET_BYTELEN(h);
+
+   /* Impose a string maximum length, need to handle overflow
+* correctly.
+*/
+   if (new_len < len ||  /* wrapped */
+   new_len > (duk_size_t) DUK_HSTRING_MAX_BYTELEN) {
+   goto error_overflow;
+   }
+   len = new_len;
+   }
+
+   DUK_DDD(DUK_DDDPRINT("join/concat %lu strings, total length %lu bytes",
+(unsigned long) count, (unsigned long) len));
+
+   /* use stack allocated buffer to ensure reachability in errors (e.g. 
intern error) */
+   buf = (duk_uint8_t *) duk_push_fixed_buffer(ctx, len);
+   DUK_ASSERT(buf != NULL);
+
+   /* [... (sep) str1 str2 ... strN buf] */
+
+   idx = 0;
+   for (i = count; i >= 1; i--) {
+   if (is_join && i != count) {
+   h = duk_require_hstring(ctx, -((duk_idx_t) count) - 2); 
 /* extra -1 for buffer */
+   DUK_MEMCPY(buf + idx, DUK_HSTRING_GET_DATA(h), 
DUK_HSTRING_GET_BYTELEN(h));
+   idx += DUK_HSTRING_GET_BYTELEN(h);
+   }
+   h = duk_require_hstring(ctx, -((duk_idx_t) i) - 1);  /* extra 
-1 for buffer */
+   DUK_MEMCPY(buf + idx, DUK_HSTRING_GET_DATA(h), 
DUK_HSTRING_GET_BYTELEN(h));
+   idx += DUK_HSTRING_GET_BYTELEN(h);
+   }
+
+   DUK_ASSERT(idx == len);
+
+   /* [... (sep) str1 str2 ... strN buf] */
+
+   /* get rid of the strings early to minimize memory use before intern */
+
+   if (is_join) {
+   duk_replace(ctx, -((duk_idx_t) count) - 2);  /* overwrite sep */
+   duk_pop_n(ctx, count);
+   } else {
+   duk_replace(ctx, -((duk_idx_t) count) - 1);  /* overwrite str1 
*/
+   duk_pop_n(ctx, count-1);
+   }
+
+   /* [... buf] */
+
+   (void) duk_to_string(ctx, -1);
+
+   /* [... res] */
+   return;
+
+ error_overflow:
+   DUK_ERROR_RANGE(thr, DUK_STR_CONCAT_RESULT_TOO_LONG);
+}
+
+DUK_EXTERNAL void duk_concat(duk_context *ctx, duk_idx_t count) {
+   DUK_ASSERT_CTX_VALID(ctx);
+
+   duk__concat_and_join_helper(ctx, count, 0 /*is_join*/);
+}
+
+DUK_EXTERNAL void duk_join(duk_context *ctx, duk_idx_t count) {
+   DUK_ASSERT_CTX_VALID(ctx);
+
+   duk__concat_and_join_helper(ctx, count, 1 /*is_join*/);
+}
+
+/* XXX: could map/decode be unified with duk_unicode_support.c code?
+ * Case conversion needs also the character surroundings though.
+ */
+
+DUK_EXTERNAL void duk_decode_string(duk_context *ctx, duk_idx_t index, 

[47/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/VisualStudio/upload/upload.vcxproj
--
diff --git a/thirdparty/civetweb-1.10/VisualStudio/upload/upload.vcxproj 
b/thirdparty/civetweb-1.10/VisualStudio/upload/upload.vcxproj
new file mode 100644
index 000..4aec14c
--- /dev/null
+++ b/thirdparty/civetweb-1.10/VisualStudio/upload/upload.vcxproj
@@ -0,0 +1,160 @@
+
+http://schemas.microsoft.com/developer/msbuild/2003;>
+  
+
+  Debug
+  Win32
+
+
+  Debug
+  x64
+
+
+  Release
+  Win32
+
+
+  Release
+  x64
+
+  
+  
+
+
+  
+  
+
+  
+  
+{882EC43C-2EEE-434B-A711-C845678D29C6}
+Win32Proj
+upload
+8.1
+  
+  
+  
+Application
+true
+v140
+MultiByte
+  
+  
+Application
+true
+v140
+MultiByte
+  
+  
+Application
+false
+v140
+true
+MultiByte
+  
+  
+Application
+false
+v140
+true
+MultiByte
+  
+  
+  
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+  
+true
+$(SolutionDir)\$(Configuration)\$(Platform)\
+  
+  
+true
+$(SolutionDir)\$(Configuration)\$(Platform)\
+  
+  
+false
+$(SolutionDir)\$(Configuration)\$(Platform)\
+  
+  
+false
+$(SolutionDir)\$(Configuration)\$(Platform)\
+  
+  
+
+  
+  
+  Level3
+  Disabled
+  
NO_FILES;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+  
$(ProjectDir)..\..\include;%(AdditionalIncludeDirectories)
+
+
+  Console
+  true
+
+  
+  
+
+  
+  
+  Level3
+  Disabled
+  
NO_FILES;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+  
$(ProjectDir)..\..\include;%(AdditionalIncludeDirectories)
+
+
+  Console
+  true
+
+  
+  
+
+  Level3
+  
+  
+  MaxSpeed
+  true
+  true
+  
NO_FILES;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+  
$(ProjectDir)..\..\include;%(AdditionalIncludeDirectories)
+
+
+  Console
+  true
+  true
+  true
+
+  
+  
+
+  Level3
+  
+  
+  MaxSpeed
+  true
+  true
+  
NO_FILES;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+  
$(ProjectDir)..\..\include;%(AdditionalIncludeDirectories)
+
+
+  Console
+  true
+  true
+  true
+
+  
+  
+  
+  
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/VisualStudio/upload/upload.vcxproj.filters
--
diff --git 
a/thirdparty/civetweb-1.10/VisualStudio/upload/upload.vcxproj.filters 
b/thirdparty/civetweb-1.10/VisualStudio/upload/upload.vcxproj.filters
new file mode 100644
index 000..fb2d247
--- /dev/null
+++ b/thirdparty/civetweb-1.10/VisualStudio/upload/upload.vcxproj.filters
@@ -0,0 +1,30 @@
+
+http://schemas.microsoft.com/developer/msbuild/2003;>
+  
+
+  
{4FC737F1-C7A5-4376-A066-2A322342A2FF}
+  cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+  
{93995380-89BD-4b04-88EB-625FBE52E765}
+  h;hpp;hxx;hm;inl;inc;xsd
+
+
+  
{67DA6AB6-F800-4c08-8B7A-83BB121AA145}
+  
rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+  
+  
+
+  Source Files
+
+
+  Source Files
+
+  
+  
+
+  Header Files
+
+  
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/_config.yml
--
diff --git a/thirdparty/civetweb-1.10/_config.yml 
b/thirdparty/civetweb-1.10/_config.yml
new file mode 100644
index 000..259a24e
--- /dev/null
+++ b/thirdparty/civetweb-1.10/_config.yml
@@ -0,0 +1 @@
+theme: jekyll-theme-tactile
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/appveyor.yml
--
diff --git a/thirdparty/civetweb-1.10/appveyor.yml 
b/thirdparty/civetweb-1.10/appveyor.yml
new file mode 100644
index 000..87455a2
--- /dev/null
+++ b/thirdparty/civetweb-1.10/appveyor.yml
@@ -0,0 +1,386 @@
+version: '{build}'
+
+
+build:
+# no automatic build in script mode
+
+
+skip_commits:
+  # Builds just testing something on Travis CI don't need to be 
+  # done on AppVeyor
+  message: /\[Travis\]/
+  # Dont build, if only documentation was changed
+  files:
+  - '**/*.md'
+
+
+environment:
+  enable_cxx: NO
+  enable_ssl_dynamic_loading: YES
+  enable_lua: NO
+  enable_lua_shared: NO
+  c_standard: auto
+  cxx_standard: auto
+  matrix:
+# Use default values
+

[20/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-noline/duktape.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-noline/duktape.c 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-noline/duktape.c
new file mode 100644
index 000..9a65f55
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-noline/duktape.c
@@ -0,0 +1,86570 @@
+/*
+ *  Single source autogenerated distributable for Duktape 1.5.2.
+ *
+ *  Git commit cad34ae155acb0846545ca6bf2d29f9463b22bbb (v1.5.2).
+ *  Git branch HEAD.
+ *
+ *  See Duktape AUTHORS.rst and LICENSE.txt for copyright and
+ *  licensing information.
+ */
+
+/* LICENSE.txt */
+/*
+*  ===
+*  Duktape license
+*  ===
+*
+*  (http://opensource.org/licenses/MIT)
+*
+*  Copyright (c) 2013-2016 by Duktape authors (see AUTHORS.rst)
+*
+*  Permission is hereby granted, free of charge, to any person obtaining a copy
+*  of this software and associated documentation files (the "Software"), to 
deal
+*  in the Software without restriction, including without limitation the rights
+*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+*  copies of the Software, and to permit persons to whom the Software is
+*  furnished to do so, subject to the following conditions:
+*
+*  The above copyright notice and this permission notice shall be included in
+*  all copies or substantial portions of the Software.
+*
+*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+*  THE SOFTWARE.
+*/
+/* AUTHORS.rst */
+/*
+*  ===
+*  Duktape authors
+*  ===
+*
+*  Copyright
+*  =
+*
+*  Duktape copyrights are held by its authors.  Each author has a copyright
+*  to their contribution, and agrees to irrevocably license the contribution
+*  under the Duktape ``LICENSE.txt``.
+*
+*  Authors
+*  ===
+*
+*  Please include an e-mail address, a link to your GitHub profile, or 
something
+*  similar to allow your contribution to be identified accurately.
+*
+*  The following people have contributed code, website contents, or Wiki 
contents,
+*  and agreed to irrevocably license their contributions under the Duktape
+*  ``LICENSE.txt`` (in order of appearance):
+*
+*  * Sami Vaarala 
+*  * Niki Dobrev
+*  * Andreas \u00d6man 
+*  * L\u00e1szl\u00f3 Lang\u00f3 
+*  * Legimet 
+*  * Karl Skomski 
+*  * Bruce Pascoe 
+*  * Ren\u00e9 Hollander 
+*  * Julien Hamaide (https://github.com/crazyjul)
+*  * Sebastian G\u00f6tte (https://github.com/jaseg)
+*
+*  Other contributions
+*  ===
+*
+*  The following people have contributed something other than code (e.g. 
reported
+*  bugs, provided ideas, etc; roughly in order of appearance):
+*
+*  * Greg Burns
+*  * Anthony Rabine
+*  * Carlos Costa
+*  * Aur\u00e9lien Bouilland
+*  * Preet Desai (Pris Matic)
+*  * judofyr (http://www.reddit.com/user/judofyr)
+*  * Jason Woofenden
+*  * Micha\u0142 Przyby\u015b
+*  * Anthony Howe
+*  * Conrad Pankoff
+*  * Jim Schimpf
+*  * Rajaran Gaunker (https://github.com/zimbabao)
+*  * Andreas \u00d6man
+*  * Doug Sanden
+*  * Josh Engebretson (https://github.com/JoshEngebretson)
+*  * Remo Eichenberger (https://github.com/remoe)
+*  * Mamod Mehyar (https://github.com/mamod)
+*  * David Demelier (https://github.com/markand)
+*  * Tim Caswell (https://github.com/creationix)
+*  * Mitchell Blank Jr (https://github.com/mitchblank)
+*  * https://github.com/yushli
+*  * Seo Sanghyeon (https://github.com/sanxiyn)
+*  * Han ChoongWoo (https://github.com/tunz)
+*  * Joshua Peek (https://github.com/josh)
+*  * Bruce E. Pascoe (https://github.com/fatcerberus)
+*  * https://github.com/Kelledin
+*  * https://github.com/sstruchtrup
+*  * Michael Drake (https://github.com/tlsa)
+*  * https://github.com/chris-y
+*  * Laurent Zubiaur (https://github.com/lzubiaur)
+*  * Ole Andr\u00e9 Vadla Ravn\u00e5s (https://github.com/oleavr)
+*
+*  If you are accidentally missing from this list, send me an e-mail
+*  (``sami.vaar...@iki.fi``) and I'll fix the omission.
+*/
+/*
+ *  Top-level include file to be used for all (internal) source files.
+ *
+ *  Source files should not include individual header files, as they
+ *  have not been designed to be individually included.
+ */
+

[13/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_date.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_date.c
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_date.c
new file mode 100644
index 000..1d5c7b7
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_date.c
@@ -0,0 +1,1728 @@
+/*
+ *  Date built-ins
+ *
+ *  Unlike most built-ins, Date has some platform dependencies for getting
+ *  UTC time, converting between UTC and local time, and parsing and
+ *  formatting time values.  These are all abstracted behind DUK_USE_xxx
+ *  config options.  There are built-in platform specific providers for
+ *  POSIX and Windows, but external providers can also be used.
+ *
+ *  See doc/datetime.rst.
+ *
+ */
+
+#include "duk_internal.h"
+
+/*
+ *  Forward declarations
+ */
+
+DUK_LOCAL_DECL duk_double_t duk__push_this_get_timeval_tzoffset(duk_context 
*ctx, duk_small_uint_t flags, duk_int_t *out_tzoffset);
+DUK_LOCAL_DECL duk_double_t duk__push_this_get_timeval(duk_context *ctx, 
duk_small_uint_t flags);
+DUK_LOCAL_DECL void duk__twodigit_year_fixup(duk_context *ctx, duk_idx_t 
idx_val);
+DUK_LOCAL_DECL duk_ret_t duk__set_this_timeval_from_dparts(duk_context *ctx, 
duk_double_t *dparts, duk_small_uint_t flags);
+
+/*
+ *  Other file level defines
+ */
+
+/* Debug macro to print all parts and dparts (used manually because of debug 
level). */
+#define  DUK__DPRINT_PARTS_AND_DPARTS(parts,dparts)  do { \
+   DUK_D(DUK_DPRINT("parts: %ld %ld %ld %ld %ld %ld %ld %ld, 
dparts: %lf %lf %lf %lf %lf %lf %lf %lf", \
+(long) (parts)[0], (long) (parts)[1], \
+(long) (parts)[2], (long) (parts)[3], \
+(long) (parts)[4], (long) (parts)[5], \
+(long) (parts)[6], (long) (parts)[7], \
+(double) (dparts)[0], (double) (dparts)[1], \
+(double) (dparts)[2], (double) (dparts)[3], \
+(double) (dparts)[4], (double) (dparts)[5], \
+(double) (dparts)[6], (double) (dparts)[7])); \
+   } while (0)
+#define  DUK__DPRINT_PARTS(parts)  do { \
+   DUK_D(DUK_DPRINT("parts: %ld %ld %ld %ld %ld %ld %ld %ld", \
+(long) (parts)[0], (long) (parts)[1], \
+(long) (parts)[2], (long) (parts)[3], \
+(long) (parts)[4], (long) (parts)[5], \
+(long) (parts)[6], (long) (parts)[7])); \
+   } while (0)
+#define  DUK__DPRINT_DPARTS(dparts)  do { \
+   DUK_D(DUK_DPRINT("dparts: %lf %lf %lf %lf %lf %lf %lf %lf", \
+(double) (dparts)[0], (double) (dparts)[1], \
+(double) (dparts)[2], (double) (dparts)[3], \
+(double) (dparts)[4], (double) (dparts)[5], \
+(double) (dparts)[6], (double) (dparts)[7])); \
+   } while (0)
+
+/* Equivalent year for DST calculations outside [1970,2038[ range, see
+ * E5 Section 15.9.1.8.  Equivalent year has the same leap-year-ness and
+ * starts with the same weekday on Jan 1.
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=351066
+ */
+#define DUK__YEAR(x) ((duk_uint8_t) ((x) - 1970))
+DUK_LOCAL duk_uint8_t duk__date_equivyear[14] = {
+#if 1
+   /* This is based on V8 EquivalentYear() algorithm (see 
src/genequivyear.py):
+* http://code.google.com/p/v8/source/browse/trunk/src/date.h#146
+*/
+
+   /* non-leap year: sunday, monday, ... */
+   DUK__YEAR(2023), DUK__YEAR(2035), DUK__YEAR(2019), DUK__YEAR(2031),
+   DUK__YEAR(2015), DUK__YEAR(2027), DUK__YEAR(2011),
+
+   /* leap year: sunday, monday, ... */
+   DUK__YEAR(2012), DUK__YEAR(2024), DUK__YEAR(2008), DUK__YEAR(2020),
+   DUK__YEAR(2032), DUK__YEAR(2016), DUK__YEAR(2028)
+#endif
+
+#if 0
+   /* This is based on Rhino EquivalentYear() algorithm:
+* 
https://github.com/mozilla/rhino/blob/f99cc11d616f0cdda2c42bde72b3484df6182947/src/org/mozilla/javascript/NativeDate.java
+*/
+
+   /* non-leap year: sunday, monday, ... */
+   DUK__YEAR(1978), DUK__YEAR(1973), DUK__YEAR(1985), DUK__YEAR(1986),
+   DUK__YEAR(1981), DUK__YEAR(1971), DUK__YEAR(1977),
+
+   /* leap year: sunday, monday, ... */
+   DUK__YEAR(1984), DUK__YEAR(1996), DUK__YEAR(1980), DUK__YEAR(1992),
+   DUK__YEAR(1976), DUK__YEAR(1988), DUK__YEAR(1972)
+#endif
+};
+#undef DUK__YEAR
+
+/*
+ *  ISO 8601 subset parser.
+ */
+
+/* Parser part count. */
+#define DUK__NUM_ISO8601_PARSER_PARTS  9
+
+/* Parser part 

[48/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/VisualStudio/duktape_lib/duktape_lib.vcxproj
--
diff --git 
a/thirdparty/civetweb-1.10/VisualStudio/duktape_lib/duktape_lib.vcxproj 
b/thirdparty/civetweb-1.10/VisualStudio/duktape_lib/duktape_lib.vcxproj
new file mode 100644
index 000..12fa214
--- /dev/null
+++ b/thirdparty/civetweb-1.10/VisualStudio/duktape_lib/duktape_lib.vcxproj
@@ -0,0 +1,156 @@
+
+http://schemas.microsoft.com/developer/msbuild/2003;>
+  
+
+  Debug
+  Win32
+
+
+  Debug
+  x64
+
+
+  Release
+  Win32
+
+
+  Release
+  x64
+
+  
+  
+{0A11689C-DB6A-4BF6-97B2-AD32DB863FBD}
+Win32Proj
+duktape_lib
+8.1
+  
+  
+  
+StaticLibrary
+true
+MultiByte
+v140_xp
+  
+  
+StaticLibrary
+true
+v140
+MultiByte
+  
+  
+StaticLibrary
+false
+true
+MultiByte
+v140_xp
+  
+  
+StaticLibrary
+false
+v140
+true
+MultiByte
+  
+  
+  
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+  
+$(SolutionDir)\$(Configuration)\$(Platform)\
+  
+  
+$(SolutionDir)\$(Configuration)\$(Platform)\
+  
+  
+$(SolutionDir)\$(Configuration)\$(Platform)\
+  
+  
+$(SolutionDir)\$(Configuration)\$(Platform)\
+  
+  
+
+  
+  
+  TurnOffAllWarnings
+  Disabled
+  
duktape_COMPAT_ALL;THREADSAFE=1;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_FTS3_PARENTHESIS;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+  
$(ProjectDir)..\..\src\third_party\lua-5.2.4\src;%(AdditionalIncludeDirectories)
+
+
+  Windows
+  true
+
+  
+  
+
+  
+  
+  Level3
+  Disabled
+  
duktape_COMPAT_ALL;THREADSAFE=1;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_FTS3_PARENTHESIS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+  
$(ProjectDir)..\..\src\third_party\lua-5.2.4\src;%(AdditionalIncludeDirectories)
+
+
+  Windows
+  true
+
+  
+  
+
+  Level3
+  
+  
+  MaxSpeed
+  true
+  true
+  
duktape_COMPAT_ALL;THREADSAFE=1;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_FTS3_PARENTHESIS;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
+  
$(ProjectDir)..\..\src\third_party\lua-5.2.4\src;%(AdditionalIncludeDirectories)
+
+
+  Windows
+  true
+  true
+  true
+
+  
+  
+
+  Level3
+  
+  
+  MaxSpeed
+  true
+  true
+  
duktape_COMPAT_ALL;THREADSAFE=1;SQLITE_ENABLE_FTS3;SQLITE_ENABLE_FTS3_PARENTHESIS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+  
$(ProjectDir)..\..\src\third_party\lua-5.2.4\src;%(AdditionalIncludeDirectories)
+
+
+  Windows
+  true
+  true
+  true
+
+  
+  
+
+
+  
+  
+
+  
+  
+  
+  
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/VisualStudio/duktape_lib/duktape_lib.vcxproj.filters
--
diff --git 
a/thirdparty/civetweb-1.10/VisualStudio/duktape_lib/duktape_lib.vcxproj.filters 
b/thirdparty/civetweb-1.10/VisualStudio/duktape_lib/duktape_lib.vcxproj.filters
new file mode 100644
index 000..1aab8c8
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/VisualStudio/duktape_lib/duktape_lib.vcxproj.filters
@@ -0,0 +1,30 @@
+
+http://schemas.microsoft.com/developer/msbuild/2003;>
+  
+
+  
{4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+  cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+  
{93995380-89BD-4b04-88EB-625FBE52EBFB}
+  h;hpp;hxx;hm;inl;inc;xsd
+
+
+  
{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+  
rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+  
+  
+
+  Header Files
+
+
+  Header Files
+
+  
+  
+
+  Source Files
+
+  
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/VisualStudio/ex_embed_cpp/ex_embed_cpp.vcxproj
--
diff --git 
a/thirdparty/civetweb-1.10/VisualStudio/ex_embed_cpp/ex_embed_cpp.vcxproj 
b/thirdparty/civetweb-1.10/VisualStudio/ex_embed_cpp/ex_embed_cpp.vcxproj
new file mode 100644
index 000..a195fb6
--- /dev/null
+++ b/thirdparty/civetweb-1.10/VisualStudio/ex_embed_cpp/ex_embed_cpp.vcxproj
@@ -0,0 +1,162 @@
+
+http://schemas.microsoft.com/developer/msbuild/2003;>
+  
+
+  Debug
+  Win32
+
+
+  Debug
+  x64
+
+
+  Release
+  Win32
+
+
+  Release
+  x64
+
+  
+  
+{4308C5EE-45E4-45D8-9D73-6C4E2587AD78}
+Win32Proj
+ex_embed_cpp
+8.1
+  
+  
+  
+   

[30/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/debugger/duk_debug.js
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/debugger/duk_debug.js 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/debugger/duk_debug.js
new file mode 100644
index 000..ab0623f
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/debugger/duk_debug.js
@@ -0,0 +1,2473 @@
+/*
+ *  Minimal debug web console for Duktape command line tool
+ *
+ *  See debugger/README.rst.
+ *
+ *  The web UI socket.io communication can easily become a bottleneck and
+ *  it's important to ensure that the web UI remains responsive.  Basic rate
+ *  limiting mechanisms (token buckets, suppressing identical messages, etc)
+ *  are used here now.  Ideally the web UI would pull data on its own terms
+ *  which would provide natural rate limiting.
+ *
+ *  Promises are used to structure callback chains.
+ *
+ *  https://github.com/petkaantonov/bluebird
+ *  https://github.com/petkaantonov/bluebird/blob/master/API.md
+ *  https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns
+ */
+
+var Promise = require('bluebird');
+var events = require('events');
+var stream = require('stream');
+var path = require('path');
+var fs = require('fs');
+var net = require('net');
+var byline = require('byline');
+var util = require('util');
+var readline = require('readline');
+var sprintf = require('sprintf').sprintf;
+var utf8 = require('utf8');
+var wrench = require('wrench');  // https://github.com/ryanmcgrath/wrench-js
+var yaml = require('yamljs');
+
+// Command line options (defaults here, overwritten if necessary)
+var optTargetHost = '127.0.0.1';
+var optTargetPort = 9091;
+var optHttpPort = 9092;
+var optJsonProxyPort = 9093;
+var optJsonProxy = false;
+var optSourceSearchDirs = [ '../tests/ecmascript' ];
+var optDumpDebugRead = null;
+var optDumpDebugWrite = null;
+var optDumpDebugPretty = null;
+var optLogMessages = false;
+
+// Constants
+var UI_MESSAGE_CLIPLEN = 128;
+var LOCALS_CLIPLEN = 64;
+var EVAL_CLIPLEN = 4096;
+var GETVAR_CLIPLEN = 4096;
+
+// Commands initiated by Duktape
+var CMD_STATUS = 0x01;
+var CMD_PRINT = 0x02;
+var CMD_ALERT = 0x03;
+var CMD_LOG = 0x04;
+var CMD_THROW = 0x05;
+var CMD_DETACHING = 0x06;
+
+// Commands initiated by the debug client (= us)
+var CMD_BASICINFO = 0x10;
+var CMD_TRIGGERSTATUS = 0x11;
+var CMD_PAUSE = 0x12;
+var CMD_RESUME = 0x13;
+var CMD_STEPINTO = 0x14;
+var CMD_STEPOVER = 0x15;
+var CMD_STEPOUT = 0x16;
+var CMD_LISTBREAK = 0x17;
+var CMD_ADDBREAK = 0x18;
+var CMD_DELBREAK = 0x19;
+var CMD_GETVAR = 0x1a;
+var CMD_PUTVAR = 0x1b;
+var CMD_GETCALLSTACK = 0x1c;
+var CMD_GETLOCALS = 0x1d;
+var CMD_EVAL = 0x1e;
+var CMD_DETACH = 0x1f;
+var CMD_DUMPHEAP = 0x20;
+var CMD_GETBYTECODE = 0x21;
+
+// Errors
+var ERR_UNKNOWN = 0x00;
+var ERR_UNSUPPORTED = 0x01;
+var ERR_TOOMANY = 0x02;
+var ERR_NOTFOUND = 0x03;
+
+// Marker objects for special protocol values
+var DVAL_EOM = { type: 'eom' };
+var DVAL_REQ = { type: 'req' };
+var DVAL_REP = { type: 'rep' };
+var DVAL_ERR = { type: 'err' };
+var DVAL_NFY = { type: 'nfy' };
+
+// String map for commands (debug dumping).  A single map works (instead of
+// separate maps for each direction) because command numbers don't currently
+// overlap.  So merge the YAML metadata.
+var debugCommandMeta = yaml.load('duk_debugcommands.yaml');
+var debugCommandNames = [];  // list of command names, merged client/target
+debugCommandMeta.target_commands.forEach(function (k, i) {
+debugCommandNames[i] = k;
+});
+debugCommandMeta.client_commands.forEach(function (k, i) {  // override
+debugCommandNames[i] = k;
+});
+var debugCommandNumbers = {};  // map from (merged) command name to number
+debugCommandNames.forEach(function (k, i) {
+debugCommandNumbers[k] = i;
+});
+
+// Duktape heaphdr type constants, must match C headers
+var DUK_HTYPE_STRING = 1;
+var DUK_HTYPE_OBJECT = 2;
+var DUK_HTYPE_BUFFER = 3;
+
+// Duktape internal class numbers, must match C headers
+var dukClassNameMeta = yaml.load('duk_classnames.yaml');
+var dukClassNames = dukClassNameMeta.class_names;
+
+// Bytecode opcode/extraop metadata
+var dukOpcodes = yaml.load('duk_opcodes.yaml');
+if (dukOpcodes.opcodes.length != 64) {
+throw new Error('opcode metadata length incorrect');
+}
+if (dukOpcodes.extra.length != 256) {
+throw new Error('extraop metadata length incorrect');
+}
+
+/*
+ *  Miscellaneous helpers
+ */
+
+var nybbles = '0123456789abcdef';
+
+/* Convert a buffer into a string using Unicode codepoints U+...U+00FF.
+ * This is the NodeJS 'binary' encoding, but since it's being deprecated,
+ * reimplement it here.  We need to avoid parsing strings as e.g. UTF-8:
+ * although Duktape strings are usually UTF-8/CESU-8 that's not always the
+ * case, e.g. for internal strings.  Buffer values 

[33/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/config/duk_config.h-modular-dll
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/config/duk_config.h-modular-dll
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/config/duk_config.h-modular-dll
new file mode 100644
index 000..5d5d013
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/config/duk_config.h-modular-dll
@@ -0,0 +1,3415 @@
+/*
+ *  duk_config.h configuration header generated by genconfig.py.
+ *
+ *  Git commit: cad34ae155acb0846545ca6bf2d29f9463b22bbb
+ *  Git describe: v1.5.2
+ *  Git branch: HEAD
+ *
+ *  Supported platforms:
+ *  - Mac OSX, iPhone, Darwin
+ *  - OpenBSD
+ *  - Generic BSD
+ *  - Atari ST TOS
+ *  - AmigaOS
+ *  - Windows
+ *  - Flashplayer (Crossbridge)
+ *  - QNX
+ *  - TI-Nspire
+ *  - Emscripten
+ *  - Linux
+ *  - Solaris
+ *  - Generic POSIX
+ *  - Cygwin
+ *  - Generic UNIX
+ *  - Generic fallback
+ *
+ *  Supported architectures:
+ *  - x86
+ *  - x64
+ *  - x32
+ *  - ARM 32-bit
+ *  - ARM 64-bit
+ *  - MIPS 32-bit
+ *  - MIPS 64-bit
+ *  - PowerPC 32-bit
+ *  - PowerPC 64-bit
+ *  - SPARC 32-bit
+ *  - SPARC 64-bit
+ *  - SuperH
+ *  - Motorola 68k
+ *  - Emscripten
+ *  - Generic
+ *
+ *  Supported compilers:
+ *  - Clang
+ *  - GCC
+ *  - MSVC
+ *  - Emscripten
+ *  - TinyC
+ *  - VBCC
+ *  - Bruce's C compiler
+ *  - Generic
+ *
+ */
+
+#if !defined(DUK_CONFIG_H_INCLUDED)
+#define DUK_CONFIG_H_INCLUDED
+
+/*
+ *  Intermediate helper defines
+ */
+
+/* DLL build detection */
+#if defined(DUK_OPT_DLL_BUILD)
+#define DUK_F_DLL_BUILD
+#elif defined(DUK_OPT_NO_DLL_BUILD)
+#undef DUK_F_DLL_BUILD
+#else
+/* configured for DLL build */
+#define DUK_F_DLL_BUILD
+#endif
+
+/* Apple OSX, iOS */
+#if defined(__APPLE__)
+#define DUK_F_APPLE
+#endif
+
+/* OpenBSD */
+#if defined(__OpenBSD__) || defined(__OpenBSD)
+#define DUK_F_OPENBSD
+#endif
+
+/* NetBSD */
+#if defined(__NetBSD__) || defined(__NetBSD)
+#define DUK_F_NETBSD
+#endif
+
+/* FreeBSD */
+#if defined(__FreeBSD__) || defined(__FreeBSD)
+#define DUK_F_FREEBSD
+#endif
+
+/* BSD variant */
+#if defined(DUK_F_FREEBSD) || defined(DUK_F_NETBSD) || defined(DUK_F_OPENBSD) 
|| \
+defined(__bsdi__) || defined(__DragonFly__)
+#define DUK_F_BSD
+#endif
+
+/* Atari ST TOS.  __TOS__ defined by PureC.  No platform define in VBCC
+ * apparently, so to use with VBCC user must define __TOS__ manually.
+  */
+#if defined(__TOS__)
+#define DUK_F_TOS
+#endif
+
+/* Motorola 68K.  Not defined by VBCC, so user must define one of these
+ * manually when using VBCC.
+ */
+#if defined(__m68k__) || defined(M68000) || defined(__MC68K__)
+#define DUK_F_M68K
+#endif
+
+/* AmigaOS.  Neither AMIGA nor __amigaos__ is defined on VBCC, so user must
+ * define 'AMIGA' manually when using VBCC.
+ */
+#if defined(AMIGA) || defined(__amigaos__)
+#define DUK_F_AMIGAOS
+#endif
+
+/* PowerPC */
+#if defined(__powerpc) || defined(__powerpc__) || defined(__PPC__)
+#define DUK_F_PPC
+#if defined(__PPC64__) || defined(__LP64__) || defined(_LP64)
+#define DUK_F_PPC64
+#else
+#define DUK_F_PPC32
+#endif
+#endif
+
+/* Windows, both 32-bit and 64-bit */
+#if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) || \
+defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
+#define DUK_F_WINDOWS
+#if defined(_WIN64) || defined(WIN64)
+#define DUK_F_WIN64
+#else
+#define DUK_F_WIN32
+#endif
+#endif
+
+/* Flash player (e.g. Crossbridge) */
+#if defined(__FLASHPLAYER__)
+#define DUK_F_FLASHPLAYER
+#endif
+
+/* QNX */
+#if defined(__QNX__)
+#define DUK_F_QNX
+#endif
+
+/* TI-Nspire (using Ndless) */
+#if defined(_TINSPIRE)
+#define DUK_F_TINSPIRE
+#endif
+
+/* Emscripten (provided explicitly by user), improve if possible */
+#if defined(EMSCRIPTEN)
+#define DUK_F_EMSCRIPTEN
+#endif
+
+/* BCC (Bruce's C compiler): this is a "torture target" for compilation */
+#if defined(__BCC__) || defined(__BCC_VERSION__)
+#define DUK_F_BCC
+#endif
+
+/* Linux */
+#if defined(__linux) || defined(__linux__) || defined(linux)
+#define DUK_F_LINUX
+#endif
+
+/* illumos / Solaris */
+#if defined(__sun) && defined(__SVR4)
+#define DUK_F_SUN
+#endif
+
+/* POSIX */
+#if defined(__posix)
+#define DUK_F_POSIX
+#endif
+
+/* Cygwin */
+#if defined(__CYGWIN__)
+#define DUK_F_CYGWIN
+#endif
+
+/* Generic Unix (includes Cygwin) */
+#if defined(__unix) || defined(__unix__) || defined(unix) || \
+defined(DUK_F_LINUX) || defined(DUK_F_BSD)
+#define DUK_F_UNIX
+#endif
+
+/* stdint.h not available */
+#if defined(DUK_F_WINDOWS) && defined(_MSC_VER)
+#if (_MSC_VER < 1700)
+/* VS2012+ has stdint.h, < VS2012 does not (but it's available for download). 
*/
+#define 

[36/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/main.c
--
diff --git a/thirdparty/civetweb-1.10/src/main.c 
b/thirdparty/civetweb-1.10/src/main.c
new file mode 100644
index 000..d8e9e9d
--- /dev/null
+++ b/thirdparty/civetweb-1.10/src/main.c
@@ -0,0 +1,2856 @@
+/* Copyright (c) 2013-2017 the Civetweb developers
+ * Copyright (c) 2004-2013 Sergey Lyubka
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+*/
+
+#if defined(_WIN32)
+
+#ifndef _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_WARNINGS /* Disable deprecation warning in VS2005 */
+#endif
+#ifndef _CRT_SECURE_NO_DEPRECATE
+#define _CRT_SECURE_NO_DEPRECATE
+#endif
+#ifdef WIN32_LEAN_AND_MEAN
+#undef WIN32_LEAN_AND_MEAN /* Required for some functions (tray icons, ...) */
+#endif
+
+#else
+
+#define _XOPEN_SOURCE 600 /* For PATH_MAX on linux */
+/* This should also be sufficient for "realpath", according to
+ * http://man7.org/linux/man-pages/man3/realpath.3.html, but in
+ * reality it does not seem to work. */
+/* In case this causes a problem, disable the warning:
+ * #pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
+ * #pragma clang diagnostic ignored "-Wimplicit-function-declaration"
+ */
+#endif
+
+#ifndef IGNORE_UNUSED_RESULT
+#define IGNORE_UNUSED_RESULT(a) ((void)((a) && 1))
+#endif
+
+#if defined(__cplusplus) && (__cplusplus >= 201103L)
+#define NO_RETURN [[noreturn]]
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
+#define NO_RETURN _Noreturn
+#elif defined(__GNUC__)
+#define NO_RETURN __attribute((noreturn))
+#else
+#define NO_RETURN
+#endif
+
+/* Use same defines as in civetweb.c before including system headers. */
+#ifndef _LARGEFILE_SOURCE
+#define _LARGEFILE_SOURCE /* For fseeko(), ftello() */
+#endif
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64 /* Use 64-bit file offsets by default */
+#endif
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS /*  wants this for C++ */
+#endif
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS /* C++ wants that for INT64_MAX */
+#endif
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "civetweb.h"
+
+#define printf 
\
+   DO_NOT_USE_THIS_FUNCTION__USE_fprintf /* Required for unit testing */
+
+#if defined(_WIN32)
\
+&& !defined(__SYMBIAN32__) /* WINDOWS / UNIX include block */
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501 /* for tdm-gcc so we can use getconsolewindow */
+#endif
+#undef UNICODE
+#include 
+#include 
+#include 
+#include 
+
+#define getcwd(a, b) (_getcwd(a, b))
+#if !defined(__MINGW32__)
+extern char *_getcwd(char *buf, size_t size);
+#endif
+
+#ifndef PATH_MAX
+#define PATH_MAX MAX_PATH
+#endif
+
+#ifndef S_ISDIR
+#define S_ISDIR(x) ((x)&_S_IFDIR)
+#endif
+
+#define DIRSEP '\\'
+#define snprintf _snprintf
+#define vsnprintf _vsnprintf
+#define sleep(x) (Sleep((x)*1000))
+#define WINCDECL __cdecl
+#define abs_path(rel, abs, abs_size) (_fullpath((abs), (rel), (abs_size)))
+
+#else /* defined(_WIN32) && !defined(__SYMBIAN32__) - WINDOWS / UNIX include   
\
+ block */
+
+#include 
+#include 
+#include 
+
+#define DIRSEP '/'
+#define WINCDECL
+#define abs_path(rel, abs, abs_size) (realpath((rel), (abs)))
+
+#endif /* defined(_WIN32) && !defined(__SYMBIAN32__) - WINDOWS / UNIX include  
\
+  block */
+
+#ifndef PATH_MAX
+#define PATH_MAX (1024)
+#endif
+
+#define MAX_OPTIONS (50)
+#define MAX_CONF_FILE_LINE_SIZE (8 * 1024)
+
+struct tuser_data {
+   char *first_message;
+};
+
+
+static int g_exit_flag = 0; /* Main loop should exit */
+static char g_server_base_name[40]; /* Set by init_server_name() */
+static const char 

[19/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-noline/duktape.h
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-noline/duktape.h 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-noline/duktape.h
new file mode 100644
index 000..84a32f8
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-noline/duktape.h
@@ -0,0 +1,1567 @@
+/*
+ *  Duktape public API for Duktape 1.5.2.
+ *
+ *  See the API reference for documentation on call semantics.
+ *  The exposed API is inside the DUK_API_PUBLIC_H_INCLUDED
+ *  include guard.  Other parts of the header are Duktape
+ *  internal and related to platform/compiler/feature detection.
+ *
+ *  Git commit cad34ae155acb0846545ca6bf2d29f9463b22bbb (v1.5.2).
+ *  Git branch HEAD.
+ *
+ *  See Duktape AUTHORS.rst and LICENSE.txt for copyright and
+ *  licensing information.
+ */
+
+/* LICENSE.txt */
+/*
+ *  ===
+ *  Duktape license
+ *  ===
+ *  
+ *  (http://opensource.org/licenses/MIT)
+ *  
+ *  Copyright (c) 2013-2016 by Duktape authors (see AUTHORS.rst)
+ *  
+ *  Permission is hereby granted, free of charge, to any person obtaining a 
copy
+ *  of this software and associated documentation files (the "Software"), to 
deal
+ *  in the Software without restriction, including without limitation the 
rights
+ *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ *  copies of the Software, and to permit persons to whom the Software is
+ *  furnished to do so, subject to the following conditions:
+ *  
+ *  The above copyright notice and this permission notice shall be included in
+ *  all copies or substantial portions of the Software.
+ *  
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ *  THE SOFTWARE.
+ */
+
+/* AUTHORS.rst */
+/*
+ *  ===
+ *  Duktape authors
+ *  ===
+ *  
+ *  Copyright
+ *  =
+ *  
+ *  Duktape copyrights are held by its authors.  Each author has a copyright
+ *  to their contribution, and agrees to irrevocably license the contribution
+ *  under the Duktape ``LICENSE.txt``.
+ *  
+ *  Authors
+ *  ===
+ *  
+ *  Please include an e-mail address, a link to your GitHub profile, or 
something
+ *  similar to allow your contribution to be identified accurately.
+ *  
+ *  The following people have contributed code, website contents, or Wiki 
contents,
+ *  and agreed to irrevocably license their contributions under the Duktape
+ *  ``LICENSE.txt`` (in order of appearance):
+ *  
+ *  * Sami Vaarala 
+ *  * Niki Dobrev
+ *  * Andreas \u00d6man 
+ *  * L\u00e1szl\u00f3 Lang\u00f3 
+ *  * Legimet 
+ *  * Karl Skomski 
+ *  * Bruce Pascoe 
+ *  * Ren\u00e9 Hollander 
+ *  * Julien Hamaide (https://github.com/crazyjul)
+ *  * Sebastian G\u00f6tte (https://github.com/jaseg)
+ *  
+ *  Other contributions
+ *  ===
+ *  
+ *  The following people have contributed something other than code (e.g. 
reported
+ *  bugs, provided ideas, etc; roughly in order of appearance):
+ *  
+ *  * Greg Burns
+ *  * Anthony Rabine
+ *  * Carlos Costa
+ *  * Aur\u00e9lien Bouilland
+ *  * Preet Desai (Pris Matic)
+ *  * judofyr (http://www.reddit.com/user/judofyr)
+ *  * Jason Woofenden
+ *  * Micha\u0142 Przyby\u015b
+ *  * Anthony Howe
+ *  * Conrad Pankoff
+ *  * Jim Schimpf
+ *  * Rajaran Gaunker (https://github.com/zimbabao)
+ *  * Andreas \u00d6man
+ *  * Doug Sanden
+ *  * Josh Engebretson (https://github.com/JoshEngebretson)
+ *  * Remo Eichenberger (https://github.com/remoe)
+ *  * Mamod Mehyar (https://github.com/mamod)
+ *  * David Demelier (https://github.com/markand)
+ *  * Tim Caswell (https://github.com/creationix)
+ *  * Mitchell Blank Jr (https://github.com/mitchblank)
+ *  * https://github.com/yushli
+ *  * Seo Sanghyeon (https://github.com/sanxiyn)
+ *  * Han ChoongWoo (https://github.com/tunz)
+ *  * Joshua Peek (https://github.com/josh)
+ *  * Bruce E. Pascoe (https://github.com/fatcerberus)
+ *  * https://github.com/Kelledin
+ *  * https://github.com/sstruchtrup
+ *  * Michael Drake (https://github.com/tlsa)
+ *  * https://github.com/chris-y
+ *  * Laurent Zubiaur (https://github.com/lzubiaur)
+ *  * Ole Andr\u00e9 Vadla Ravn\u00e5s 

[22/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/commonjs.txt
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/commonjs.txt 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/commonjs.txt
new file mode 100644
index 000..54a1cd7
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/commonjs.txt
@@ -0,0 +1,2 @@
+CommonJS specification snapshots are included in the references/
+directory.  CommonJS is under the MIT license: http://www.commonjs.org/.

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/lua.txt
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/lua.txt 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/lua.txt
new file mode 100644
index 000..24e65f1
--- /dev/null
+++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/lua.txt
@@ -0,0 +1 @@
+Lua is under the MIT license: http://www.lua.org/license.html.

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/murmurhash2.txt
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/murmurhash2.txt
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/murmurhash2.txt
new file mode 100644
index 000..7029925
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/licenses/murmurhash2.txt
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c)  
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/mandel.js
--
diff --git a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/mandel.js 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/mandel.js
new file mode 100644
index 000..79b5195
--- /dev/null
+++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/mandel.js
@@ -0,0 +1,53 @@
+/*
+ *  Mandelbrot example:
+ *
+ *$ ./duk mandel.js
+ *[...]
+ */
+
+function mandel() {
+var w = 76, h = 28, iter = 100;
+var i, j, k, c;
+var x0, y0, xx, yy, xx2, yy2;
+var line;
+
+for (i = 0; i < h; i++) {
+y0 = (i / h) * 2.5 - 1.25;
+
+for (j = 0, line = []; j < w; j++) {
+x0 = (j / w) * 3.0 - 2.0;
+
+for (k = 0, xx = 0, yy = 0, c = '#'; k < iter; k++) {
+/* z -> z^2 + c
+ *   -> (xx+i*yy)^2 + (x0+i*y0)
+ *   -> xx*xx+i*2*xx*yy-yy*yy + x0 + i*y0
+ *   -> (xx*xx - yy*yy + x0) + i*(2*xx*yy + y0)
+ */
+
+xx2 = xx*xx; yy2 = yy*yy;
+
+if (xx2 + yy2 < 4.0) {
+yy = 2*xx*yy + y0;
+xx = xx2 - yy2 + x0;
+} else {
+/* xx^2 + yy^2 >= 4.0 */
+if (k < 3) { c = '.'; }
+else if (k < 5) { c = ','; }
+else if (k < 10) { c = '-'; }
+else { c = '='; }
+break;
+}
+}
+
+line.push(c);
+}
+
+print(line.join(''));
+}
+}
+
+try {
+mandel();
+} catch (e) {
+print(e.stack || e);
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/polyfills/console-minimal.js
--
diff --git 

[25/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/eventloop/README.rst
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/eventloop/README.rst
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/eventloop/README.rst
new file mode 100644
index 000..5b1b147
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/eventloop/README.rst
@@ -0,0 +1,76 @@
+==
+Eventloop examples
+==
+
+Overview and usage
+==
+
+A few examples on how an event loop can be implemented with Duktape, mainly
+illlustrating how the Duktape interface works (not how event loops should be
+built otherwise).
+
+To test (Linux only, perhaps other Unix)::
+
+  $ make
+  $ ./evloop curses-timers.js # run with Ecmascript eventloop
+  $ ./evloop -c curses-timers.js  # run with C eventloop
+
+Implementation approaches
+=
+
+There are several approaches to implementation timers.  Here we demonstrate
+two main approaches:
+
+1. Using a C eventloop which calls into Javascript.  All the event loop state
+   like timers, sockets, etc, is held in C structures.
+   (See ``c_eventloop.c`` and ``c_eventloop.js``.)
+
+2. Using an Ecmascript eventloop which never returns.  All the event loop state
+   can be managed with Ecmascript code instead of C structures.  The Ecmascript
+   eventloop calls a Duktape/C helper to do the lowest level poll() call.
+   (See ``ecma_eventloop.js``.)
+
+Services provided
+=
+
+The event loop API provided by both examples is the same, and includes:
+
+* Timers: setTimeout, clearTimeout, setInterval, clearInterval
+
+* Sockets: simple network sockets
+
+In addition there are a few synchronous API bindings which are not event loop
+related:
+
+* File I/O
+
+* Curses, for doing beautiful character graphics
+
+Limitations
+===
+
+This is **not** a production quality event loop.  This is on purpose, to
+keep the example somewhat simple.  Some shortcomings include:
+
+* A production quality event loop would track its internal state (active
+  timers and sockets) much more efficiently.  In general memory usage and
+  code footprint can be reduced.
+
+* Buffer churn caused by allocating a new buffer for every socket read
+  should be eliminated by reusing buffers where appropriate.  Although
+  churn doesn't increase memory footprint with reference counting, it
+  is slower than reusing buffers and might increase memory fragmentation.
+
+* There is no way to suspend reading or writing in the example.  Adding
+  them is straightforward: the poll set needs to be managed dynamically.
+
+* The example uses poll() while one should use epoll() on Linux, kqueue()
+  on BSD systems, etc.
+
+* Timers are not very accurate, e.g. setInterval() does not try to guarantee
+  a steady schedule.  Instead, the next interval is scheduled after the
+  current callback has finished.  This is not the best behavior for some
+  environments, but avoids bunching callbacks.
+
+* Error handling is mostly missing.  Debug prints don't interact well
+  with curses.

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/eventloop/basic-test.js
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/eventloop/basic-test.js
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/eventloop/basic-test.js
new file mode 100644
index 000..04b3392
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/eventloop/basic-test.js
@@ -0,0 +1,17 @@
+/*
+ *  A few basic tests
+ */
+
+var count = 0;
+var intervalId;
+
+setTimeout(function (x) { print('timer 1', x); }, 1234, 'foo');
+setTimeout('print("timer 2");', 4321);
+setTimeout(function () { print('timer 3'); }, 2345);
+intervalId = setInterval(function (x, y) {
+print('interval', ++count, x, y);
+if (count >= 10) {
+clearInterval(intervalId);
+}
+}, 400, 'foo', 'bar');
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/eventloop/c_eventloop.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/eventloop/c_eventloop.c
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/eventloop/c_eventloop.c
new file mode 100644
index 000..75d768b
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/examples/eventloop/c_eventloop.c
@@ -0,0 +1,618 @@
+/*
+ *  C eventloop example.
+ *
+ *  Timer management is similar to eventloop.js but implemented in C.
+ *  In 

[21/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-noline/duk_config.h
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-noline/duk_config.h
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-noline/duk_config.h
new file mode 100644
index 000..ef62235
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-noline/duk_config.h
@@ -0,0 +1,3804 @@
+/*
+ *  duk_config.h configuration header generated by genconfig.py.
+ *
+ *  Git commit: cad34ae155acb0846545ca6bf2d29f9463b22bbb
+ *  Git describe: v1.5.2
+ *  Git branch: HEAD
+ *
+ *  Supported platforms:
+ *  - Mac OSX, iPhone, Darwin
+ *  - OpenBSD
+ *  - Generic BSD
+ *  - Atari ST TOS
+ *  - AmigaOS
+ *  - Windows
+ *  - Flashplayer (Crossbridge)
+ *  - QNX
+ *  - TI-Nspire
+ *  - Emscripten
+ *  - Linux
+ *  - Solaris
+ *  - Generic POSIX
+ *  - Cygwin
+ *  - Generic UNIX
+ *  - Generic fallback
+ *
+ *  Supported architectures:
+ *  - x86
+ *  - x64
+ *  - x32
+ *  - ARM 32-bit
+ *  - ARM 64-bit
+ *  - MIPS 32-bit
+ *  - MIPS 64-bit
+ *  - PowerPC 32-bit
+ *  - PowerPC 64-bit
+ *  - SPARC 32-bit
+ *  - SPARC 64-bit
+ *  - SuperH
+ *  - Motorola 68k
+ *  - Emscripten
+ *  - Generic
+ *
+ *  Supported compilers:
+ *  - Clang
+ *  - GCC
+ *  - MSVC
+ *  - Emscripten
+ *  - TinyC
+ *  - VBCC
+ *  - Bruce's C compiler
+ *  - Generic
+ *
+ */
+
+#if !defined(DUK_CONFIG_H_INCLUDED)
+#define DUK_CONFIG_H_INCLUDED
+
+/*
+ *  Intermediate helper defines
+ */
+
+/* DLL build detection */
+#if defined(DUK_OPT_DLL_BUILD)
+#define DUK_F_DLL_BUILD
+#elif defined(DUK_OPT_NO_DLL_BUILD)
+#undef DUK_F_DLL_BUILD
+#else
+/* not configured for DLL build */
+#undef DUK_F_DLL_BUILD
+#endif
+
+/* Apple OSX, iOS */
+#if defined(__APPLE__)
+#define DUK_F_APPLE
+#endif
+
+/* OpenBSD */
+#if defined(__OpenBSD__) || defined(__OpenBSD)
+#define DUK_F_OPENBSD
+#endif
+
+/* NetBSD */
+#if defined(__NetBSD__) || defined(__NetBSD)
+#define DUK_F_NETBSD
+#endif
+
+/* FreeBSD */
+#if defined(__FreeBSD__) || defined(__FreeBSD)
+#define DUK_F_FREEBSD
+#endif
+
+/* BSD variant */
+#if defined(DUK_F_FREEBSD) || defined(DUK_F_NETBSD) || defined(DUK_F_OPENBSD) 
|| \
+defined(__bsdi__) || defined(__DragonFly__)
+#define DUK_F_BSD
+#endif
+
+/* Atari ST TOS.  __TOS__ defined by PureC.  No platform define in VBCC
+ * apparently, so to use with VBCC user must define __TOS__ manually.
+  */
+#if defined(__TOS__)
+#define DUK_F_TOS
+#endif
+
+/* Motorola 68K.  Not defined by VBCC, so user must define one of these
+ * manually when using VBCC.
+ */
+#if defined(__m68k__) || defined(M68000) || defined(__MC68K__)
+#define DUK_F_M68K
+#endif
+
+/* AmigaOS.  Neither AMIGA nor __amigaos__ is defined on VBCC, so user must
+ * define 'AMIGA' manually when using VBCC.
+ */
+#if defined(AMIGA) || defined(__amigaos__)
+#define DUK_F_AMIGAOS
+#endif
+
+/* PowerPC */
+#if defined(__powerpc) || defined(__powerpc__) || defined(__PPC__)
+#define DUK_F_PPC
+#if defined(__PPC64__) || defined(__LP64__) || defined(_LP64)
+#define DUK_F_PPC64
+#else
+#define DUK_F_PPC32
+#endif
+#endif
+
+/* Windows, both 32-bit and 64-bit */
+#if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) || \
+defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
+#define DUK_F_WINDOWS
+#if defined(_WIN64) || defined(WIN64)
+#define DUK_F_WIN64
+#else
+#define DUK_F_WIN32
+#endif
+#endif
+
+/* Flash player (e.g. Crossbridge) */
+#if defined(__FLASHPLAYER__)
+#define DUK_F_FLASHPLAYER
+#endif
+
+/* QNX */
+#if defined(__QNX__)
+#define DUK_F_QNX
+#endif
+
+/* TI-Nspire (using Ndless) */
+#if defined(_TINSPIRE)
+#define DUK_F_TINSPIRE
+#endif
+
+/* Emscripten (provided explicitly by user), improve if possible */
+#if defined(EMSCRIPTEN)
+#define DUK_F_EMSCRIPTEN
+#endif
+
+/* BCC (Bruce's C compiler): this is a "torture target" for compilation */
+#if defined(__BCC__) || defined(__BCC_VERSION__)
+#define DUK_F_BCC
+#endif
+
+/* Linux */
+#if defined(__linux) || defined(__linux__) || defined(linux)
+#define DUK_F_LINUX
+#endif
+
+/* illumos / Solaris */
+#if defined(__sun) && defined(__SVR4)
+#define DUK_F_SUN
+#endif
+
+/* POSIX */
+#if defined(__posix)
+#define DUK_F_POSIX
+#endif
+
+/* Cygwin */
+#if defined(__CYGWIN__)
+#define DUK_F_CYGWIN
+#endif
+
+/* Generic Unix (includes Cygwin) */
+#if defined(__unix) || defined(__unix__) || defined(unix) || \
+defined(DUK_F_LINUX) || defined(DUK_F_BSD)
+#define DUK_F_UNIX
+#endif
+
+/* stdint.h not available */
+#if defined(DUK_F_WINDOWS) && defined(_MSC_VER)
+#if (_MSC_VER < 1700)
+/* VS2012+ has stdint.h, < VS2012 does not (but it's available for download). 
*/
+#define DUK_F_NO_STDINT_H
+#endif

[23/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/license.spdx
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/license.spdx 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/license.spdx
new file mode 100644
index 000..29a6b8d
--- /dev/null
+++ b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/license.spdx
@@ -0,0 +1,3933 @@
+
+http://spdx.org/rdf/terms#;
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#;
+   xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#;
+>
+  
+<_3:algorithm 
rdf:resource="http://spdx.org/rdf/terms#checksumAlgorithm_sha1"/>
+
<_3:checksumValue>6f9134b7d1c939593043b9e0ecb308fbc745c9af
+http://spdx.org/rdf/terms#Checksum"/>
+  
+  
+<_3:licenseConcluded rdf:resource="http://spdx.org/licenses/MIT"/>
+<_3:licenseInfoInFile rdf:resource="http://spdx.org/rdf/terms#none"/>
+<_3:copyrightText>Copyright 2013-2016 Duktape authors (see AUTHORS.rst in 
the Duktape distributable)
+<_3:checksum rdf:nodeID="svBMzJkP102"/>
+http://spdx.org/rdf/terms#File"/>
+<_3:fileName>./examples/eventloop/main.c
+<_3:fileType rdf:resource="http://spdx.org/rdf/terms#fileType_source"/>
+  
+  
+<_3:algorithm 
rdf:resource="http://spdx.org/rdf/terms#checksumAlgorithm_sha1"/>
+
<_3:checksumValue>bd2f85dccd23b76b9cf9900b8b2b86f0bf97421b
+http://spdx.org/rdf/terms#Checksum"/>
+  
+  
+<_3:licenseConcluded rdf:resource="http://spdx.org/licenses/MIT"/>
+<_3:licenseInfoInFile rdf:resource="http://spdx.org/rdf/terms#none"/>
+<_3:copyrightText>Copyright 2013-2016 Duktape authors (see AUTHORS.rst in 
the Duktape distributable)
+<_3:checksum rdf:nodeID="svBMzJkP416"/>
+http://spdx.org/rdf/terms#File"/>
+<_3:fileName>./src-separate/duk_initjs_min.js
+<_3:fileType rdf:resource="http://spdx.org/rdf/terms#fileType_source"/>
+  
+  
+<_3:licenseConcluded rdf:resource="http://spdx.org/licenses/MIT"/>
+<_3:licenseInfoInFile rdf:resource="http://spdx.org/rdf/terms#none"/>
+<_3:copyrightText>Copyright 2013-2016 Duktape authors (see AUTHORS.rst in 
the Duktape distributable)
+<_3:checksum rdf:nodeID="svBMzJkP322"/>
+http://spdx.org/rdf/terms#File"/>
+<_3:fileName>./src-separate/duk_internal.h
+<_3:fileType rdf:resource="http://spdx.org/rdf/terms#fileType_source"/>
+  
+  
+<_3:algorithm 
rdf:resource="http://spdx.org/rdf/terms#checksumAlgorithm_sha1"/>
+
<_3:checksumValue>b7ee0e88e6365390db594e5e1a90c383847cfd0f
+http://spdx.org/rdf/terms#Checksum"/>
+  
+  
+<_3:created 
rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime;>2016-12-08T20:32:53Z
+
+<_3:licenseListVersion>1.20
+http://spdx.org/rdf/terms#CreationInfo"/>
+<_3:creator>Organization: duktape.org
+  
+  
+<_3:licenseConcluded rdf:resource="http://spdx.org/licenses/MIT"/>
+<_3:licenseInfoInFile rdf:resource="http://spdx.org/rdf/terms#none"/>
+<_3:copyrightText>Copyright 2013-2016 Duktape authors (see AUTHORS.rst in 
the Duktape distributable)
+<_3:checksum rdf:nodeID="svBMzJkP80"/>
+http://spdx.org/rdf/terms#File"/>
+<_3:fileName>./examples/coffee/README.rst
+<_3:fileType rdf:resource="http://spdx.org/rdf/terms#fileType_other"/>
+  
+  
+<_3:licenseConcluded rdf:resource="http://spdx.org/licenses/MIT"/>
+<_3:licenseInfoInFile rdf:resource="http://spdx.org/rdf/terms#none"/>
+<_3:copyrightText>Copyright 2013-2016 Duktape authors (see AUTHORS.rst in 
the Duktape distributable)
+<_3:checksum rdf:nodeID="svBMzJkP276"/>
+http://spdx.org/rdf/terms#File"/>
+<_3:fileName>./src-separate/duk_heap_stringtable.c
+<_3:fileType rdf:resource="http://spdx.org/rdf/terms#fileType_source"/>
+  
+  
+<_3:algorithm 
rdf:resource="http://spdx.org/rdf/terms#checksumAlgorithm_sha1"/>
+
<_3:checksumValue>d70b4083ccd3b5dac32ad07e58d3132dc3390b79
+http://spdx.org/rdf/terms#Checksum"/>
+  
+  
+<_3:algorithm 
rdf:resource="http://spdx.org/rdf/terms#checksumAlgorithm_sha1"/>
+
<_3:checksumValue>f051b42ff42dc8655b9e17739f7cb7cb76bdf78d
+http://spdx.org/rdf/terms#Checksum"/>
+  
+  
+<_3:algorithm 
rdf:resource="http://spdx.org/rdf/terms#checksumAlgorithm_sha1"/>
+
<_3:checksumValue>61db5ef1604240b33fa9e1e8825ad588076a5aef
+http://spdx.org/rdf/terms#Checksum"/>
+  
+  
+<_3:licenseConcluded rdf:resource="http://spdx.org/licenses/MIT"/>
+<_3:licenseInfoInFile rdf:resource="http://spdx.org/rdf/terms#none"/>
+<_3:copyrightText>Copyright 2013-2016 Duktape authors (see AUTHORS.rst in 
the Duktape distributable)
+<_3:checksum rdf:nodeID="svBMzJkP366"/>
+http://spdx.org/rdf/terms#File"/>
+<_3:fileName>./src-separate/duk_debug.h
+<_3:fileType rdf:resource="http://spdx.org/rdf/terms#fileType_source"/>
+  
+  
+<_3:algorithm 

[50/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/CMakeLists.txt
--
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ce20bf..3463d69 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,8 +113,12 @@ set(JSONCPP_LIB 
"${JSONCPP_LIB_DIR}/lib/${prefix}jsoncpp${suffix}")
 
 set(CIVETWEB_ENABLE_SSL_DYNAMIC_LOADING OFF CACHE BOOL "Disable dynamic SSL 
library loading")
 set(CIVETWEB_ENABLE_CXX ON CACHE BOOL "Enable civet C++ library")
+SET(WITH_TESTS OFF CACHE BOOL "Build RocksDB library (not repo) tests")
+set(CIVET_THIRDPARTY_ROOT "${CMAKE_SOURCE_DIR}/thirdparty/civetweb-1.10/" 
CACHE STRING "Path to CivetWeb root")
+set(ROCKSDB_THIRDPARTY_ROOT "${CMAKE_SOURCE_DIR}/thirdparty/rocksdb/" CACHE 
STRING "Path to RocksDB root")
 add_subdirectory(thirdparty/yaml-cpp-yaml-cpp-20171024)
-add_subdirectory(thirdparty/civetweb-1.9.1 EXCLUDE_FROM_ALL)
+set(BUILD_CIVET_TESTING OFF)
+add_subdirectory("${CIVET_THIRDPARTY_ROOT}" EXCLUDE_FROM_ALL)
 include_directories(thirdparty/concurrentqueue)
 include_directories(thirdparty/yaml-cpp-yaml-cpp-20171024/include)
 
@@ -145,7 +149,7 @@ endif()
 
 option(DISABLE_ROCKSDB "Disables the RocksDB extension." OFF)
 if (NOT DISABLE_ROCKSDB)
-   createExtension(ROCKSDB-REPOS "ROCKSDB REPOS" "This Enables persistent 
provenance, flowfile, and content repositories using RocksDB" 
"extensions/rocksdb-repos" "${TEST_DIR}/rocksdb-tests" BUILD_RD 
"thirdparty/rocksdb/")
+   createExtension(ROCKSDB-REPOS "ROCKSDB REPOS" "This Enables persistent 
provenance, flowfile, and content repositories using RocksDB" 
"extensions/rocksdb-repos" "${TEST_DIR}/rocksdb-tests" BUILD_RD 
"${ROCKSDB_THIRDPARTY_ROOT}")
 endif()
 
 ## Create LibArchive Extension

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/cmake/BuildTests.cmake
--
diff --git a/cmake/BuildTests.cmake b/cmake/BuildTests.cmake
index 120064a..4499305 100644
--- a/cmake/BuildTests.cmake
+++ b/cmake/BuildTests.cmake
@@ -39,7 +39,7 @@ function(createTests testName)
 target_include_directories(${testName} BEFORE PRIVATE 
"${CMAKE_SOURCE_DIR}/thirdparty/spdlog-20170710/include")
 target_include_directories(${testName} BEFORE PRIVATE 
"${CMAKE_SOURCE_DIR}/thirdparty/yaml-cpp-yaml-cpp-0.5.3/include")
 target_include_directories(${testName} BEFORE PRIVATE 
"${CMAKE_SOURCE_DIR}/thirdparty/jsoncpp/include")
-target_include_directories(${testName} BEFORE PRIVATE 
"${CMAKE_SOURCE_DIR}/thirdparty/civetweb-1.9.1/include")
+target_include_directories(${testName} BEFORE PRIVATE 
"${CIVET_THIRDPARTY_ROOT}/include")
 target_include_directories(${testName} BEFORE PRIVATE 
"${CMAKE_SOURCE_DIR}/thirdparty/libarchive-3.3.2/libarchive")
 target_include_directories(${testName} BEFORE PRIVATE 
"${CMAKE_SOURCE_DIR}/include")
 target_include_directories(${testName} BEFORE PRIVATE 
"${CMAKE_SOURCE_DIR}/libminifi/include/")
@@ -59,7 +59,7 @@ function(createTests testName)
 target_include_directories(${testName} BEFORE PRIVATE 
"${Boost_INCLUDE_DIRS}")
 endif()
 target_link_libraries(${testName} ${SPD_LIB} ${TEST_BASE_LIB})
-target_link_libraries(${testName} ${CMAKE_THREAD_LIBS_INIT} 
${OPENSSL_LIBRARIES} core-minifi yaml-cpp c-library civetweb-cpp 
${JSON_CPP_LIB})
+target_link_libraries(${testName} ${CMAKE_THREAD_LIBS_INIT} 
${OPENSSL_LIBRARIES} core-minifi yaml-cpp c-library civetweb-cpp 
${JSON_CPP_LIB} dl)
 if (APPLE)
target_link_libraries (${testName} -Wl,-all_load minifi)
else ()
@@ -81,7 +81,7 @@ add_library(${TEST_BASE_LIB} STATIC 
"${TEST_DIR}/TestBase.cpp")
 target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE 
"${CMAKE_SOURCE_DIR}/thirdparty/catch")
 target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE 
"${CMAKE_SOURCE_DIR}/libminifi/include/")
 target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE 
"${CMAKE_SOURCE_DIR}/thirdparty/spdlog-20170710/include")
-target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE 
"${CMAKE_SOURCE_DIR}/thirdparty/civetweb-1.9.1/include")
+target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE 
"${CIVET_THIRDPARTY_ROOT}/include")
  
 SET(CATCH_MAIN_LIB catch_main)
 add_library(${CATCH_MAIN_LIB} STATIC "${TEST_DIR}/CatchMain.cpp")

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/cmake/RocksDBConfig.cmake.in
--
diff --git a/cmake/RocksDBConfig.cmake.in b/cmake/RocksDBConfig.cmake.in
new file mode 100644
index 000..b3cb2b2
--- /dev/null
+++ b/cmake/RocksDBConfig.cmake.in
@@ -0,0 +1,3 @@
+@PACKAGE_INIT@
+include("${CMAKE_CURRENT_LIST_DIR}/RocksDBTargets.cmake")
+check_required_components(RocksDB)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/extensions/expression-language/CMakeLists.txt

[51/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
MINIFICPP-303 Update to civet 1.10

MINIFICPP-303 Update to RocksDB 5.8.6

Use variables to store civet and rocksdb location

Potential civetweb Xcode 9 fix

This closes #185.

Signed-off-by: Marc Parisi 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/df353561
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/df353561
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/df353561

Branch: refs/heads/master
Commit: df353561c8a8a0a0d1178a76f03b966b44542834
Parents: d4f0bcf
Author: Caleb Johnson 
Authored: Fri Oct 20 15:36:09 2017 +
Committer: Marc Parisi 
Committed: Wed Dec 13 15:39:09 2017 -0500

--
 CMakeLists.txt  |  8 +-
 cmake/BuildTests.cmake  |  6 +-
 cmake/RocksDBConfig.cmake.in|  3 +
 extensions/expression-language/CMakeLists.txt   |  2 +-
 .../expression-language/noop/CMakeLists.txt |  2 +-
 extensions/gps/CMakeLists.txt   |  2 +-
 extensions/http-curl/CMakeLists.txt |  2 +-
 extensions/libarchive/CMakeLists.txt|  2 +-
 extensions/librdkafka/CMakeLists.txt|  2 +-
 extensions/pcap/CMakeLists.txt  |  2 +-
 extensions/rocksdb-repos/CMakeLists.txt |  4 +-
 extensions/script/CMakeLists.txt|  2 +-
 extensions/tensorflow/CMakeLists.txt|  2 +-
 extensions/usb-camera/CMakeLists.txt|  2 +-
 libminifi/CMakeLists.txt|  2 +-
 libminifi/test/rocksdb-tests/CMakeLists.txt |  2 +-
 main/CMakeLists.txt |  2 +-
 thirdparty/civetweb-1.10/.clang-format  | 32 +
 thirdparty/civetweb-1.10/.gitattributes | 33 +
 thirdparty/civetweb-1.10/.gitignore |268 +
 thirdparty/civetweb-1.10/.travis.yml|694 +
 thirdparty/civetweb-1.10/CMakeLists.txt |492 +
 thirdparty/civetweb-1.10/CREDITS.md |167 +
 thirdparty/civetweb-1.10/LICENSE.md |208 +
 thirdparty/civetweb-1.10/Makefile.deprecated|208 +
 thirdparty/civetweb-1.10/Makefile.osx   | 42 +
 thirdparty/civetweb-1.10/Qt/CivetWeb.pro| 34 +
 thirdparty/civetweb-1.10/README.md  |168 +
 thirdparty/civetweb-1.10/RELEASE_NOTES.md   |395 +
 .../civetweb-1.10/VisualStudio/buildRelease.pl  | 71 +
 .../civetweb-1.10/VisualStudio/civetweb.sln | 75 +
 .../civetweb_lua/civetweb_lua.vcxproj   |216 +
 .../civetweb_lua/civetweb_lua.vcxproj.filters   | 78 +
 .../civetweb_yassl/civetweb_yassl.sln   | 36 +
 .../civetweb_yassl/civetweb_yassl.vcxproj   |170 +
 .../civetweb_yassl.vcxproj.filters  | 40 +
 .../civetweb_yassl/yassl_lib/yassl_lib.vcxproj  |185 +
 .../yassl_lib/yassl_lib.vcxproj.filters |124 +
 .../duktape_lib/duktape_lib.vcxproj |156 +
 .../duktape_lib/duktape_lib.vcxproj.filters | 30 +
 .../ex_embed_cpp/ex_embed_cpp.vcxproj   |162 +
 .../ex_embed_cpp/ex_embed_cpp.vcxproj.filters   | 36 +
 .../ex_embedded_c/ex_embedded_c.vcxproj |161 +
 .../ex_embedded_c/ex_embedded_c.vcxproj.filters | 30 +
 .../ex_websocket/ex_websocket.vcxproj   |162 +
 .../ex_websocket/ex_websocket.vcxproj.filters   | 36 +
 .../ex_websocket_client.vcxproj |160 +
 .../ex_websocket_client.vcxproj.filters | 30 +
 .../VisualStudio/lua_lib/lua_lib.vcxproj|191 +
 .../lua_lib/lua_lib.vcxproj.filters |135 +
 .../VisualStudio/unit_test/unit_test.vcxproj|105 +
 .../unit_test/unit_test.vcxproj.filters | 66 +
 .../VisualStudio/upload/upload.vcxproj  |160 +
 .../VisualStudio/upload/upload.vcxproj.filters  | 30 +
 thirdparty/civetweb-1.10/_config.yml|  1 +
 thirdparty/civetweb-1.10/appveyor.yml   |386 +
 thirdparty/civetweb-1.10/build.cmd  |866 +
 .../ci/test/01_basic/basic_spec.lua | 35 +
 .../01_basic_test_dir/git_keep_empty_dir|  0
 .../ci/test/01_basic/docroot/01_basic_test_file |  0
 thirdparty/civetweb-1.10/ci/test/README.md  | 34 +
 thirdparty/civetweb-1.10/ci/test/civet.lua  | 42 +
 .../civetweb-1.10/ci/travis/install_rocks.sh| 14 +
 thirdparty/civetweb-1.10/ci/travis/lua_env.sh   |  5 +
 thirdparty/civetweb-1.10/ci/travis/platform.sh  | 15 +
 .../civetweb-1.10/ci/travis/run_ci_tests.sh |  7 +
 thirdparty/civetweb-1.10/ci/travis/setup_lua.sh | 61 +
 .../civetweb-1.10/cmake/AddCCompilerFlag.cmake  | 38 +
 .../cmake/AddCXXCompilerFlag.cmake  

[43/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/examples/_obsolete/docroot/jquery.js
--
diff --git a/thirdparty/civetweb-1.10/examples/_obsolete/docroot/jquery.js 
b/thirdparty/civetweb-1.10/examples/_obsolete/docroot/jquery.js
new file mode 100644
index 000..7c24308
--- /dev/null
+++ b/thirdparty/civetweb-1.10/examples/_obsolete/docroot/jquery.js
@@ -0,0 +1,154 @@
+/*!
+ * jQuery JavaScript Library v1.4.2
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Sat Feb 13 22:33:48 2010 -0500
+ */
+(function(A,w){function 
ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function
 
Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&(b)}function
 X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in 
b)X(a,o,b[o],f,e,d);return 
a}if(d!==w){f=!j&&(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
+Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var
 d,f;if(!a)return 
this;if(a.nodeType){this.context=this[0]=a;this.length=1;return 
this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return
 this}if(typeof a==="string")if((d=Ta.exec(a))&&
+(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else
 
a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return
 c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return 
T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return 
this}else 
if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return
 c.merge(this,
+a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else 
if(c.isFunction(a))return 
T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return
 
c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return 
this.length},toArray:function(){return R.call(this,0)},get:function(a){return 
a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var
 
f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
+"find")f.selector=this.selector+(this.selector?" ":"")+d;else 

[14/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_buffer.c
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_buffer.c
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_buffer.c
new file mode 100644
index 000..0d8efb0
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/src-separate/duk_bi_buffer.c
@@ -0,0 +1,2882 @@
+/*
+ *  Duktape.Buffer, Node.js Buffer, and Khronos/ES6 TypedArray built-ins
+ */
+
+#include "duk_internal.h"
+
+/*
+ *  Misc helpers
+ */
+
+#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
+/* Map DUK_HBUFFEROBJECT_ELEM_xxx to duk_hobject class number.
+ * Sync with duk_hbufferobject.h and duk_hobject.h.
+ */
+static const duk_uint8_t duk__buffer_class_from_elemtype[9] = {
+   DUK_HOBJECT_CLASS_UINT8ARRAY,
+   DUK_HOBJECT_CLASS_UINT8CLAMPEDARRAY,
+   DUK_HOBJECT_CLASS_INT8ARRAY,
+   DUK_HOBJECT_CLASS_UINT16ARRAY,
+   DUK_HOBJECT_CLASS_INT16ARRAY,
+   DUK_HOBJECT_CLASS_UINT32ARRAY,
+   DUK_HOBJECT_CLASS_INT32ARRAY,
+   DUK_HOBJECT_CLASS_FLOAT32ARRAY,
+   DUK_HOBJECT_CLASS_FLOAT64ARRAY
+};
+#endif  /* DUK_USE_BUFFEROBJECT_SUPPORT */
+
+#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
+/* Map DUK_HBUFFEROBJECT_ELEM_xxx to prototype object built-in index.
+ * Sync with duk_hbufferobject.h.
+ */
+static const duk_uint8_t duk__buffer_proto_from_elemtype[9] = {
+   DUK_BIDX_UINT8ARRAY_PROTOTYPE,
+   DUK_BIDX_UINT8CLAMPEDARRAY_PROTOTYPE,
+   DUK_BIDX_INT8ARRAY_PROTOTYPE,
+   DUK_BIDX_UINT16ARRAY_PROTOTYPE,
+   DUK_BIDX_INT16ARRAY_PROTOTYPE,
+   DUK_BIDX_UINT32ARRAY_PROTOTYPE,
+   DUK_BIDX_INT32ARRAY_PROTOTYPE,
+   DUK_BIDX_FLOAT32ARRAY_PROTOTYPE,
+   DUK_BIDX_FLOAT64ARRAY_PROTOTYPE
+};
+#endif  /* DUK_USE_BUFFEROBJECT_SUPPORT */
+
+#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
+/* Map DUK__FLX_xxx to byte size.
+ */
+static const duk_uint8_t duk__buffer_nbytes_from_fldtype[6] = {
+   1,  /* DUK__FLD_8BIT */
+   2,  /* DUK__FLD_16BIT */
+   4,  /* DUK__FLD_32BIT */
+   4,  /* DUK__FLD_FLOAT */
+   8,  /* DUK__FLD_DOUBLE */
+   0   /* DUK__FLD_VARINT; not relevant here */
+};
+#endif  /* DUK_USE_BUFFEROBJECT_SUPPORT */
+
+#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
+/* Bitfield for each DUK_HBUFFEROBJECT_ELEM_xxx indicating which element types
+ * are compatible with a blind byte copy for the TypedArray set() method (also
+ * used for TypedArray constructor).  Array index is target buffer elem type,
+ * bitfield indicates compatible source types.  The types must have same byte
+ * size and they must be coercion compatible.
+ */
+static duk_uint16_t duk__buffer_elemtype_copy_compatible[9] = {
+   /* xxx -> DUK_HBUFFEROBJECT_ELEM_UINT8 */
+   (1U << DUK_HBUFFEROBJECT_ELEM_UINT8) |
+   (1U << DUK_HBUFFEROBJECT_ELEM_UINT8CLAMPED) |
+   (1U << DUK_HBUFFEROBJECT_ELEM_INT8),
+
+   /* xxx -> DUK_HBUFFEROBJECT_ELEM_UINT8CLAMPED
+* Note: INT8 is -not- copy compatible, e.g. -1 would coerce to 0x00.
+*/
+   (1U << DUK_HBUFFEROBJECT_ELEM_UINT8) |
+   (1U << DUK_HBUFFEROBJECT_ELEM_UINT8CLAMPED),
+
+   /* xxx -> DUK_HBUFFEROBJECT_ELEM_INT8 */
+   (1U << DUK_HBUFFEROBJECT_ELEM_UINT8) |
+   (1U << DUK_HBUFFEROBJECT_ELEM_UINT8CLAMPED) |
+   (1U << DUK_HBUFFEROBJECT_ELEM_INT8),
+
+   /* xxx -> DUK_HBUFFEROBJECT_ELEM_UINT16 */
+   (1U << DUK_HBUFFEROBJECT_ELEM_UINT16) |
+   (1U << DUK_HBUFFEROBJECT_ELEM_INT16),
+
+   /* xxx -> DUK_HBUFFEROBJECT_ELEM_INT16 */
+   (1U << DUK_HBUFFEROBJECT_ELEM_UINT16) |
+   (1U << DUK_HBUFFEROBJECT_ELEM_INT16),
+
+   /* xxx -> DUK_HBUFFEROBJECT_ELEM_UINT32 */
+   (1U << DUK_HBUFFEROBJECT_ELEM_UINT32) |
+   (1U << DUK_HBUFFEROBJECT_ELEM_INT32),
+
+   /* xxx -> DUK_HBUFFEROBJECT_ELEM_INT32 */
+   (1U << DUK_HBUFFEROBJECT_ELEM_UINT32) |
+   (1U << DUK_HBUFFEROBJECT_ELEM_INT32),
+
+   /* xxx -> DUK_HBUFFEROBJECT_ELEM_FLOAT32 */
+   (1U << DUK_HBUFFEROBJECT_ELEM_FLOAT32),
+
+   /* xxx -> DUK_HBUFFEROBJECT_ELEM_FLOAT64 */
+   (1U << DUK_HBUFFEROBJECT_ELEM_FLOAT64)
+};
+#endif  /* DUK_USE_BUFFEROBJECT_SUPPORT */
+
+#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
+/* Shared helper. */
+DUK_LOCAL duk_hbufferobject *duk__getrequire_bufobj_this(duk_context *ctx, 
duk_bool_t throw_flag) {
+   duk_hthread *thr;
+   duk_tval *tv;
+   duk_hbufferobject *h_this;
+
+   DUK_ASSERT(ctx != NULL);
+   thr = (duk_hthread *) ctx;
+
+   tv = duk_get_borrowed_this_tval(ctx);
+   DUK_ASSERT(tv != NULL);
+   if (DUK_TVAL_IS_OBJECT(tv)) {
+   h_this = (duk_hbufferobject *) DUK_TVAL_GET_OBJECT(tv);
+   DUK_ASSERT(h_this != NULL);
+   

[32/51] [partial] nifi-minifi-cpp git commit: MINIFICPP-303 Update to civet 1.10

2017-12-13 Thread phrocker
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/df353561/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/config/duk_config.h-modular-static
--
diff --git 
a/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/config/duk_config.h-modular-static
 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/config/duk_config.h-modular-static
new file mode 100644
index 000..b2b5a38
--- /dev/null
+++ 
b/thirdparty/civetweb-1.10/src/third_party/duktape-1.5.2/config/duk_config.h-modular-static
@@ -0,0 +1,3415 @@
+/*
+ *  duk_config.h configuration header generated by genconfig.py.
+ *
+ *  Git commit: cad34ae155acb0846545ca6bf2d29f9463b22bbb
+ *  Git describe: v1.5.2
+ *  Git branch: HEAD
+ *
+ *  Supported platforms:
+ *  - Mac OSX, iPhone, Darwin
+ *  - OpenBSD
+ *  - Generic BSD
+ *  - Atari ST TOS
+ *  - AmigaOS
+ *  - Windows
+ *  - Flashplayer (Crossbridge)
+ *  - QNX
+ *  - TI-Nspire
+ *  - Emscripten
+ *  - Linux
+ *  - Solaris
+ *  - Generic POSIX
+ *  - Cygwin
+ *  - Generic UNIX
+ *  - Generic fallback
+ *
+ *  Supported architectures:
+ *  - x86
+ *  - x64
+ *  - x32
+ *  - ARM 32-bit
+ *  - ARM 64-bit
+ *  - MIPS 32-bit
+ *  - MIPS 64-bit
+ *  - PowerPC 32-bit
+ *  - PowerPC 64-bit
+ *  - SPARC 32-bit
+ *  - SPARC 64-bit
+ *  - SuperH
+ *  - Motorola 68k
+ *  - Emscripten
+ *  - Generic
+ *
+ *  Supported compilers:
+ *  - Clang
+ *  - GCC
+ *  - MSVC
+ *  - Emscripten
+ *  - TinyC
+ *  - VBCC
+ *  - Bruce's C compiler
+ *  - Generic
+ *
+ */
+
+#if !defined(DUK_CONFIG_H_INCLUDED)
+#define DUK_CONFIG_H_INCLUDED
+
+/*
+ *  Intermediate helper defines
+ */
+
+/* DLL build detection */
+#if defined(DUK_OPT_DLL_BUILD)
+#define DUK_F_DLL_BUILD
+#elif defined(DUK_OPT_NO_DLL_BUILD)
+#undef DUK_F_DLL_BUILD
+#else
+/* not configured for DLL build */
+#undef DUK_F_DLL_BUILD
+#endif
+
+/* Apple OSX, iOS */
+#if defined(__APPLE__)
+#define DUK_F_APPLE
+#endif
+
+/* OpenBSD */
+#if defined(__OpenBSD__) || defined(__OpenBSD)
+#define DUK_F_OPENBSD
+#endif
+
+/* NetBSD */
+#if defined(__NetBSD__) || defined(__NetBSD)
+#define DUK_F_NETBSD
+#endif
+
+/* FreeBSD */
+#if defined(__FreeBSD__) || defined(__FreeBSD)
+#define DUK_F_FREEBSD
+#endif
+
+/* BSD variant */
+#if defined(DUK_F_FREEBSD) || defined(DUK_F_NETBSD) || defined(DUK_F_OPENBSD) 
|| \
+defined(__bsdi__) || defined(__DragonFly__)
+#define DUK_F_BSD
+#endif
+
+/* Atari ST TOS.  __TOS__ defined by PureC.  No platform define in VBCC
+ * apparently, so to use with VBCC user must define __TOS__ manually.
+  */
+#if defined(__TOS__)
+#define DUK_F_TOS
+#endif
+
+/* Motorola 68K.  Not defined by VBCC, so user must define one of these
+ * manually when using VBCC.
+ */
+#if defined(__m68k__) || defined(M68000) || defined(__MC68K__)
+#define DUK_F_M68K
+#endif
+
+/* AmigaOS.  Neither AMIGA nor __amigaos__ is defined on VBCC, so user must
+ * define 'AMIGA' manually when using VBCC.
+ */
+#if defined(AMIGA) || defined(__amigaos__)
+#define DUK_F_AMIGAOS
+#endif
+
+/* PowerPC */
+#if defined(__powerpc) || defined(__powerpc__) || defined(__PPC__)
+#define DUK_F_PPC
+#if defined(__PPC64__) || defined(__LP64__) || defined(_LP64)
+#define DUK_F_PPC64
+#else
+#define DUK_F_PPC32
+#endif
+#endif
+
+/* Windows, both 32-bit and 64-bit */
+#if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) || \
+defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
+#define DUK_F_WINDOWS
+#if defined(_WIN64) || defined(WIN64)
+#define DUK_F_WIN64
+#else
+#define DUK_F_WIN32
+#endif
+#endif
+
+/* Flash player (e.g. Crossbridge) */
+#if defined(__FLASHPLAYER__)
+#define DUK_F_FLASHPLAYER
+#endif
+
+/* QNX */
+#if defined(__QNX__)
+#define DUK_F_QNX
+#endif
+
+/* TI-Nspire (using Ndless) */
+#if defined(_TINSPIRE)
+#define DUK_F_TINSPIRE
+#endif
+
+/* Emscripten (provided explicitly by user), improve if possible */
+#if defined(EMSCRIPTEN)
+#define DUK_F_EMSCRIPTEN
+#endif
+
+/* BCC (Bruce's C compiler): this is a "torture target" for compilation */
+#if defined(__BCC__) || defined(__BCC_VERSION__)
+#define DUK_F_BCC
+#endif
+
+/* Linux */
+#if defined(__linux) || defined(__linux__) || defined(linux)
+#define DUK_F_LINUX
+#endif
+
+/* illumos / Solaris */
+#if defined(__sun) && defined(__SVR4)
+#define DUK_F_SUN
+#endif
+
+/* POSIX */
+#if defined(__posix)
+#define DUK_F_POSIX
+#endif
+
+/* Cygwin */
+#if defined(__CYGWIN__)
+#define DUK_F_CYGWIN
+#endif
+
+/* Generic Unix (includes Cygwin) */
+#if defined(__unix) || defined(__unix__) || defined(unix) || \
+defined(DUK_F_LINUX) || defined(DUK_F_BSD)
+#define DUK_F_UNIX
+#endif
+
+/* stdint.h not available */
+#if defined(DUK_F_WINDOWS) && defined(_MSC_VER)
+#if (_MSC_VER < 1700)
+/* VS2012+ has stdint.h, < VS2012 does not (but it's available for 

  1   2   3   4   5   6   7   >