FFFTPのソースコードです。
Revisão | 342cbadfff643ffabaaf0a96cb9e02a2fbbdde31 (tree) |
---|---|
Hora | 2013-02-18 01:30:27 |
Autor | s_kawamoto <s_kawamoto@user...> |
Commiter | s_kawamoto |
Fix bugs of handling of UPnP.
@@ -106,6 +106,8 @@ extern int PasvDefault; | ||
106 | 106 | extern int QuickAnonymous; |
107 | 107 | // 切断対策 |
108 | 108 | extern int TimeOut; |
109 | +// UPnP対応 | |
110 | +extern int UPnPEnabled; | |
109 | 111 | |
110 | 112 | /*===== ローカルなワーク =====*/ |
111 | 113 |
@@ -2729,7 +2731,7 @@ SOCKET GetFTPListenSocketIPv4(SOCKET ctrl_skt, int *CancelCheckWork) | ||
2729 | 2731 | a = (char *)&saTmpAddr.sin_addr; |
2730 | 2732 | p = (char *)&saCtrlAddr.sin_port; |
2731 | 2733 | // UPnP対応 |
2732 | - if(IsUPnPLoaded() == YES) | |
2734 | + if(IsUPnPLoaded() == YES && UPnPEnabled == YES) | |
2733 | 2735 | { |
2734 | 2736 | if(AddPortMapping(AddressToStringIPv4(Adrs, &saTmpAddr.sin_addr), ntohs(saCtrlAddr.sin_port)) == FFFTP_SUCCESS) |
2735 | 2737 | SetAsyncTableDataMapPort(listen_skt, ntohs(saCtrlAddr.sin_port)); |
@@ -2886,7 +2888,7 @@ SOCKET GetFTPListenSocketIPv6(SOCKET ctrl_skt, int *CancelCheckWork) | ||
2886 | 2888 | a = (char *)&saTmpAddr.sin6_addr; |
2887 | 2889 | p = (char *)&saCtrlAddr.sin6_port; |
2888 | 2890 | // UPnP対応 |
2889 | - if(IsUPnPLoaded() == YES) | |
2891 | + if(IsUPnPLoaded() == YES && UPnPEnabled == YES) | |
2890 | 2892 | { |
2891 | 2893 | if(AddPortMapping(AddressToStringIPv6(Adrs, &saTmpAddr.sin6_addr), ntohs(saCtrlAddr.sin6_port)) == FFFTP_SUCCESS) |
2892 | 2894 | SetAsyncTableDataMapPort(listen_skt, ntohs(saCtrlAddr.sin6_port)); |
@@ -257,7 +257,7 @@ int LocalKanjiCode = KANJI_SJIS; | ||
257 | 257 | // 自動切断対策 |
258 | 258 | int NoopEnable = NO; |
259 | 259 | // UPnP対応 |
260 | -int UPnPEnabled = NO; | |
260 | +int UPnPEnabled = YES; | |
261 | 261 | time_t LastDataConnectionTime = 0; |
262 | 262 | |
263 | 263 |