diff --git a/examples/IR/ir_web.cpp b/examples/IR/ir_web.cpp index 3fd0ec40..19e577b2 100644 --- a/examples/IR/ir_web.cpp +++ b/examples/IR/ir_web.cpp @@ -57,7 +57,6 @@ extern U_EXPORT void runDynamicPage_ir_web(int param); } UHTTP::mime_index = U_html; - U_http_info.endHeader = 0; if (UHTTP::getDataSession() == false) UHTTP::setSessionCookie(); const char* ref = "?ext=help"; uint32_t num_args = UHTTP::processForm() / 2; @@ -192,5 +191,6 @@ extern U_EXPORT void runDynamicPage_ir_web(int param); U_CONSTANT_TO_PARAM(" \n\n") ); UHTTP::putDataSession(); + U_http_info.endHeader = 0; } } \ No newline at end of file diff --git a/examples/WiAuth/cdbmake.cpp b/examples/WiAuth/cdbmake.cpp index 83ba6772..f9e14bf0 100644 --- a/examples/WiAuth/cdbmake.cpp +++ b/examples/WiAuth/cdbmake.cpp @@ -96,16 +96,18 @@ public: records = output; } +# if defined(U_EVASIVE_SUPPORT) || defined(U_THROTTLING_SUPPORT) UString basename = UStringExt::basename(filename); const char* p = basename.data(); -# ifdef U_EVASIVE_SUPPORT - if (memcmp(p, U_CONSTANT_TO_PARAM("Evasive")) == 0) UCDB::getValueFromBuffer = UServer_Base::getEvasiveRecFromBuffer; -# endif -# ifdef U_THROTTLING_SUPPORT - if (memcmp(p, U_CONSTANT_TO_PARAM("BandWidthThrottling")) == 0) UCDB::getValueFromBuffer = UServer_Base::getThrottlingRecFromBuffer; -# endif +# ifdef U_EVASIVE_SUPPORT + if (memcmp(p, U_CONSTANT_TO_PARAM("Evasive")) == 0) UCDB::getValueFromBuffer = UServer_Base::getEvasiveRecFromBuffer; +# endif +# ifdef U_THROTTLING_SUPPORT + if (memcmp(p, U_CONSTANT_TO_PARAM("BandWidthThrottling")) == 0) UCDB::getValueFromBuffer = UServer_Base::getThrottlingRecFromBuffer; +# endif +# endif istrstream is(U_STRING_TO_PARAM(records)); diff --git a/examples/WiAuth/v2/wi_auth2.cpp b/examples/WiAuth/v2/wi_auth2.cpp index 26fec0c0..d4920478 100644 --- a/examples/WiAuth/v2/wi_auth2.cpp +++ b/examples/WiAuth/v2/wi_auth2.cpp @@ -22,7 +22,6 @@ extern U_EXPORT void runDynamicPage_wi_auth2(int param); return; } - U_http_info.endHeader = 0; static UHTTP::service_info GET_table[] = { // NB: the table must be ordered alphabetically for binary search... GET_ENTRY(anagrafica), GET_ENTRY(checkCaptive), @@ -43,5 +42,6 @@ extern U_EXPORT void runDynamicPage_wi_auth2(int param); UHTTP::manageRequest(GET_table, U_NUM_ELEMENTS(GET_table), POST_table, U_NUM_ELEMENTS(POST_table)); + U_http_info.endHeader = 0; } } \ No newline at end of file diff --git a/examples/WiAuth/wi_auth.cpp b/examples/WiAuth/wi_auth.cpp index 63968438..4098097f 100644 --- a/examples/WiAuth/wi_auth.cpp +++ b/examples/WiAuth/wi_auth.cpp @@ -22,7 +22,6 @@ extern U_EXPORT void runDynamicPage_wi_auth(int param); return; } - U_http_info.endHeader = 0; static UHTTP::service_info GET_table[] = { // NB: the table must be ordered alphabetically for binary search... GET_ENTRY(admin), GET_ENTRY(admin_continuing_status_ap), @@ -104,5 +103,6 @@ extern U_EXPORT void runDynamicPage_wi_auth(int param); if (U_http_info.nResponseCode == 0) (void) UClientImage_Base::environment->append(U_CONSTANT_TO_PARAM("HTTP_RESPONSE_CODE=0\n")); + U_http_info.endHeader = 0; } } \ No newline at end of file diff --git a/include/ulib/debug/macro.h b/include/ulib/debug/macro.h index 299825d9..3876495d 100644 --- a/include/ulib/debug/macro.h +++ b/include/ulib/debug/macro.h @@ -228,16 +228,16 @@ if (envp) \ # define U_DUMP_CONTAINER(obj) { if (utr.active[0] && (obj).getSpaceToDump() < U_MAX_SIZE_PREALLOCATE) u_trace_dump(U_CONSTANT_TO_PARAM(#obj" = %O"), U_OBJECT_TO_TRACE((obj))); } # define U_DUMP_OBJECT_TO_TMP(obj,fname) \ - { char _buffer[2 * 1024 * 1024]; \ - uint32_t _n = UObject2String((obj), _buffer, sizeof(_buffer)); \ - U_INTERNAL_ASSERT_MINOR(_n, sizeof(_buffer)) \ - (void) UFile::writeToTmp(_buffer, _n, O_RDWR | O_TRUNC, U_CONSTANT_TO_PARAM(#fname".%P"), 0); } + { char _lbuffer[2 * 1024 * 1024]; \ + uint32_t _n = UObject2String((obj), _lbuffer, sizeof(_lbuffer)); \ + U_INTERNAL_ASSERT_MINOR(_n, sizeof(_lbuffer)) \ + (void) UFile::writeToTmp(_lbuffer, _n, O_RDWR | O_TRUNC, U_CONSTANT_TO_PARAM(#fname".%P"), 0); } # define U_DUMP_OBJECT_WITH_CHECK(msg,check_object) \ if (UObjectDB::fd > 0) { \ - char _buffer[4096]; \ - uint32_t _n = UObjectDB::dumpObject(_buffer, sizeof(_buffer), (check_object)); \ - if (utr.active[0]) u_trace_dump(U_CONSTANT_TO_PARAM(msg " = \n%.*s\n"), U_min(_n,4000), _buffer); } + char _lbuffer[4096]; \ + uint32_t _n = UObjectDB::dumpObject(_lbuffer, sizeof(_lbuffer), (check_object)); \ + if (utr.active[0]) u_trace_dump(U_CONSTANT_TO_PARAM(msg " = \n%.*s\n"), U_min(_n,4000), _lbuffer); } # else /* U_STDCPP_ENABLE */ # define U_REGISTER_OBJECT(CLASS) diff --git a/include/ulib/orm/driver/orm_driver_mysql.h b/include/ulib/orm/driver/orm_driver_mysql.h index 035c1c25..9c1305fd 100644 --- a/include/ulib/orm/driver/orm_driver_mysql.h +++ b/include/ulib/orm/driver/orm_driver_mysql.h @@ -327,13 +327,7 @@ public: { U_TRACE_NO_PARAM(0, "UMySqlStatementBindResult::setString()") - U_INTERNAL_ASSERT_POINTER(pstr) - U_INTERNAL_ASSERT(pstr->invariant()) - - if (length > 0) pstr->setConstant(str_data, length); - else pstr->setEmpty(); - - U_INTERNAL_DUMP("pstr(%u) = %V", length, pstr->rep) + USqlStatementBindResult::setString(str_data, length); } // DEBUG diff --git a/include/ulib/string.h b/include/ulib/string.h index 26f28e3c..195386a3 100644 --- a/include/ulib/string.h +++ b/include/ulib/string.h @@ -326,10 +326,12 @@ public: U_CHECK_MEMORY - int r = memcmp(str, s, U_min(_length, n)); - U_INTERNAL_DUMP("str = %.*S", U_min(_length, n), str) + if (*str != *s) U_RETURN(*(const unsigned char*)str - *(const unsigned char*)s); + + int r = memcmp(str+1, s+1, U_min(_length, n)-1); + if (r == 0) r = (_length - n); U_RETURN(r); diff --git a/src/ulib/net/server/plugin/usp/fortune.h b/src/ulib/net/server/plugin/usp/fortune.h index f377ed45..3271e775 100644 --- a/src/ulib/net/server/plugin/usp/fortune.h +++ b/src/ulib/net/server/plugin/usp/fortune.h @@ -3,12 +3,11 @@ #ifndef FORTUNE_H #define FORTUNE_H 1 -#include - #include #include #include #include +#include #include class Fortune { @@ -33,16 +32,20 @@ public: # endif } - Fortune(uint32_t _id, const UString& _message) : id(_id), message(_message) + Fortune(uint32_t _id, const UString& _message) : id(_id), message(100U) { U_TRACE_CTOR(5, Fortune, "%u,%V", _id, _message.rep) + + UXMLEscape::encode(_message, message); } - Fortune(const Fortune& f) : id(f.id), message(f.message) + Fortune(const Fortune& f) : id(f.id), message(100U) { U_TRACE_CTOR(5, Fortune, "%p", &f) U_MEMORY_TEST_COPY(f) + + UXMLEscape::encode(f.message, message); } ~Fortune() @@ -137,7 +140,7 @@ public: Fortune* elem; - for (uint32_t i = 0, n = pvfortune->size(); i < n; ++i) + for (uint32_t sz, i = 0, n = pvfortune->size(); i < n; ++i) { elem = pvfortune->at(i); @@ -150,7 +153,8 @@ public: *pwbuffer++ = '>'; - pwbuffer += u_xml_encode((const unsigned char*)U_STRING_TO_PARAM(elem->message), (unsigned char*)pwbuffer); + (void) memcpy(pwbuffer, elem->message.data(), sz = elem->message.size()); + pwbuffer += sz; u_put_unalignedp64(pwbuffer, U_MULTICHAR_CONSTANT64('<','/','t','d','>','<','/','t')); u_put_unalignedp16(pwbuffer+8, U_MULTICHAR_CONSTANT16('r','>')); diff --git a/src/ulib/net/server/plugin/usp/usp_translator.cpp b/src/ulib/net/server/plugin/usp/usp_translator.cpp index 158507be..7c9ae63c 100644 --- a/src/ulib/net/server/plugin/usp/usp_translator.cpp +++ b/src/ulib/net/server/plugin/usp/usp_translator.cpp @@ -328,13 +328,14 @@ public: setDirectiveItem(directive, U_CONSTANT_SIZE("vcode")); - U_INTERNAL_ASSERT(token) + if (token) + { + token = UStringExt::substitute(token, '\n', U_CONSTANT_TO_PARAM("\n\t")); - token = UStringExt::substitute(token, '\n', U_CONSTANT_TO_PARAM("\n\t")); + vcode.setBuffer(20U + token.size()); - vcode.setBuffer(20U + token.size()); - - vcode.snprintf(U_CONSTANT_TO_PARAM("\n\t%v\n\t\n"), token.rep); + vcode.snprintf(U_CONSTANT_TO_PARAM("\n\t%v\n\t\n"), token.rep); + } } else if (strncmp(directive, U_CONSTANT_TO_PARAM("pcode")) == 0) // parallelization code (long running task) { @@ -342,15 +343,18 @@ public: setDirectiveItem(directive, U_CONSTANT_SIZE("pcode")); - U_INTERNAL_ASSERT(token) + if (token) + { + if (U_STRING_FIND(token, 0, "return") != U_NOT_FOUND) U_WARNING("use of 'return' inside usp can cause problem, please avoid it"); - token = UStringExt::substitute(token, '\n', U_CONSTANT_TO_PARAM("\n\t")); + token = UStringExt::substitute(token, '\n', U_CONSTANT_TO_PARAM("\n\t")); - (void) output0.reserve(20U + token.size()); + (void) output0.reserve(20U + token.size()); - output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\t%v\n\t\n"), token.rep); + output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\t%v\n\t\n"), token.rep); - (void) vcode.append(U_CONSTANT_TO_PARAM("\tif (UServer_Base::startParallelization()) { U_http_info.nResponseCode = HTTP_CONTINUE; return; }\n\t\n")); + (void) vcode.append(U_CONSTANT_TO_PARAM("\tif (UServer_Base::startParallelization()) { U_http_info.nResponseCode = HTTP_CONTINUE; return; }\n\t\n")); + } } else if (strncmp(directive, U_CONSTANT_TO_PARAM("lcode")) == 0) // load balance code { @@ -358,19 +362,22 @@ public: setDirectiveItem(directive, U_CONSTANT_SIZE("lcode")); - U_INTERNAL_ASSERT(token) + if (token) + { + if (U_STRING_FIND(token, 0, "return") != U_NOT_FOUND) U_WARNING("use of 'return' inside usp can cause problem, please avoid it"); - token = UStringExt::substitute(token, '\n', U_CONSTANT_TO_PARAM("\n\t")); + token = UStringExt::substitute(token, '\n', U_CONSTANT_TO_PARAM("\n\t")); - (void) output0.reserve(20U + token.size()); + (void) output0.reserve(20U + token.size()); - output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\t%v\n\t\n"), token.rep); + output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\t%v\n\t\n"), token.rep); - (void) vcode.append(U_CONSTANT_TO_PARAM("\tif (UServer_Base::startParallelization()) { U_http_info.nResponseCode = HTTP_CONTINUE; return; }\n\t\n")); + (void) vcode.append(U_CONSTANT_TO_PARAM("\tif (UServer_Base::startParallelization()) { U_http_info.nResponseCode = HTTP_CONTINUE; return; }\n\t\n")); -# ifdef USE_LOAD_BALANCE - (void) vcode.append(U_CONSTANT_TO_PARAM("\tif (UHTTP::manageRequestOnRemoteServer()) return;\n\t\n")); -# endif +# ifdef USE_LOAD_BALANCE + (void) vcode.append(U_CONSTANT_TO_PARAM("\tif (UHTTP::manageRequestOnRemoteServer()) return;\n\t\n")); +# endif + } } else if (strncmp(directive, U_CONSTANT_TO_PARAM("code")) == 0) // generic code { @@ -380,6 +387,8 @@ public: if (token) { + if (U_STRING_FIND(token, 0, "return") != U_NOT_FOUND) U_WARNING("use of 'return' inside usp can cause problem, please avoid it"); + token = UStringExt::substitute(token, '\n', U_CONSTANT_TO_PARAM("\n\t")); (void) output0.reserve(20U + token.size()); @@ -479,12 +488,13 @@ public: U_ASSERT(encoded.isQuoted()) + (void) output2.reserve(200U); (void) http_header.reserve(200U + encoded.size()); (void) http_header.snprintf(U_CONSTANT_TO_PARAM("\n\tU_ASSERT_EQUALS(UClientImage_Base::wbuffer->findEndHeader(),false)" - "\n\tU_http_info.endHeader = %.*s%u;" - "\n\t(void) UClientImage_Base::wbuffer->insert(0, U_CONSTANT_TO_PARAM(%v));\n\t\n"), - bheader ? U_CONSTANT_SIZE("(uint32_t)-") : 0, "(uint32_t)-", n, encoded.rep); + "\n\t(void) UClientImage_Base::wbuffer->insert(0, U_CONSTANT_TO_PARAM(%v));\n\t\n"), encoded.rep); + + (void) output2.snprintf_add(U_CONSTANT_TO_PARAM("\n\tU_http_info.endHeader = %.*s%u;\n"), bheader ? U_CONSTANT_SIZE("(uint32_t)-") : 0, "(uint32_t)-", n); } else if (strncmp(directive, U_CONSTANT_TO_PARAM("number")) == 0) { @@ -504,11 +514,12 @@ public: setDirectiveItem(directive, U_CONSTANT_SIZE("puts")); - U_INTERNAL_ASSERT(token) + if (token) + { + (void) output0.reserve(100U + token.size()); - (void) output0.reserve(100U + token.size()); - - output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\t(void) UClientImage_Base::wbuffer->append((%v));\n"), token.rep); + output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\t(void) UClientImage_Base::wbuffer->append((%v));\n"), token.rep); + } } else if (strncmp(directive, U_CONSTANT_TO_PARAM("xmlputs")) == 0) { @@ -516,11 +527,12 @@ public: setDirectiveItem(directive, U_CONSTANT_SIZE("xmlputs")); - U_INTERNAL_ASSERT(token) + if (token) + { + (void) output0.reserve(100U + token.size()); - (void) output0.reserve(100U + token.size()); - - output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\tUSP_XML_PUTS((%v));\n"), token.rep); + output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\tUSP_XML_PUTS((%v));\n"), token.rep); + } } else if (strncmp(directive, U_CONSTANT_TO_PARAM("cout")) == 0) { @@ -530,12 +542,13 @@ public: setDirectiveItem(directive, U_CONSTANT_SIZE("cout")); - U_INTERNAL_ASSERT(token) + if (token) + { + (void) output0.reserve(200U + token.size()); - (void) output0.reserve(200U + token.size()); - - output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\tusp_sz = UObject2String((%v), usp_buffer, sizeof(usp_buffer));" - "\n\t(void) UClientImage_Base::wbuffer->append(usp_buffer, usp_sz);\n"), token.rep); + output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\tusp_sz = UObject2String((%v), usp_buffer, sizeof(usp_buffer));" + "\n\t(void) UClientImage_Base::wbuffer->append(usp_buffer, usp_sz);\n"), token.rep); + } } else if (strncmp(directive, U_CONSTANT_TO_PARAM("print")) == 0) { @@ -547,26 +560,27 @@ public: setDirectiveItem(directive, (bfor ? U_CONSTANT_SIZE("printfor") : U_CONSTANT_SIZE("print"))); - U_INTERNAL_ASSERT(token) - - (void) output0.reserve(200U + token.size()); - - UVector vec(token, ';'); - - if (bfor) + if (token) { - U_ASSERT_EQUALS(vec.size(), 5) + (void) output0.reserve(200U + token.size()); - output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\tfor (%v; %v; %v) { usp_sz = u__snprintf(usp_buffer, sizeof(usp_buffer), %v, %v);" - "(void) UClientImage_Base::wbuffer->append(usp_buffer, usp_sz); }\n"), - vec[0].rep, vec[1].rep, vec[2].rep, vec[3].rep, vec[4].rep); - } - else - { - U_ASSERT_EQUALS(vec.size(), 2) + UVector vec(token, ';'); - output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\tusp_sz = u__snprintf(usp_buffer, sizeof(usp_buffer), %v, %v);" - "(void) UClientImage_Base::wbuffer->append(usp_buffer, usp_sz);\n"), vec[0].rep, vec[1].rep); + if (bfor) + { + U_ASSERT_EQUALS(vec.size(), 5) + + output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\tfor (%v; %v; %v) { usp_sz = u__snprintf(usp_buffer, sizeof(usp_buffer), %v, %v);" + "(void) UClientImage_Base::wbuffer->append(usp_buffer, usp_sz); }\n"), + vec[0].rep, vec[1].rep, vec[2].rep, vec[3].rep, vec[4].rep); + } + else + { + U_ASSERT_EQUALS(vec.size(), 2) + + output0.snprintf_add(U_CONSTANT_TO_PARAM("\n\tusp_sz = u__snprintf(usp_buffer, sizeof(usp_buffer), %v, %v);" + "(void) UClientImage_Base::wbuffer->append(usp_buffer, usp_sz);\n"), vec[0].rep, vec[1].rep); + } } } } @@ -829,10 +843,10 @@ loop: distance = t.getDistance(); { if (is_html) (void) http_header.append(U_CONSTANT_TO_PARAM("\n\tUHTTP::mime_index = U_html;\n")); - (void) http_header.append(U_CONSTANT_TO_PARAM("\n\tU_http_info.endHeader = 0;\n")); + (void) output2.append(U_CONSTANT_TO_PARAM("\n\tU_http_info.endHeader = 0;\n")); } - UString result(1024U + declaration.size() + http_header.size() + output0.size() + output1.size() + vars.size()); + UString result(1024U + declaration.size() + http_header.size() + output0.size() + output1.size() + output2.size() + vars.size()); result.snprintf(U_CONSTANT_TO_PARAM( "// %.*s.cpp - dynamic page translation (%.*s.usp => %.*s.cpp)\n" @@ -867,6 +881,7 @@ loop: distance = t.getDistance(); "%s" "%v" "%v" + "%v" "\t\n" "} }\n"), basename_sz, basename_ptr, @@ -889,7 +904,8 @@ loop: distance = t.getDistance(); http_header.rep, ptr8, output0.rep, - output1.rep); + output1.rep, + output2.rep); UString name(200U); @@ -901,7 +917,7 @@ loop: distance = t.getDistance(); private: UTokenizer t; UVector vdefine; - UString pinclude, usp, token, output0, output1, declaration, vcode, http_header, sseloop, vars; + UString pinclude, usp, token, output0, output1, output2, declaration, vcode, http_header, sseloop, vars; const char* basename_ptr; uint32_t basename_sz; bool bvar, bsession, bstorage, bfirst_pass, is_html, test_if_html, bpreprocessing_failed; diff --git a/src/ulib/orm/driver/orm_driver_mysql.cpp b/src/ulib/orm/driver/orm_driver_mysql.cpp index 4fd8c7b7..c2ae6b79 100644 --- a/src/ulib/orm/driver/orm_driver_mysql.cpp +++ b/src/ulib/orm/driver/orm_driver_mysql.cpp @@ -371,7 +371,7 @@ bool UMySqlStatement::setBindParam(UOrmDriver* pdrv) MYSQL_BIND* mysql_param = mysql_vparam+i; - if ((mysql_param->buffer_type = (enum_field_types)param->type) == U_UTF_VALUE) + if ((mysql_param->buffer_type = (enum_field_types)param->type) == (enum_field_types)U_UTF_VALUE) { U_INTERNAL_ASSERT_POINTER(param->pstr) U_INTERNAL_ASSERT(param->pstr->invariant()) diff --git a/tests/examples/TSA/tsaserial b/tests/examples/TSA/tsaserial index 73ccc29c..aafa4b30 100644 --- a/tests/examples/TSA/tsaserial +++ b/tests/examples/TSA/tsaserial @@ -1 +1 @@ -0134 +0142 diff --git a/tests/examples/benchmark/FrameworkBenchmarks/ULib/src/fortune.h b/tests/examples/benchmark/FrameworkBenchmarks/ULib/src/fortune.h index 41f1e4d5..f3e00408 100644 --- a/tests/examples/benchmark/FrameworkBenchmarks/ULib/src/fortune.h +++ b/tests/examples/benchmark/FrameworkBenchmarks/ULib/src/fortune.h @@ -3,12 +3,11 @@ #ifndef FORTUNE_H #define FORTUNE_H 1 -#include - #include #include #include #include +#include #include class Fortune { @@ -33,16 +32,20 @@ public: # endif } - Fortune(uint32_t _id, const UString& _message) : id(_id), message(_message) + Fortune(uint32_t _id, const UString& _message) : id(_id), message(100U) { U_TRACE_CTOR(5, Fortune, "%u,%V", _id, _message.rep) + + UXMLEscape::encode(_message, message); } - Fortune(const Fortune& f) : id(f.id), message((void*)U_STRING_TO_PARAM(f.message)) + Fortune(const Fortune& f) : id(f.id), message(100U) { U_TRACE_CTOR(5, Fortune, "%p", &f) U_MEMORY_TEST_COPY(f) + + UXMLEscape::encode(f.message, message); } ~Fortune() @@ -137,7 +140,7 @@ public: Fortune* elem; - for (uint32_t i = 0, n = pvfortune->size(); i < n; ++i) + for (uint32_t sz, i = 0, n = pvfortune->size(); i < n; ++i) { elem = pvfortune->at(i); @@ -150,7 +153,8 @@ public: *pwbuffer++ = '>'; - pwbuffer += u_xml_encode((const unsigned char*)U_STRING_TO_PARAM(elem->message), (unsigned char*)pwbuffer); + (void) memcpy(pwbuffer, elem->message.data(), sz = elem->message.size()); + pwbuffer += sz; u_put_unalignedp64(pwbuffer, U_MULTICHAR_CONSTANT64('<','/','t','d','>','<','/','t')); u_put_unalignedp16(pwbuffer+8, U_MULTICHAR_CONSTANT16('r','>')); diff --git a/tests/ulib/http2/hencode.cpp b/tests/ulib/http2/hencode.cpp index 65e9de47..1d38a0b8 100644 --- a/tests/ulib/http2/hencode.cpp +++ b/tests/ulib/http2/hencode.cpp @@ -40,10 +40,10 @@ public: char buffer[4096]; unsigned char* dst; UString token, name, value; - uint8_t prefix_max, pattern; + uint8_t prefix_max = 0x00, pattern = 0x00; UVector vline(content,'\n'), vtoken; uint32_t i, l, n = vline.size(), num, cnt = 0, idx, index; - bool cut = false, bvalue_is_indexed = false, binsert_dynamic_table = false; + bool bvalue_is_indexed = false, binsert_dynamic_table = false; UHTTP2::HpackHeaderTableEntry* entry; UHTTP2::HpackDynamicTable* dyntbl = &(UHTTP2::pConnection->odyntbl); @@ -79,7 +79,6 @@ start: token = vtoken[0]; U_INTERNAL_ASSERT_MAJOR(cnt, 0) cnt = 0; - cut = true; } else if (token.equal(U_CONSTANT_TO_PARAM("trim"))) { @@ -204,7 +203,7 @@ start: token = vtoken[0]; for (l = 5; l < num; ++l) value += ' ' + vtoken[l]; -check1: if (vtoken[1].equal(U_CONSTANT_TO_PARAM("idx")) == false) + if (vtoken[1].equal(U_CONSTANT_TO_PARAM("idx")) == false) { // not-existing name