Skip to content

Commit

Permalink
・フィルター編集ウィンドウでヘッダ名が自動補完されてしまうのを修正
Browse files Browse the repository at this point in the history
・<filesystem>から<boost\filesystem.hpp>へ変更
・wolfSSLをv4.4.0へ更新
・subjectAltNamesの処理を更新
  • Loading branch information
amate committed Jun 10, 2020
1 parent cfee419 commit fb1fffb
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Proxydomo/AppConst.h
Expand Up @@ -39,7 +39,7 @@
#endif

/// アプリケーションのバージョン
#define APP_VERSION _T("1.109")
#define APP_VERSION _T("1.110")



Expand Down
8 changes: 4 additions & 4 deletions Proxydomo/BlockListDatabase.cpp
Expand Up @@ -3,7 +3,7 @@
#include "BlockListDatabase.h"
#include <mutex>
#include <unordered_set>
#include <filesystem>
#include <boost\filesystem.hpp>
#include <boost\format.hpp>
#include <boost\algorithm\string.hpp>
#include "sqlite\sqlite3.h"
Expand All @@ -18,7 +18,7 @@ using namespace CodeConvert;

using namespace boost;
using boost::io::str;
using namespace std::experimental::filesystem;
using namespace boost::filesystem;

namespace {

Expand Down Expand Up @@ -382,7 +382,7 @@ bool CBlockListDatabase::ManageBlockListInfoAPI(const CUrl& url, SocketIF* sockB
} else if (boost::starts_with(url.getPath(), "/blocklistinfo/")) {
path urlPath = url.getPath();
if (urlPath.extension() == L".txt") {
std::string listName = urlPath.stem().u8string();
std::string listName = CodeConvert::UTF8fromUTF16(urlPath.stem().wstring());
std::string contentType;
std::string content;
if (url.getQuery() == L"?dl") {
Expand All @@ -403,7 +403,7 @@ bool CBlockListDatabase::ManageBlockListInfoAPI(const CUrl& url, SocketIF* sockB
return false;
}

content = CUtil::replaceAll(content, "%%title%%", urlPath.filename().u8string());
content = CUtil::replaceAll(content, "%%title%%", CodeConvert::UTF8fromUTF16(urlPath.filename().wstring()));

std::string tablebody;
for (const auto& patternLineHitCount : patternLineHitCountList) {
Expand Down
7 changes: 7 additions & 0 deletions Proxydomo/FilterEditWindow.cpp
Expand Up @@ -512,6 +512,7 @@ BOOL CFilterEditWindow::OnInitDialog(CWindow wndFocus, LPARAM lInitParam)
cmbHeaderName.AddString(headerName);

DoDataExchange(DDX_LOAD);
PostMessage(WM_DELAYINIT);

// ダイアログリサイズ初期化
DlgResize_Init(true, true, WS_CLIPCHILDREN | WS_THICKFRAME | WS_MAXIMIZEBOX);
Expand Down Expand Up @@ -547,6 +548,12 @@ BOOL CFilterEditWindow::OnInitDialog(CWindow wndFocus, LPARAM lInitParam)
return 0;
}

LRESULT CFilterEditWindow::OnDelayInit(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
DoDataExchange(DDX_LOAD);
return 0;
}

void CFilterEditWindow::OnDestroy()
{
std::string settingsPath = CT2A(Misc::GetExeDirectory() + _T("settings.ini"));
Expand Down
4 changes: 4 additions & 0 deletions Proxydomo/FilterEditWindow.h
Expand Up @@ -61,6 +61,8 @@ class CFilterEditWindow :
kMinEditHeight = 24,
kMatchReplaceSpace = 20,
kcyStaticReplaceTextMargin = 4,

WM_DELAYINIT = WM_APP + 1,
};

CFilterEditWindow(CFilterDescriptor* pfd);
Expand Down Expand Up @@ -110,6 +112,7 @@ class CFilterEditWindow :

BEGIN_MSG_MAP_EX( CFilterEditWindow )
MSG_WM_INITDIALOG( OnInitDialog )
MESSAGE_HANDLER_EX(WM_DELAYINIT, OnDelayInit)
MSG_WM_DESTROY( OnDestroy )
MSG_WM_SETCURSOR( OnSetCursor )
MSG_WM_LBUTTONDOWN( OnLButtonDown )
Expand All @@ -127,6 +130,7 @@ class CFilterEditWindow :
// void OnCommandIDHandlerEX(UINT uNotifyCode, int nID, CWindow wndCtl)

BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam);
LRESULT OnDelayInit(UINT uMsg, WPARAM wParam, LPARAM lParam);
void OnDestroy();

BOOL OnSetCursor(CWindow wnd, UINT nHitTest, UINT message);
Expand Down
1 change: 1 addition & 0 deletions Proxydomo/Logger.cpp
Expand Up @@ -10,6 +10,7 @@
#pragma comment(lib, "Shlwapi.lib")
#include "Settings.h"


namespace attrs = boost::log::attributes;
namespace expr = boost::log::expressions;
namespace sinks = boost::log::sinks;
Expand Down
3 changes: 2 additions & 1 deletion Proxydomo/Logger.h
Expand Up @@ -4,8 +4,9 @@

#pragma once

#define BOOST_USE_WINAPI_VERSION 0x0501
//#define BOOST_USE_WINAPI_VERSION 0x0501

#include <boost/log/core.hpp>
#include <boost/log/expressions.hpp>
#include <boost/log/sources/global_logger_storage.hpp>
#include <boost/log/support/date_time.hpp>
Expand Down
2 changes: 1 addition & 1 deletion Proxydomo/Proxydomo.vcxproj
Expand Up @@ -121,7 +121,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)wolfssl;$(SolutionDir)icu\include;$(SolutionDir)Proxydomo\brotli\include;$(SolutionDir)zlib\x86\include;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)icu\lib;$(SolutionDir)zlib\x86\lib;$(SolutionDir)sqlite\Win32;C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86;$(LibraryPath)</LibraryPath>
<LibraryPath>C:\Programing\boost_1_73_0\lib\lib;$(SolutionDir)icu\lib;$(SolutionDir)zlib\x86\lib;$(SolutionDir)sqlite\Win32;C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
Expand Down
4 changes: 2 additions & 2 deletions Proxydomo/RequestManager.cpp
Expand Up @@ -25,7 +25,7 @@
#include "RequestManager.h"
#include <sstream>
#include <limits>
#include <filesystem>
#include <boost\filesystem.hpp>
#include <boost\lexical_cast.hpp>
#include "DebugWindow.h"
#include "Log.h"
Expand All @@ -42,7 +42,7 @@
#include "proximodo\zlibbuffer.h"
#include "BrotliDecompressor.h"

using namespace std::experimental::filesystem;
using namespace boost::filesystem;
using namespace CodeConvert;

#define CR '\r'
Expand Down
4 changes: 2 additions & 2 deletions Proxydomo/UnitTest/Test_brotli.cpp
Expand Up @@ -10,11 +10,11 @@
//#endif

#include "..\BrotliDecompressor.h"
#include <filesystem>
#include <boost\filesystem.hpp>
#include "..\Misc.h"
#include "..\proximodo\util.h"

using path = std::experimental::filesystem::path;
using path = boost::filesystem::path;

///////////////////////////////////////////////////////////////////////////////////
// BrotliDecompressorTest
Expand Down
8 changes: 8 additions & 0 deletions Proxydomo/cpp.hint
@@ -0,0 +1,8 @@
// ヒント ファイルは、Visual Studio IDE が Visual C++ 識別子を解釈するのに役立ちます
// 関数およびマクロの名前などです。
// 詳細については次を参照してください https://go.microsoft.com/fwlink/?linkid=865984
#define BEGIN_MSG_MAP_EX(theClass) @<
#define END_MSG_MAP() @>
#define BEGIN_DDX_MAP(theClass) @<
#define END_DDX_MAP() @>
#define DECLARE_WND_CLASS_EX(WndClassName, style, bkgnd) static ATL::CWndClassInfo& GetWndClassInfo() { static ATL::CWndClassInfo wc = { { sizeof(WNDCLASSEX), style, StartWindowProc, 0, 0, NULL, NULL, NULL, (HBRUSH)(bkgnd + 1), NULL, WndClassName, NULL }, NULL, NULL, IDC_ARROW, TRUE, 0, _T("") }; return wc; }
13 changes: 13 additions & 0 deletions Proxydomo/ssl.cpp
Expand Up @@ -373,6 +373,18 @@ std::unique_ptr<serverCertAndKey> CreateServerCert(const std::string& host)
::strcpy_s(serverCert.subject.commonName, wildcardHost.c_str());
}
{ // subjectAltNames
serverCert.altNames[0] = 0x30;
serverCert.altNames[1] = (byte)host.size() + 2;

serverCert.altNames[2] = 0x82;
serverCert.altNames[3] = (byte)host.size();

::strncpy_s((char*)&serverCert.altNames[4],
std::size(serverCert.altNames) - 4,
host.c_str(), host.length());
serverCert.altNamesSz = 4 + (byte)host.size();

#if 0
enum { kHeaderSize = 13 };
serverCert.altNames[0] = 0x30;
serverCert.altNames[1] = kHeaderSize + (byte)host.size() - 2;
Expand All @@ -396,6 +408,7 @@ std::unique_ptr<serverCertAndKey> CreateServerCert(const std::string& host)
std::size(serverCert.altNames) - kHeaderSize,
host.c_str(), host.length());
serverCert.altNamesSz = kHeaderSize + (byte)host.size();
#endif
}

