Skip to content

Commit 844cb24

Browse files
author
Jesse Nicholson
committed
Fixes
Resolves TechnikEmpire#12, TechnikEmpire#29, TechnikEmpire#31, TechnikEmpire#30, TechnikEmpire#28, TechnikEmpire#27, TechnikEmpire#26, TechnikEmpire#16. HTML parsing is broken, and I also believe the keep-alive still isn't functioning correctly. Suspect that terminating CRLF's are not correct.
1 parent 54702b7 commit 844cb24

9 files changed

Lines changed: 587 additions & 478 deletions

ide/msvc/libhttpfilteringengine.vcxproj

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -212,17 +212,13 @@
212212
<Command>xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_zlib.dll" "$(OutDir)"
213213
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_bzip2.dll" "$(OutDir)"
214214
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_iostreams.dll" "$(OutDir)"
215-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_thread.dll" "$(OutDir)"
216215
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_system.dll" "$(OutDir)"
217-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_chrono.dll" "$(OutDir)"
218216
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_date_time.dll" "$(OutDir)"
219217
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\libeay32.dll" "$(OutDir)"
220218
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\ssleay32.dll" "$(OutDir)"
221219
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.dll" "$(OutDir)"
222220
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.sys" "$(OutDir)"
223-
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"
224-
xcopy /Y "$(ProjectDir)..\..\deps\gq\msvc\$(Configuration)\*.dll" "$(OutDir)"
225-
xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "$(OutDir)"</Command>
221+
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"</Command>
226222
</PostBuildEvent>
227223
</ItemDefinitionGroup>
228224
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">
@@ -261,17 +257,13 @@ xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "
261257
<Command>xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_zlib.dll" "$(OutDir)"
262258
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_bzip2.dll" "$(OutDir)"
263259
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_iostreams.dll" "$(OutDir)"
264-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_thread.dll" "$(OutDir)"
265260
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_system.dll" "$(OutDir)"
266-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_chrono.dll" "$(OutDir)"
267261
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_date_time.dll" "$(OutDir)"
268262
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\libeay32.dll" "$(OutDir)"
269263
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\ssleay32.dll" "$(OutDir)"
270264
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.dll" "$(OutDir)"
271265
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.sys" "$(OutDir)"
272-
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"
273-
xcopy /Y "$(ProjectDir)..\..\deps\gq\msvc\$(Configuration)\*.dll" "$(OutDir)"
274-
xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "$(OutDir)"</Command>
266+
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"</Command>
275267
</PostBuildEvent>
276268
</ItemDefinitionGroup>
277269
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug x86|x64'">
@@ -310,17 +302,13 @@ xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "
310302
<Command>xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_zlib.dll" "$(OutDir)"
311303
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_bzip2.dll" "$(OutDir)"
312304
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_iostreams.dll" "$(OutDir)"
313-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_thread.dll" "$(OutDir)"
314305
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_system.dll" "$(OutDir)"
315-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_chrono.dll" "$(OutDir)"
316306
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_date_time.dll" "$(OutDir)"
317307
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\libeay32.dll" "$(OutDir)"
318308
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\ssleay32.dll" "$(OutDir)"
319309
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.dll" "$(OutDir)"
320310
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.sys" "$(OutDir)"
321-
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"
322-
xcopy /Y "$(ProjectDir)..\..\deps\gq\msvc\$(Configuration)\*.dll" "$(OutDir)"
323-
xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "$(OutDir)"</Command>
311+
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"</Command>
324312
</PostBuildEvent>
325313
</ItemDefinitionGroup>
326314
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|x64'">
@@ -359,17 +347,13 @@ xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "
359347
<Command>xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_zlib.dll" "$(OutDir)"
360348
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_bzip2.dll" "$(OutDir)"
361349
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_iostreams.dll" "$(OutDir)"
362-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_thread.dll" "$(OutDir)"
363350
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_system.dll" "$(OutDir)"
364-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_chrono.dll" "$(OutDir)"
365351
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_date_time.dll" "$(OutDir)"
366352
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\libeay32.dll" "$(OutDir)"
367353
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\ssleay32.dll" "$(OutDir)"
368354
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.dll" "$(OutDir)"
369355
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.sys" "$(OutDir)"
370-
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"
371-
xcopy /Y "$(ProjectDir)..\..\deps\gq\msvc\$(Configuration)\*.dll" "$(OutDir)"
372-
xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "$(OutDir)"</Command>
356+
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"</Command>
373357
</PostBuildEvent>
374358
</ItemDefinitionGroup>
375359
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'">
@@ -407,17 +391,13 @@ xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "
407391
<Command>xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_zlib.dll" "$(OutDir)"
408392
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_bzip2.dll" "$(OutDir)"
409393
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_iostreams.dll" "$(OutDir)"
410-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_thread.dll" "$(OutDir)"
411394
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_system.dll" "$(OutDir)"
412-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_chrono.dll" "$(OutDir)"
413395
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_date_time.dll" "$(OutDir)"
414396
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\libeay32.dll" "$(OutDir)"
415397
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\ssleay32.dll" "$(OutDir)"
416398
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.dll" "$(OutDir)"
417399
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.sys" "$(OutDir)"
418-
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"
419-
xcopy /Y "$(ProjectDir)..\..\deps\gq\msvc\$(Configuration)\*.dll" "$(OutDir)"
420-
xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "$(OutDir)"</Command>
400+
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"</Command>
421401
</PostBuildEvent>
422402
</ItemDefinitionGroup>
423403
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">
@@ -455,17 +435,13 @@ xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "
455435
<Command>xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_zlib.dll" "$(OutDir)"
456436
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_bzip2.dll" "$(OutDir)"
457437
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_iostreams.dll" "$(OutDir)"
458-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_thread.dll" "$(OutDir)"
459438
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_system.dll" "$(OutDir)"
460-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_chrono.dll" "$(OutDir)"
461439
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_date_time.dll" "$(OutDir)"
462440
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\libeay32.dll" "$(OutDir)"
463441
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\ssleay32.dll" "$(OutDir)"
464442
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.dll" "$(OutDir)"
465443
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.sys" "$(OutDir)"
466-
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"
467-
xcopy /Y "$(ProjectDir)..\..\deps\gq\msvc\$(Configuration)\*.dll" "$(OutDir)"
468-
xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "$(OutDir)"</Command>
444+
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"</Command>
469445
</PostBuildEvent>
470446
</ItemDefinitionGroup>
471447
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release x86|x64'">
@@ -503,17 +479,13 @@ xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "
503479
<Command>xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_zlib.dll" "$(OutDir)"
504480
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_bzip2.dll" "$(OutDir)"
505481
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_iostreams.dll" "$(OutDir)"
506-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_thread.dll" "$(OutDir)"
507482
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_system.dll" "$(OutDir)"
508-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_chrono.dll" "$(OutDir)"
509483
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_date_time.dll" "$(OutDir)"
510484
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\libeay32.dll" "$(OutDir)"
511485
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\ssleay32.dll" "$(OutDir)"
512486
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.dll" "$(OutDir)"
513487
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.sys" "$(OutDir)"
514-
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"
515-
xcopy /Y "$(ProjectDir)..\..\deps\gq\msvc\$(Configuration)\*.dll" "$(OutDir)"
516-
xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "$(OutDir)"</Command>
488+
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"</Command>
517489
</PostBuildEvent>
518490
</ItemDefinitionGroup>
519491
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release x64|x64'">
@@ -551,17 +523,13 @@ xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "
551523
<Command>xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_zlib.dll" "$(OutDir)"
552524
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_bzip2.dll" "$(OutDir)"
553525
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_iostreams.dll" "$(OutDir)"
554-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_thread.dll" "$(OutDir)"
555526
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_system.dll" "$(OutDir)"
556-
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_chrono.dll" "$(OutDir)"
557527
xcopy /Y "$(ProjectDir)..\..\deps\boost\boost_1_60_0\stage\msvc\$(Configuration)\lib\boost_date_time.dll" "$(OutDir)"
558528
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\libeay32.dll" "$(OutDir)"
559529
xcopy /Y "$(ProjectDir)..\..\deps\openssl\msvc\$(Configuration)\bin\ssleay32.dll" "$(OutDir)"
560530
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.dll" "$(OutDir)"
561531
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\$(PlatformTarget)\*.sys" "$(OutDir)"
562-
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"
563-
xcopy /Y "$(ProjectDir)..\..\deps\gq\msvc\$(Configuration)\*.dll" "$(OutDir)"
564-
xcopy /Y "$(ProjectDir)..\..\deps\http-parser\msvc\$(Configuration)\lib\*.dll" "$(OutDir)"</Command>
532+
xcopy /Y "$(ProjectDir)..\..\deps\windivert\msvc\x64\*.sys" "$(OutDir)"</Command>
565533
</PostBuildEvent>
566534
</ItemDefinitionGroup>
567535
<ItemGroup>

