Skip to content

Commit

Permalink
Google CGI APIとの通信で受信タイムアウトが効いていなかったバグを修正しました。
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancorvussolis committed Jun 22, 2015
1 parent a5c4d3b commit 0388215
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.TXT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

-------------------------------------------------------------------------------

crvskkserv 2.1.0
crvskkserv 2.1.1

-------------------------------------------------------------------------------

Expand All @@ -12,7 +12,7 @@ SKK辞書サーバです。IPv4、IPv6に対応しています。
タスクトレイのアイコンから設定ダイアログを開き、ポートと辞書を設定して下さい。

辞書は、SKK辞書ファイル、SKK辞書サーバ、Google CGI API for Japanese Input に
対応しています。
対応しています。辞書の最大数は64個です。

改行LFでEUC-JIS-2004やUTF-8(BOMなし)等ASCIIと互換性のある文字コードのSKK辞書
ファイルが使用できます。
Expand Down
35 changes: 35 additions & 0 deletions crvskkserv/crvskkserv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ INT_PTR CALLBACK DlgProcSKKServ(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
ListView_SetColumnWidth(hWndListView, 0, LVSCW_AUTOSIZE);
ListView_EnsureVisible(hWndListView, index, FALSE);

if(ListView_GetItemCount(hWndListView) >= MAX_DICNUM)
{
EnableWindow(GetDlgItem(hPDlg, IDC_BUTTON_SKK_DIC_ADD), FALSE);
EnableWindow(GetDlgItem(hPDlg, IDC_BUTTON_SKKSERV_ADD), FALSE);
EnableWindow(GetDlgItem(hPDlg, IDC_BUTTON_GOOGLECGIAPI_ADD), FALSE);
}

EndDialog(hDlg, 0);
break;

Expand Down Expand Up @@ -354,6 +361,13 @@ INT_PTR CALLBACK DlgProcGoogleCGIAPI(HWND hDlg, UINT message, WPARAM wParam, LPA
ListView_SetColumnWidth(hWndListView, 0, LVSCW_AUTOSIZE);
ListView_EnsureVisible(hWndListView, index, FALSE);

if(ListView_GetItemCount(hWndListView) >= MAX_DICNUM)
{
EnableWindow(GetDlgItem(hPDlg, IDC_BUTTON_SKK_DIC_ADD), FALSE);
EnableWindow(GetDlgItem(hPDlg, IDC_BUTTON_SKKSERV_ADD), FALSE);
EnableWindow(GetDlgItem(hPDlg, IDC_BUTTON_GOOGLECGIAPI_ADD), FALSE);
}

EndDialog(hDlg, 0);
break;

Expand Down Expand Up @@ -426,6 +440,13 @@ INT_PTR CALLBACK DlgProcConfig(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP
}

ListView_SetColumnWidth(hWndListView, 0, LVSCW_AUTOSIZE);

if(ListView_GetItemCount(hWndListView) >= MAX_DICNUM)
{
EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_SKK_DIC_ADD), FALSE);
EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_SKKSERV_ADD), FALSE);
EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_GOOGLECGIAPI_ADD), FALSE);
}
return (INT_PTR)TRUE;

case WM_COMMAND:
Expand Down Expand Up @@ -525,6 +546,13 @@ INT_PTR CALLBACK DlgProcConfig(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP
ListView_SetItemState(hWndListView, index, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
ListView_SetColumnWidth(hWndListView, 0, LVSCW_AUTOSIZE);
ListView_EnsureVisible(hWndListView, index, FALSE);

if(ListView_GetItemCount(hWndListView) >= MAX_DICNUM)
{
EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_SKK_DIC_ADD), FALSE);
EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_SKKSERV_ADD), FALSE);
EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_GOOGLECGIAPI_ADD), FALSE);
}
}
return (INT_PTR)TRUE;

Expand All @@ -542,6 +570,13 @@ INT_PTR CALLBACK DlgProcConfig(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP
{
ListView_DeleteItem(hWndListView, index);
ListView_SetColumnWidth(hWndListView, 0, LVSCW_AUTOSIZE);

if(ListView_GetItemCount(hWndListView) < MAX_DICNUM)
{
EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_SKK_DIC_ADD), TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_SKKSERV_ADD), TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_GOOGLECGIAPI_ADD), TRUE);
}
}
return (INT_PTR)TRUE;

Expand Down
8 changes: 4 additions & 4 deletions crvskkserv/crvskkserv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
#pragma once

#define RC_PRODUCT "crvskkserv"
#define RC_VERSION "2.1.0"
#define RC_VERSION_D 2,1,0,0
#define RC_TITLE "crvskkserv (ver. 2.1.0)"
#define RC_VERSION "2.1.1"
#define RC_VERSION_D 2,1,1,0
#define RC_TITLE "crvskkserv (ver. 2.1.1)"
#define RC_AUTHOR "nathancorvussolis"

#define APP_TITLE L"crvskkserv"
#define APP_VERSION L"2.1.0"
#define APP_VERSION L"2.1.1"
#define RES_VER RC_PRODUCT "/" RC_VERSION " "

#define REQ_END '0'
Expand Down
4 changes: 2 additions & 2 deletions crvskkserv/search_google_cgiapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ void search_google_cgiapi(DICINFO &dicinfo, const std::string &key, std::string
if(hInet != NULL)
{
InternetSetOptionW(hInet, INTERNET_OPTION_CONNECT_TIMEOUT, &dwTimeout, sizeof(dwTimeout));
InternetSetOptionW(hInet, INTERNET_OPTION_DATA_SEND_TIMEOUT, &dwTimeout, sizeof(dwTimeout));
InternetSetOptionW(hInet, INTERNET_OPTION_DATA_RECEIVE_TIMEOUT, &dwTimeout, sizeof(dwTimeout));
InternetSetOptionW(hInet, INTERNET_OPTION_SEND_TIMEOUT, &dwTimeout, sizeof(dwTimeout));
InternetSetOptionW(hInet, INTERNET_OPTION_RECEIVE_TIMEOUT, &dwTimeout, sizeof(dwTimeout));

hUrl = InternetOpenUrlW(hInet, url, NULL, 0, 0, 0);
if(hUrl != NULL)
Expand Down

0 comments on commit 0388215

Please sign in to comment.