if (g_caKey.keyType == CAKey::kRsaKey) {
Expand Down
2 changes: 1 addition & 1 deletion Proxydomo/stdafx.h
Expand Up @@ -66,7 +66,6 @@ using std::max;
#include <random>
#include <algorithm>
#include <limits>
#include <filesystem>

#include <boost\lexical_cast.hpp>
#include <boost\format.hpp>
Expand All @@ -80,6 +79,7 @@ using std::max;
#include <boost\property_tree\ini_parser.hpp>
#include <boost\property_tree\xml_parser.hpp>
#include <boost\container\flat_set.hpp>
#include <boost\filesystem.hpp>


#if defined _M_IX86
Expand Down
4 changes: 2 additions & 2 deletions Readme.txt
Expand Up @@ -80,9 +80,9 @@ boost::shared_mutex
https://sites.google.com/site/boostjp/howtobuild
�R�}���h���C��
// x86
b2.exe install -j 16 --prefix=lib toolset=msvc-14.1 define=BOOST_USE_WINAPI_VERSION=0x0501 runtime-link=static --with-thread --with-date_time --with-timer --with-log
b2.exe install --prefix=lib toolset=msvc-14.2 runtime-link=static --with-thread --with-date_time --with-timer --with-log
// x64
b2.exe install -j 16 --prefix=lib64 toolset=msvc-14.1 define=BOOST_USE_WINAPI_VERSION=0x0501 runtime-link=static address-model=64 --with-thread --with-date_time --with-timer --with-log
b2.exe install --prefix=lib64 toolset=msvc-14.2 runtime-link=static address-model=64 --with-thread --with-date_time --with-timer --with-log

define=BOOST_USE_WINAPI_VERSION=0x0501
�͗v��Ȃ�����
Expand Down

0 comments on commit fb1fffb

Please sign in to comment.