comment on null bytes 0x00 in the Streamlet protocol v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 23 Apr 2022 19:08:11 +0200
branchv_0
changeset 95 f2f2b81079a5
parent 94 b26e9b224fbe
child 96 c34106244a54
comment on null bytes 0x00 in the Streamlet protocol
nbproject/configurations.xml
src/SubProcess.cpp
streamlet-examples/streamlet-common.h
--- a/nbproject/configurations.xml	Sat Dec 04 21:14:49 2021 +0100
+++ b/nbproject/configurations.xml	Sat Apr 23 19:08:11 2022 +0200
@@ -167,6 +167,12 @@
                             perm="755"
                             owner="root"
                             group="bin"/>
+          <packFileListElem type="File"
+                            to="${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}"
+                            from="${OUTPUT_PATH}"
+                            perm="755"
+                            owner="root"
+                            group="bin"/>
         </packFileList>
       </packaging>
       <item path="src/SubProcess.cpp" ex="false" tool="1" flavor2="11">
--- a/src/SubProcess.cpp	Sat Dec 04 21:14:49 2021 +0100
+++ b/src/SubProcess.cpp	Sat Apr 23 19:08:11 2022 +0200
@@ -55,6 +55,7 @@
 	}
 
 	void write(string_t s) {
+		// if the value contains a null byte 0x00, it will be trimmed (passing 0x00 through would break the protocol)
 		subInputWriter << convertor.to_bytes(s).c_str();
 		subInputWriter.put(SEPARATOR);
 		if (subInputWriter.bad()) throw SubProcess::Exception(L"Unable to write to sub-process.");
--- a/streamlet-examples/streamlet-common.h	Sat Dec 04 21:14:49 2021 +0100
+++ b/streamlet-examples/streamlet-common.h	Sat Apr 23 19:08:11 2022 +0200
@@ -75,6 +75,7 @@
 	}
 
 	void writeString(std::wstring s) {
+		// if the value contains a null byte 0x00, it will be trimmed (passing 0x00 through would break the protocol)
 		std::cout << convertor.to_bytes(s.c_str());
 		std::cout.put(SEPARATOR);
 		if (std::cout.bad()) throw std::runtime_error("Unable to write to sub-process.");