src/te/httpengine/HttpFilteringEngineCAPI.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ const bool fe_ctl_start(PHttpFilteringEngineCtl ptr)
228228
}
229229
catch (std::exception& e)
230230
{
231-
231+
reinterpret_cast<te::httpengine::HttpFilteringEngineControl*>(ptr)->ReportError(e.what());
232232
}
233233
}
234234

@@ -261,7 +261,7 @@ void fe_ctl_stop(PHttpFilteringEngineCtl ptr)
261261
}
262262
catch (std::exception& e)
263263
{
264-
264+
reinterpret_cast<te::httpengine::HttpFilteringEngineControl*>(ptr)->ReportError(e.what());
265265
}
266266

267267
assert(success == true && u8"In fe_ctl_stop(PHttpFilteringEngineCtl) - Caught exception and failed to stop.");
@@ -289,7 +289,7 @@ const bool fe_ctl_is_running(PHttpFilteringEngineCtl ptr)
289289
}
290290
catch (std::exception& e)
291291
{
292-
292+
reinterpret_cast<te::httpengine::HttpFilteringEngineControl*>(ptr)->ReportError(e.what());
293293
}
294294

295295
assert(success == true && u8"In fe_ctl_is_running(PHttpFilteringEngineCtl) - Caught exception and failed to check status.");
@@ -319,7 +319,7 @@ uint16_t fe_ctl_get_http_listener_port(PHttpFilteringEngineCtl ptr)
319319
}
320320
catch (std::exception& e)
321321
{
322-
322+
reinterpret_cast<te::httpengine::HttpFilteringEngineControl*>(ptr)->ReportError(e.what());
323323
}
324324

