summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2018-11-07 14:54:36 +0300
committerdartraiden <wowemuh@gmail.com>2018-11-07 14:54:36 +0300
commit876075a808fcc61e2d859e217937fe64ff09aa0e (patch)
treebda14ceb27861c9f7bf32b3ccbca8fb600336db3 /src/mir_app
parentdeb3dda96648e7ae5b83c6ea3d35a92a0c1476fa (diff)
some files contains LF and CRLF simultaneously
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/netlib.cpp80
-rw-r--r--src/mir_app/src/netlib.h4
-rw-r--r--src/mir_app/src/netlibbind.cpp38
3 files changed, 61 insertions, 61 deletions
diff --git a/src/mir_app/src/netlib.cpp b/src/mir_app/src/netlib.cpp
index 62cdeb8f9c..6e096cef27 100644
--- a/src/mir_app/src/netlib.cpp
+++ b/src/mir_app/src/netlib.cpp
@@ -215,17 +215,17 @@ MIR_APP_DLL(int) Netlib_GetUserSettings(HNETLIBUSER nlu, NETLIBUSERSETTINGS *nlu
return 1;
}
-MIR_APP_DLL(int) Netlib_GetUserSettingsByName(char * UserSettingsName, NETLIBUSERSETTINGS *nlus)
-{
- mir_cslock lck(csNetlibUser);
- for (auto &it : netlibUser)
- if (!mir_strcmp(it->user.szSettingsModule, UserSettingsName))
- return Netlib_GetUserSettings(it, nlus);
-
- SetLastError(ERROR_INVALID_PARAMETER);
- return 0;
-}
-
+MIR_APP_DLL(int) Netlib_GetUserSettingsByName(char * UserSettingsName, NETLIBUSERSETTINGS *nlus)
+{
+ mir_cslock lck(csNetlibUser);
+ for (auto &it : netlibUser)
+ if (!mir_strcmp(it->user.szSettingsModule, UserSettingsName))
+ return Netlib_GetUserSettings(it, nlus);
+
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
MIR_APP_DLL(int) Netlib_SetUserSettings(HNETLIBUSER nlu, const NETLIBUSERSETTINGS *nlus)
{
if (GetNetlibHandleType(nlu) != NLH_USER || nlus == nullptr || nlus->cbSize != sizeof(NETLIBUSERSETTINGS)) {
@@ -237,16 +237,16 @@ MIR_APP_DLL(int) Netlib_SetUserSettings(HNETLIBUSER nlu, const NETLIBUSERSETTING
return 1;
}
-MIR_APP_DLL(int) Netlib_SetUserSettingsByName(char * UserSettingsName, NETLIBUSERSETTINGS *nlus)
-{
- mir_cslock lck(csNetlibUser);
- for (auto &it : netlibUser)
- if (!mir_strcmp(it->user.szSettingsModule, UserSettingsName))
- return Netlib_SetUserSettings(it, nlus);
-
- SetLastError(ERROR_INVALID_PARAMETER);
- return 0;
-}
+MIR_APP_DLL(int) Netlib_SetUserSettingsByName(char * UserSettingsName, NETLIBUSERSETTINGS *nlus)
+{
+ mir_cslock lck(csNetlibUser);
+ for (auto &it : netlibUser)
+ if (!mir_strcmp(it->user.szSettingsModule, UserSettingsName))
+ return Netlib_SetUserSettings(it, nlus);
+
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -263,23 +263,23 @@ void NetlibDoCloseSocket(NetlibConnection *nlc, bool noShutdown)
}
NETLIBCONNECTIONEVENTINFO ncei;
- ZeroMemory(&ncei, sizeof(ncei));
- ncei.connected = 0;
- ncei.szSettingsModule = nlc->nlu->user.szSettingsModule;
- int size = sizeof(SOCKADDR_IN);
- getsockname(nlc->s, (SOCKADDR *)&ncei.local, &size);
- if (nlc->nlu->settings.useProxy) {
- size = sizeof(SOCKADDR_IN);
- getpeername(nlc->s, (SOCKADDR *)&ncei.proxy, &size);
-
- }
- else {
- size = sizeof(SOCKADDR_IN);
- getpeername(nlc->s, (SOCKADDR *)&ncei.remote, &size);
-
- }
- NotifyFastHook(hEventDisconnected, (WPARAM)&ncei, 0);
-
+ ZeroMemory(&ncei, sizeof(ncei));
+ ncei.connected = 0;
+ ncei.szSettingsModule = nlc->nlu->user.szSettingsModule;
+ int size = sizeof(SOCKADDR_IN);
+ getsockname(nlc->s, (SOCKADDR *)&ncei.local, &size);
+ if (nlc->nlu->settings.useProxy) {
+ size = sizeof(SOCKADDR_IN);
+ getpeername(nlc->s, (SOCKADDR *)&ncei.proxy, &size);
+
+ }
+ else {
+ size = sizeof(SOCKADDR_IN);
+ getpeername(nlc->s, (SOCKADDR *)&ncei.remote, &size);
+
+ }
+ NotifyFastHook(hEventDisconnected, (WPARAM)&ncei, 0);
+
closesocket(nlc->s);
nlc->s = INVALID_SOCKET;
}
@@ -507,8 +507,8 @@ int LoadNetlibModule(void)
hRecvEvent = CreateHookableEvent(ME_NETLIB_FASTRECV);
hSendEvent = CreateHookableEvent(ME_NETLIB_FASTSEND);
- hEventConnected = CreateHookableEvent(ME_NETLIB_EVENT_CONNECTED);
- hEventDisconnected = CreateHookableEvent(ME_NETLIB_EVENT_DISCONNECTED);
+ hEventConnected = CreateHookableEvent(ME_NETLIB_EVENT_CONNECTED);
+ hEventDisconnected = CreateHookableEvent(ME_NETLIB_EVENT_DISCONNECTED);
NetlibUPnPInit();
NetlibLoadIeProxy();
diff --git a/src/mir_app/src/netlib.h b/src/mir_app/src/netlib.h
index 7457d1bb50..be134f7da8 100644
--- a/src/mir_app/src/netlib.h
+++ b/src/mir_app/src/netlib.h
@@ -146,8 +146,8 @@ void NetlibLeaveNestedCS(NetlibNestedCriticalSection *nlncs);
extern mir_cs csNetlibUser;
extern LIST<NetlibUser> netlibUser;
-extern HANDLE hEventConnected;
-extern HANDLE hEventDisconnected;
+extern HANDLE hEventConnected;
+extern HANDLE hEventDisconnected;
// netlibautoproxy.c
void NetlibLoadIeProxy(void);
diff --git a/src/mir_app/src/netlibbind.cpp b/src/mir_app/src/netlibbind.cpp
index f56fe5a4a0..e5318536ec 100644
--- a/src/mir_app/src/netlibbind.cpp
+++ b/src/mir_app/src/netlibbind.cpp
@@ -111,16 +111,16 @@ bool BindSocketToPort(const char *szPorts, SOCKET s, SOCKET s6, int* portn)
int NetlibFreeBoundPort(NetlibBoundPort *nlbp)
{
- NETLIBCONNECTIONEVENTINFO ncei;
-
- ZeroMemory(&ncei, sizeof(ncei));
- ncei.connected = 0;
- ncei.listening = 1;
- ncei.szSettingsModule = nlbp->nlu->user.szSettingsModule;
- int size = sizeof(SOCKADDR_IN);
- getsockname(nlbp->s, (SOCKADDR *)&ncei.local, &size);
- NotifyFastHook(hEventDisconnected, (WPARAM)&ncei, 0);
-
+ NETLIBCONNECTIONEVENTINFO ncei;
+
+ ZeroMemory(&ncei, sizeof(ncei));
+ ncei.connected = 0;
+ ncei.listening = 1;
+ ncei.szSettingsModule = nlbp->nlu->user.szSettingsModule;
+ int size = sizeof(SOCKADDR_IN);
+ getsockname(nlbp->s, (SOCKADDR *)&ncei.local, &size);
+ NotifyFastHook(hEventDisconnected, (WPARAM)&ncei, 0);
+
nlbp->close();
if (nlbp->hThread)
WaitForSingleObject(nlbp->hThread, INFINITE);
@@ -291,16 +291,16 @@ LBL_Error:
}
nlbp->hThread = mir_forkThread<NetlibBoundPort>(NetlibBindAcceptThread, nlbp);
-
- if (GetSubscribersCount((THook*)hEventConnected)) {
+
+ if (GetSubscribersCount((THook*)hEventConnected)) {
NETLIBCONNECTIONEVENTINFO ncei = {};
- ncei.connected = 1;
- ncei.listening = 1;
- ncei.szSettingsModule = nlu->user.szSettingsModule;
- memcpy(&ncei.local, &sin, sizeof(sin));
- NotifyFastHook(hEventConnected, (WPARAM)&ncei, 0);
- }
-
+ ncei.connected = 1;
+ ncei.listening = 1;
+ ncei.szSettingsModule = nlu->user.szSettingsModule;
+ memcpy(&ncei.local, &sin, sizeof(sin));
+ NotifyFastHook(hEventConnected, (WPARAM)&ncei, 0);
+ }
+
return nlbp;
}