325325
assert(success == true && u8"In fe_ctl_get_http_listener_port(PHttpFilteringEngineCtl) - Caught exception and failed to get HTTP listener port.");
@@ -349,7 +349,7 @@ uint16_t fe_ctl_get_https_listener_port(PHttpFilteringEngineCtl ptr)
349349
}
350350
catch (std::exception& e)
351351
{
352-
352+
reinterpret_cast<te::httpengine::HttpFilteringEngineControl*>(ptr)->ReportError(e.what());
353353
}
354354

355355
assert(success == true && u8"In fe_ctl_get_https_listener_port(PHttpFilteringEngineCtl) - Caught exception and failed to get HTTPs listener port.");
@@ -382,7 +382,7 @@ const bool fe_ctl_get_option(PHttpFilteringEngineCtl ptr, const uint32_t optionI
382382
}
383383
catch (std::exception& e)
384384
{
385-
385+
reinterpret_cast<te::httpengine::HttpFilteringEngineControl*>(ptr)->ReportError(e.what());
386386
}
387387

388388
assert(callSuccess == true && u8"In fe_ctl_get_option(PHttpFilteringEngineCtl) - Caught exception and failed to get option.");
@@ -413,7 +413,7 @@ void fe_ctl_set_option(PHttpFilteringEngineCtl ptr, const uint32_t optionId, con
413413
}
414414
catch (std::exception& e)
415415
{
416-
416+
reinterpret_cast<te::httpengine::HttpFilteringEngineControl*>(ptr)->ReportError(e.what());
417417
}
418418

419419
assert(callSuccess == true && u8"In fe_ctl_set_option(PHttpFilteringEngineCtl) - Caught exception and failed to set option.");
@@ -443,7 +443,7 @@ const bool fe_ctl_get_category(PHttpFilteringEngineCtl ptr, const uint8_t catego
443443
}
444444
catch (std::exception& e)
445445
{
446-
446+
reinterpret_cast<te::httpengine::HttpFilteringEngineControl*>(ptr)->ReportError(e.what());
447447
}
448448

449449
assert(callSuccess == true && u8"In fe_ctl_get_category(PHttpFilteringEngineCtl) - Caught exception and failed to get category.");
@@ -474,7 +474,7 @@ void fe_ctl_set_category(PHttpFilteringEngineCtl ptr, const uint8_t categoryId,
474474
}
475475
catch (std::exception& e)
476476
{
477-
477+
reinterpret_cast<te::httpengine::HttpFilteringEngineControl*>(ptr)->ReportError(e.what());
478478
}
479479

480480
assert(callSuccess == true && u8"In fe_ctl_set_category(PHttpFilteringEngineCtl) - Caught exception and failed to set category.");
@@ -516,7 +516,7 @@ const bool fe_ctl_load_list_from_file(
516516
}
517517
catch (std::exception& e)
518518
{
519-
519+
reinterpret_cast<te::httpengine::HttpFilteringEngineControl*>(ptr)->ReportError(e.what());
520520
}
521521

522522
assert(callSuccess == true && u8"In fe_ctl_load_list_from_file(...) - Caught exception and failed to set category.");
@@ -559,7 +559,7 @@ const bool fe_ctl_load_list_from_string(
559559
}
560560
catch (std::exception& e)
561561
{
562-
562+
reinterpret_cast<te::httpengine::HttpFilteringEngineControl*>(ptr)->ReportError(e.what());
563563
}
564564

565565
assert(callSuccess == true && u8"In fe_ctl_load_list_from_string(...) - Caught exception and failed to set category.");

src/te/httpengine/mitm/diversion/impl/win/WinDiverter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ namespace te
147147
for (auto& t : m_diversionThreads)
148148
{
149149
t.join();
150-
}
150+
}
151+
}
151152

152-
if (m_diversionHandle != nullptr)
153-
{
154-
WinDivertClose(m_diversionHandle);
155-
}
153+
if (m_diversionHandle != nullptr && m_diversionHandle != INVALID_HANDLE_VALUE)
154+
{
155+
WinDivertClose(m_diversionHandle);
156156
}
157157
}
158158

0 commit comments

Comments
 (0)