From: <arn...@us...> - 2007-11-15 18:25:15
|
Revision: 908 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=908&view=rev Author: arnetheduck Date: 2007-11-15 10:25:09 -0800 (Thu, 15 Nov 2007) Log Message: ----------- patches Modified Paths: -------------- dcplusplus/trunk/ADC.txt dcplusplus/trunk/changelog.txt dcplusplus/trunk/smartwin/include/smartwin/GCCHeaders.h dcplusplus/trunk/smartwin/include/smartwin/VCDesktopHeaders.h dcplusplus/trunk/smartwin/source/widgets/WidgetListView.cpp dcplusplus/trunk/win32/WinUtil.cpp Modified: dcplusplus/trunk/ADC.txt =================================================================== --- dcplusplus/trunk/ADC.txt 2007-11-15 16:00:50 UTC (rev 907) +++ dcplusplus/trunk/ADC.txt 2007-11-15 18:25:09 UTC (rev 908) @@ -478,7 +478,6 @@ HO | integer | Hubs where user is op and in NORMAL state TO | string | Token, as received in RCM/CTM, when establishing a C-C connection. CT | integer | Client (user) type, 1=bot, 2=registered user, 3=operator, 4=hub owner, 5=hub (used when the hub sends an INF about itself) -RG | integer | 1=registered AW | integer | 1=Away, 2=Extended away, not interested in hub chat (hubs may skip sending broadcast type MSG commands to clients with this flag) SU | string | Comma-separated list of feature FOURCC's. This notifies other clients of extended capabilities of the connecting client. Use with discretion. ___ Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-11-15 16:00:50 UTC (rev 907) +++ dcplusplus/trunk/changelog.txt 2007-11-15 18:25:09 UTC (rev 908) @@ -10,6 +10,8 @@ * Update to ADC 0.14 * Fixed pressing enter in the notepad (poy) * Fixed user commands params (poy) +* Readded list view double buffering (thanks poy) +* Fixed some msvc compile issues (thanks james ross) -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/smartwin/include/smartwin/GCCHeaders.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/GCCHeaders.h 2007-11-15 16:00:50 UTC (rev 907) +++ dcplusplus/trunk/smartwin/include/smartwin/GCCHeaders.h 2007-11-15 18:25:09 UTC (rev 908) @@ -135,6 +135,19 @@ #endif // !_WIN64 #endif // !GetWindowLongPtr + // these should be defined in CommCtrl.h, but the one in MinGW doesn't define them... (2007-11-06) + #if (_WIN32_WINNT >= 0x0501) + #ifndef HDF_SORTUP + #define HDF_SORTUP 0x0400 + #endif + #ifndef HDF_SORTDOWN + #define HDF_SORTDOWN 0x0200 + #endif + #ifndef LVS_EX_DOUBLEBUFFER + #define LVS_EX_DOUBLEBUFFER 0x00010000 + #endif + #endif + #ifdef max #undef max #endif Modified: dcplusplus/trunk/smartwin/include/smartwin/VCDesktopHeaders.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/VCDesktopHeaders.h 2007-11-15 16:00:50 UTC (rev 907) +++ dcplusplus/trunk/smartwin/include/smartwin/VCDesktopHeaders.h 2007-11-15 18:25:09 UTC (rev 908) @@ -31,6 +31,17 @@ #ifndef __GNUC__ #ifndef WINCE + // Need to tell msvc which version of Windows we're targeting! +#ifndef _WIN32_WINNT + #define _WIN32_WINNT 0x0501 +#endif +#ifndef _WIN32_IE + #define _WIN32_IE 0x0501 +#endif +#ifndef WINVER + #define WINVER 0x501 +#endif + static const SmartWin::Platform CurrentPlatform = SmartWin::SmartWinDesktop; #define SMARTWIN_WNDCLASSEX WNDCLASSEX @@ -42,18 +53,11 @@ #include <winuser.h> #include <windowsx.h> #include <Shellapi.h> + #include <shlwapi.h> #include <commctrl.h> + #include <commdlg.h> #include <assert.h> -/* No longer needed because we replaced std:min() with (std:min)() - #ifdef max - #undef max - #endif - - #ifdef min - #undef min - #endif -*/ #pragma comment( lib, "Comdlg32.lib" ) #pragma comment( lib, "comctl32.lib" ) #ifdef DLL Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetListView.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetListView.cpp 2007-11-15 16:00:50 UTC (rev 907) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetListView.cpp 2007-11-15 18:25:09 UTC (rev 908) @@ -61,15 +61,6 @@ updateArrow(); } -// these should be defined in CommCtrl.h, but the one in MinGW doesn't define them... (2007-11-06) -#if (_WIN32_WINNT >= 0x0501) -#ifndef HDF_SORTUP -#define HDF_SORTUP 0x0400 -#endif -#ifndef HDF_SORTDOWN -#define HDF_SORTDOWN 0x0200 -#endif -#endif void WidgetListView::updateArrow() { if(ComCtl6) { int flag = isAscending() ? HDF_SORTUP : HDF_SORTDOWN; Modified: dcplusplus/trunk/win32/WinUtil.cpp =================================================================== --- dcplusplus/trunk/win32/WinUtil.cpp 2007-11-15 16:00:50 UTC (rev 907) +++ dcplusplus/trunk/win32/WinUtil.cpp 2007-11-15 18:25:09 UTC (rev 908) @@ -132,7 +132,7 @@ xlistView.style = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_HSCROLL | WS_VSCROLL | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS; xlistView.exStyle = WS_EX_CLIENTEDGE; - xlistView.lvStyle = LVS_EX_LABELTIP | LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT; + xlistView.lvStyle = LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP | LVS_EX_DOUBLEBUFFER; xlistView.font = font; xtextBox.exStyle = WS_EX_CLIENTEDGE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2007-11-25 18:44:08
|
Revision: 912 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=912&view=rev Author: zouzou123gen Date: 2007-11-25 10:44:05 -0800 (Sun, 25 Nov 2007) Log Message: ----------- key handling in file listings Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/DirectoryListingFrame.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-11-16 23:11:07 UTC (rev 911) +++ dcplusplus/trunk/changelog.txt 2007-11-25 18:44:05 UTC (rev 912) @@ -12,6 +12,7 @@ * Fixed user commands params (poy) * Readded list view double buffering (thanks poy) * Fixed some msvc compile issues (thanks james ross) +* Fixed key handling in file listings (poy) -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/win32/DirectoryListingFrame.cpp =================================================================== --- dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2007-11-16 23:11:07 UTC (rev 911) +++ dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2007-11-25 18:44:05 UTC (rev 912) @@ -963,11 +963,17 @@ bool DirectoryListingFrame::handleKeyDownFiles(int c) { if(c == VK_BACK) { up(); - } else if(c == VK_LEFT && WinUtil::isAlt()) { + return true; + } + if(c == VK_LEFT && WinUtil::isAlt()) { back(); - } else if(c == VK_RIGHT && WinUtil::isAlt()) { + return true; + } + if(c == VK_RIGHT && WinUtil::isAlt()) { forward(); - } else if(c == VK_RETURN) { + return true; + } + if(c == VK_RETURN) { if(files->getSelectedCount() == 1) { ItemInfo* ii = files->getSelectedData(); if(ii->type == ItemInfo::DIRECTORY) { @@ -985,6 +991,7 @@ } else { downloadFiles(SETTING(DOWNLOAD_DIRECTORY)); } + return true; } - return true; + return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-11-26 22:24:37
|
Revision: 913 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=913&view=rev Author: arnetheduck Date: 2007-11-26 14:24:35 -0800 (Mon, 26 Nov 2007) Log Message: ----------- patch Modified Paths: -------------- dcplusplus/trunk/ADC.txt dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/MDIChildFrame.h dcplusplus/trunk/win32/PrivateFrame.cpp Modified: dcplusplus/trunk/ADC.txt =================================================================== --- dcplusplus/trunk/ADC.txt 2007-11-25 18:44:05 UTC (rev 912) +++ dcplusplus/trunk/ADC.txt 2007-11-26 22:24:35 UTC (rev 913) @@ -479,7 +479,7 @@ TO | string | Token, as received in RCM/CTM, when establishing a C-C connection. CT | integer | Client (user) type, 1=bot, 2=registered user, 4=operator, 8=hub owner, 16=hub (used when the hub sends an INF about itself). Multiple types are specified by adding the numbers together. AW | integer | 1=Away, 2=Extended away, not interested in hub chat (hubs may skip sending broadcast type MSG commands to clients with this flag) -SU | string | Comma-separated list of feature FOURCC's. This notifies other clients of extended capabilities of the connecting client. Use with discretion. +SU | string | Comma-separated list of feature FOURCC's. This notifies other clients of extended capabilities of the connecting client. ___ Hubs may mandate or discard any set of fields, but obviously the more the @@ -686,8 +686,8 @@ ``_ Client | Hub ___ -HSUP ADBASE <other-features> | - | ISUP ADBASE <other-features> +HSUP ADBASE ADTIGR ... | + | ISUP ADBASE ADTIGR ... | ISID <client-sid> | IINF HU1 HI1 ... BINF <my-sid> ID... PD... | @@ -704,8 +704,8 @@ ``_ Client | Server ___ -CSUP ADBASE <other-features> | - | CSUP ADBASE <other-features> +CSUP ADBASE ADTIGR ... | + | CSUP ADBASE ADTIGR ... | CINF IDxxx CINF IDxxx TO<token> | | CGET ... Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-11-25 18:44:05 UTC (rev 912) +++ dcplusplus/trunk/changelog.txt 2007-11-26 22:24:35 UTC (rev 913) @@ -13,6 +13,7 @@ * Readded list view double buffering (thanks poy) * Fixed some msvc compile issues (thanks james ross) * Fixed key handling in file listings (poy) +* Message always focused first in chats (poy) -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2007-11-25 18:44:05 UTC (rev 912) +++ dcplusplus/trunk/win32/HubFrame.cpp 2007-11-26 22:24:35 UTC (rev 913) @@ -88,7 +88,7 @@ WidgetTextBox::Seed cs = WinUtil::Seeds::textBox; cs.style = WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_AUTOVSCROLL | ES_MULTILINE; message = createTextBox(cs); - addWidget(message); + addWidget(message, true); message->onKeyDown(std::tr1::bind(&HubFrame::handleMessageKeyDown, this, _1)); message->onChar(std::tr1::bind(&HubFrame::handleMessageChar, this, _1)); } Modified: dcplusplus/trunk/win32/MDIChildFrame.h =================================================================== --- dcplusplus/trunk/win32/MDIChildFrame.h 2007-11-25 18:44:05 UTC (rev 912) +++ dcplusplus/trunk/win32/MDIChildFrame.h 2007-11-26 22:24:35 UTC (rev 913) @@ -39,10 +39,11 @@ typedef WidgetFactory< SmartWin::WidgetChildWindow > BaseType; protected: - MDIChildFrame(SmartWin::WidgetTabView* tabView, const tstring& title, SmartWin::IconPtr icon = SmartWin::IconPtr(), bool activate = true) : - BaseType(tabView->getTab()), - lastFocus(NULL), - reallyClose(false) + MDIChildFrame(SmartWin::WidgetTabView* tabView, const tstring& title, SmartWin::IconPtr icon = SmartWin::IconPtr(), bool activate = true) : + BaseType(tabView->getTab()), + lastFocus(NULL), + alwaysSameFocus(false), + reallyClose(false) { typename ThisType::Seed cs; cs.style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS; @@ -88,12 +89,14 @@ void postClosing() { } template<typename W> - void addWidget(W* widget) { + void addWidget(W* widget, bool alwaysFocus = false) { addColor(widget); - if(lastFocus == NULL) { + if(alwaysFocus || (lastFocus == NULL)) { lastFocus = widget->handle(); ::SetFocus(lastFocus); } + if(alwaysFocus) + alwaysSameFocus = true; } void setDirty(SettingsManager::IntSetting setting) { @@ -115,7 +118,9 @@ } private: - HWND lastFocus; + HWND lastFocus; // last focused widget + bool alwaysSameFocus; // always focus the same widget + bool reallyClose; void addColor(SmartWin::WidgetComboBox* widget) { @@ -145,7 +150,7 @@ if(lastFocus) { ::SetFocus(lastFocus); } - } else { + } else if(!alwaysSameFocus) { HWND focus = ::GetFocus(); if(focus != NULL && ::IsChild(static_cast<T*>(this)->handle(), focus)) lastFocus = focus; Modified: dcplusplus/trunk/win32/PrivateFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PrivateFrame.cpp 2007-11-25 18:44:05 UTC (rev 912) +++ dcplusplus/trunk/win32/PrivateFrame.cpp 2007-11-26 22:24:35 UTC (rev 913) @@ -102,7 +102,7 @@ WidgetTextBox::Seed cs = WinUtil::Seeds::textBox; cs.style = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | ES_AUTOVSCROLL | ES_MULTILINE; message = createTextBox(cs); - addWidget(message); + addWidget(message, true); message->onKeyDown(std::tr1::bind(&PrivateFrame::handleKeyDown, this, _1)); message->onChar(std::tr1::bind(&PrivateFrame::handleChar, this, _1)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-11-29 23:02:49
|
Revision: 914 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=914&view=rev Author: arnetheduck Date: 2007-11-29 15:02:47 -0800 (Thu, 29 Nov 2007) Log Message: ----------- patches Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp dcplusplus/trunk/win32/MDIChildFrame.h dcplusplus/trunk/win32/MainWindow.cpp dcplusplus/trunk/win32/MainWindow.h dcplusplus/trunk/win32/PublicHubsFrame.cpp dcplusplus/trunk/win32/PublicHubsFrame.h dcplusplus/trunk/win32/SearchFrame.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-11-26 22:24:35 UTC (rev 913) +++ dcplusplus/trunk/changelog.txt 2007-11-29 23:02:47 UTC (rev 914) @@ -14,6 +14,8 @@ * Fixed some msvc compile issues (thanks james ross) * Fixed key handling in file listings (poy) * Message always focused first in chats (poy) +* Fixed filter in public hubs (thanks poy) +* Fixed missing title changes on tab change (thanks poy) -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2007-11-26 22:24:35 UTC (rev 913) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2007-11-29 23:02:47 UTC (rev 914) @@ -2,6 +2,7 @@ #define WIDGETTABVIEW_H_ #include "WidgetTabSheet.h" +#include "WidgetWindow.h" #include "../WindowClass.h" #include <list> #include <vector> @@ -30,24 +31,27 @@ /// Fills with default parameters Seed(); }; - - template<typename T> - void add(T* w, const IconPtr& icon) { + + void add(WidgetChildWindow* w, const IconPtr& icon) { addWidget(w, icon, w->getText(), w->getVisible()); w->onTextChanging(std::tr1::bind(&WidgetTabView::handleTextChanging, this, w, _1)); } - void mark(Widget* w); + void mark(WidgetChildWindow* w); - void remove(Widget* w); + void remove(WidgetChildWindow* w); void next(bool reverse = false); - Widget* getActive(); - void setActive(Widget* w) { setActive(findTab(w)); } - - void onTabContextMenu(Widget* w, const std::tr1::function<bool (const ScreenCoordinate& pt)>& f); + WidgetChildWindow* getActive(); + void setActive(WidgetChildWindow* w) { setActive(findTab(w)); } + void onTitleChanged(const std::tr1::function<void (const SmartUtil::tstring&)>& f) { + titleChangedFunction = f; + } + + void onTabContextMenu(WidgetChildWindow* w, const std::tr1::function<bool (const ScreenCoordinate& pt)>& f); + bool filter(const MSG& msg); WidgetTabSheet::ObjectType getTab(); @@ -68,8 +72,8 @@ private: enum { MAX_TITLE_LENGTH = 20 }; struct TabInfo { - TabInfo(Widget* w_) : w(w_) { } - Widget* w; + TabInfo(WidgetChildWindow* w_) : w(w_) { } + WidgetChildWindow* w; std::tr1::function<bool (const ScreenCoordinate& pt)> handleContextMenu; }; @@ -77,24 +81,26 @@ WidgetTabSheet::ObjectType tab; + std::tr1::function<void (const SmartUtil::tstring&)> titleChangedFunction; + bool inTab; - typedef std::list<Widget*> WindowList; + typedef std::list<WidgetChildWindow*> WindowList; typedef WindowList::iterator WindowIter; WindowList viewOrder; Rectangle clientSize; std::vector<IconPtr> icons; int active; - int findTab(Widget* w); + int findTab(WidgetChildWindow* w); void setActive(int i); - TabInfo* getTabInfo(Widget* w); + TabInfo* getTabInfo(WidgetChildWindow* w); TabInfo* getTabInfo(int i); - void setTop(Widget* w); + void setTop(WidgetChildWindow* w); - bool handleTextChanging(Widget* w, const SmartUtil::tstring& newText); + bool handleTextChanging(WidgetChildWindow* w, const SmartUtil::tstring& newText); bool handleSized(const WidgetSizedEventResult&); void handleTabSelected(); bool handleContextMenu(SmartWin::ScreenCoordinate pt); @@ -103,8 +109,8 @@ void layout(); int addIcon(const IconPtr& icon); - void addWidget(Widget* w, const IconPtr& icon, const SmartUtil::tstring& title, bool visible); - void swapWidgets(Widget* oldW, Widget* newW); + void addWidget(WidgetChildWindow* w, const IconPtr& icon, const SmartUtil::tstring& title, bool visible); + void swapWidgets(WidgetChildWindow* oldW, WidgetChildWindow* newW); }; inline WidgetTabSheet::ObjectType WidgetTabView::getTab() Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2007-11-26 22:24:35 UTC (rev 913) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2007-11-29 23:02:47 UTC (rev 914) @@ -33,7 +33,7 @@ tab->onContextMenu(std::tr1::bind(&WidgetTabView::handleContextMenu, this, _1)); } -void WidgetTabView::addWidget(Widget* w, const IconPtr& icon, const SmartUtil::tstring& title, bool visible) { +void WidgetTabView::addWidget(WidgetChildWindow* w, const IconPtr& icon, const SmartUtil::tstring& title, bool visible) { int image = addIcon(icon); size_t tabs = tab->size(); TabInfo* ti = new TabInfo(w); @@ -53,17 +53,17 @@ layout(); } -Widget* WidgetTabView::getActive() { +WidgetChildWindow* WidgetTabView::getActive() { TabInfo* ti = getTabInfo(tab->getSelectedIndex()); return ti ? ti->w : 0; } -void WidgetTabView::remove(Widget* w) { +void WidgetTabView::remove(WidgetChildWindow* w) { if(viewOrder.size() > 1 && viewOrder.back() == w) { setActive(*(--(--viewOrder.end()))); } - Widget* cur = getTabInfo(tab->getSelectedIndex())->w; + WidgetChildWindow* cur = getTabInfo(tab->getSelectedIndex())->w; viewOrder.remove(w); @@ -74,9 +74,13 @@ layout(); } active = findTab(cur); + + // when no tab is opened + if(titleChangedFunction && (active == -1)) + titleChangedFunction(SmartUtil::tstring()); } -void WidgetTabView::onTabContextMenu(Widget* w, const std::tr1::function<bool (const ScreenCoordinate& pt)>& f) { +void WidgetTabView::onTabContextMenu(WidgetChildWindow* w, const std::tr1::function<bool (const ScreenCoordinate& pt)>& f) { TabInfo* ti = getTabInfo(w); if(ti) { ti->handleContextMenu = f; @@ -91,7 +95,7 @@ handleTabSelected(); } -void WidgetTabView::swapWidgets(Widget* oldW, Widget* newW) { +void WidgetTabView::swapWidgets(WidgetChildWindow* oldW, WidgetChildWindow* newW) { sendMessage(WM_SETREDRAW, FALSE); if(oldW) { @@ -126,16 +130,19 @@ setTop(ti->w); active = i; tab->setHighlight(i, false); + + if(titleChangedFunction) + titleChangedFunction(ti->w->getText()); } -void WidgetTabView::mark(Widget* w) { +void WidgetTabView::mark(WidgetChildWindow* w) { int i = findTab(w); if(i != -1 && i != tab->getSelectedIndex()) { tab->setHighlight(i, true); } } -int WidgetTabView::findTab(Widget* w) { +int WidgetTabView::findTab(WidgetChildWindow* w) { for(size_t i = 0; i < tab->size(); ++i) { if(getTabInfo(i)->w == w) { return static_cast<int>(i); @@ -144,7 +151,7 @@ return -1; } -WidgetTabView::TabInfo* WidgetTabView::getTabInfo(Widget* w) { +WidgetTabView::TabInfo* WidgetTabView::getTabInfo(WidgetChildWindow* w) { return getTabInfo(findTab(w)); } @@ -152,11 +159,14 @@ return i == -1 ? 0 : reinterpret_cast<TabInfo*>(tab->getData(i)); } -bool WidgetTabView::handleTextChanging(Widget* w, const SmartUtil::tstring& newText) { +bool WidgetTabView::handleTextChanging(WidgetChildWindow* w, const SmartUtil::tstring& newText) { int i = findTab(w); if(i != -1) { tab->setHeader(i, cutTitle(newText)); layout(); + + if(titleChangedFunction) + titleChangedFunction(newText); } return true; } @@ -195,7 +205,7 @@ if(viewOrder.size() < 2) { return; } - Widget* wnd = getActive(); + WidgetChildWindow* wnd = getActive(); if(!wnd) { return; } @@ -230,7 +240,7 @@ return; } -void WidgetTabView::setTop(Widget* wnd) { +void WidgetTabView::setTop(WidgetChildWindow* wnd) { WindowIter i = std::find(viewOrder.begin(), viewOrder.end(), wnd); if(i != viewOrder.end() && i != --viewOrder.end()) { viewOrder.erase(i); Modified: dcplusplus/trunk/win32/MDIChildFrame.h =================================================================== --- dcplusplus/trunk/win32/MDIChildFrame.h 2007-11-26 22:24:35 UTC (rev 913) +++ dcplusplus/trunk/win32/MDIChildFrame.h 2007-11-29 23:02:47 UTC (rev 914) @@ -66,6 +66,7 @@ onSized(std::tr1::bind(&ThisType::handleSized, this, _1)); onActivate(std::tr1::bind(&ThisType::handleActivate, this, _1)); onCommand(std::tr1::bind(&ThisType::close, this, true), IDC_CLOSE_WINDOW); + addDlgCodeMessage(this); } virtual ~MDIChildFrame() { @@ -90,7 +91,10 @@ template<typename W> void addWidget(W* widget, bool alwaysFocus = false) { + addDlgCodeMessage(widget); + addColor(widget); + if(alwaysFocus || (lastFocus == NULL)) { lastFocus = widget->handle(); ::SetFocus(lastFocus); @@ -122,7 +126,19 @@ bool alwaysSameFocus; // always focus the same widget bool reallyClose; - + + void addDlgCodeMessage(SmartWin::WidgetComboBox* widget) { + widget->onRaw(std::tr1::bind(&ThisType::handleGetDlgCode, this, _1), SmartWin::Message(WM_GETDLGCODE)); + SmartWin::WidgetTextBox* text = widget->getTextBox(); + if(text) + text->onRaw(std::tr1::bind(&ThisType::handleGetDlgCode, this, _1), SmartWin::Message(WM_GETDLGCODE)); + } + + template<typename W> + void addDlgCodeMessage(W* widget) { + widget->onRaw(std::tr1::bind(&ThisType::handleGetDlgCode, this, _1), SmartWin::Message(WM_GETDLGCODE)); + } + void addColor(SmartWin::WidgetComboBox* widget) { widget->onBackgroundColor(std::tr1::bind(&ThisType::handleBackgroundColor, this, _1)); SmartWin::WidgetTextBox* text = widget->getTextBox(); @@ -156,7 +172,13 @@ lastFocus = focus; } } - + + LRESULT handleGetDlgCode(WPARAM wParam) { + if(wParam != VK_TAB) + return DLGC_WANTMESSAGE; + return 0; + } + SmartWin::BrushPtr handleBackgroundColor(SmartWin::Canvas& canvas) { canvas.setBkColor(WinUtil::bgColor); canvas.setTextColor(WinUtil::textColor); Modified: dcplusplus/trunk/win32/MainWindow.cpp =================================================================== --- dcplusplus/trunk/win32/MainWindow.cpp 2007-11-26 22:24:35 UTC (rev 913) +++ dcplusplus/trunk/win32/MainWindow.cpp 2007-11-29 23:02:47 UTC (rev 914) @@ -309,6 +309,7 @@ WidgetTabView::Seed cs; cs.style = WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE; tabs = createTabView(cs); + tabs->onTitleChanged(std::tr1::bind(&MainWindow::handleTabsTitleChanged, this, _1)); paned->setFirst(tabs); } @@ -327,7 +328,7 @@ return true; } - SmartWin::Widget* active = getMDIParent()->getActive(); + SmartWin::WidgetChildWindow* active = getMDIParent()->getActive(); if(active) { if(::IsDialogMessage( active->handle(), & msg )) { return true; @@ -337,6 +338,10 @@ return false; } +void MainWindow::handleTabsTitleChanged(const SmartUtil::tstring& title) { + setText(title.empty() ? _T(APPNAME) _T(" ") _T(VERSIONSTRING) : _T(APPNAME) _T(" ") _T(VERSIONSTRING) _T(" - [") + title + _T("]")); +} + void MainWindow::handleExit() { close(true); } @@ -788,7 +793,7 @@ void MainWindow::handleActivate(bool active) { // Forward to active tab window - Widget* w = tabs->getActive(); + WidgetChildWindow* w = tabs->getActive(); if(w) { w->sendMessage(WM_ACTIVATE, active ? WA_ACTIVE : WA_INACTIVE); } Modified: dcplusplus/trunk/win32/MainWindow.h =================================================================== --- dcplusplus/trunk/win32/MainWindow.h 2007-11-26 22:24:35 UTC (rev 913) +++ dcplusplus/trunk/win32/MainWindow.h 2007-11-29 23:02:47 UTC (rev 914) @@ -169,6 +169,8 @@ LRESULT trayMessage(WPARAM wParam, LPARAM lParam); LRESULT handleCopyData(WPARAM wParam, LPARAM lParam); LRESULT handleWhereAreYou(WPARAM wParam, LPARAM lParam); + + void handleTabsTitleChanged(const SmartUtil::tstring& title); void layout(); bool eachSecond(); Modified: dcplusplus/trunk/win32/PublicHubsFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PublicHubsFrame.cpp 2007-11-26 22:24:35 UTC (rev 913) +++ dcplusplus/trunk/win32/PublicHubsFrame.cpp 2007-11-29 23:02:47 UTC (rev 914) @@ -153,6 +153,7 @@ pubLists->onSelectionChanged(std::tr1::bind(&PublicHubsFrame::handleListSelChanged, this)); filterSel = createComboBox(WinUtil::Seeds::comboBoxStatic); + addWidget(filterSel); //populate the filter list with the column names for(int j=0; j<COLUMN_LAST; j++) { @@ -160,12 +161,14 @@ } filterSel->addValue(CTSTRING(ANY)); filterSel->setSelectedIndex(COLUMN_LAST); + filterSel->onSelectionChanged(std::tr1::bind(&PublicHubsFrame::updateList, this)); } { WidgetTextBox::Seed cs = WinUtil::Seeds::textBox; cs.style = WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL; filter = createTextBox(cs); - filter->onChar(std::tr1::bind(&PublicHubsFrame::handleFilterChar, this, _1)); + addWidget(filter); + filter->onKeyDown(std::tr1::bind(&PublicHubsFrame::handleFilterKeyDown, this, _1)); } initStatus(); @@ -306,7 +309,7 @@ updateStatus(); } -HRESULT PublicHubsFrame::handleSpeaker(WPARAM wParam, LPARAM lParam) { +LRESULT PublicHubsFrame::handleSpeaker(WPARAM wParam, LPARAM lParam) { if((wParam == FINISHED) || (wParam == LOADED_FROM_CACHE)) { std::auto_ptr<tstring> x(reinterpret_cast<tstring*>(lParam)); entries = FavoriteManager::getInstance()->getPublicHubs(); @@ -516,13 +519,12 @@ } void PublicHubsFrame::handleListSelChanged() { - printf("x\n"); FavoriteManager::getInstance()->setHubList(pubLists->getSelectedIndex()); entries = FavoriteManager::getInstance()->getPublicHubs(); updateList(); } -bool PublicHubsFrame::handleFilterChar(int c) { +bool PublicHubsFrame::handleFilterKeyDown(int c) { if(c == VK_RETURN) { filterString = Text::fromT(filter->getText()); updateList(); Modified: dcplusplus/trunk/win32/PublicHubsFrame.h =================================================================== --- dcplusplus/trunk/win32/PublicHubsFrame.h 2007-11-26 22:24:35 UTC (rev 913) +++ dcplusplus/trunk/win32/PublicHubsFrame.h 2007-11-29 23:02:47 UTC (rev 914) @@ -121,7 +121,7 @@ void layout(); bool preClosing(); void postClosing(); - HRESULT handleSpeaker(WPARAM wParam, LPARAM lParam); + LRESULT handleSpeaker(WPARAM wParam, LPARAM lParam); void handleConfigure(); void handleRefresh(); void handleConnect(); @@ -130,7 +130,7 @@ bool handleContextMenu(SmartWin::ScreenCoordinate pt); bool handleKeyDown(int c); void handleListSelChanged(); - bool handleFilterChar(int c); + bool handleFilterKeyDown(int c); bool checkNick(); void updateStatus(); Modified: dcplusplus/trunk/win32/SearchFrame.cpp =================================================================== --- dcplusplus/trunk/win32/SearchFrame.cpp 2007-11-26 22:24:35 UTC (rev 913) +++ dcplusplus/trunk/win32/SearchFrame.cpp 2007-11-29 23:02:47 UTC (rev 914) @@ -71,12 +71,6 @@ (*i)->close(true); } -static HRESULT allKeys(WPARAM wParam, LPARAM) { - if(wParam != VK_TAB) - return DLGC_WANTMESSAGE; - return 0; -} - SearchFrame::SearchFrame(SmartWin::WidgetTabView* mdiParent, const tstring& initialString_, LONGLONG initialSize_, SearchManager::SizeModes initialMode_, SearchManager::TypeModes initialType_) : BaseType(mdiParent, TSTRING(SEARCH), SmartWin::IconPtr(new SmartWin::Icon(IDR_SEARCH))), searchLabel(0), @@ -132,7 +126,6 @@ for(TStringIter i = lastSearches.begin(); i != lastSearches.end(); ++i) { searchBox->insertValue(0, *i); } - searchBox->getTextBox()->onRaw(std::tr1::bind(&allKeys, _1, _2), SmartWin::Message(WM_GETDLGCODE)); searchBox->getTextBox()->onKeyDown(std::tr1::bind(&SearchFrame::handleSearchKeyDown, this, _1)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-11-29 23:07:29
|
Revision: 915 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=915&view=rev Author: arnetheduck Date: 2007-11-29 15:07:27 -0800 (Thu, 29 Nov 2007) Log Message: ----------- Split out some extensions, cologic's editing Modified Paths: -------------- dcplusplus/trunk/ADC.txt Added Paths: ----------- dcplusplus/trunk/ADC-EXT.txt Added: dcplusplus/trunk/ADC-EXT.txt =================================================================== --- dcplusplus/trunk/ADC-EXT.txt (rev 0) +++ dcplusplus/trunk/ADC-EXT.txt 2007-11-29 23:07:27 UTC (rev 915) @@ -0,0 +1,32 @@ += Proposed ADC extensions + +These are extensions which have been proposed but lack implementation, detail +or testing before they can be added to the real ADC spec. + +=== REGX - Regular expressions in searches +This extension adds to the SCH command an additional operator RE that takes a +Perl regular expression (http://perldoc.perl.org/perlre.html) with full +Unicode support. Clients that support this must send "REGX" in their support +string in the INF SU field. + +=== ADCS - Secure ADC <work-in-progress> +==== Introduction +Secure ADC connections can be established using a TLS tunnel, both for hub and +for client connections. Certificates can be used to authenticate both hub and +user, for example by making the hub the root CA, and only allow clients signed +by the hub to connect. Ephemeral keys should be use to ensure forward secrecy +when possible. + +==== Client-Hub encryption +TLS client-hub connections can be initiated either by negotiating the feature +"ADCS" on connection or by using the protocol adcs:// when initiating the +connection. Hubs can choose to request a certificate for the user on login, +and use this certificate to replace password-based login. + +==== Client-Client encryption +TLS client-client connections can be established either by negotiating the +feature "ADCS" on connection or by specifying "ADCS/1.0" in the CTM protocol +field. Clients supporting encrypted connections must indicate this in the INF +SU field with "ADCS" + +// vim: set syntax=asciidoc: Modified: dcplusplus/trunk/ADC.txt =================================================================== --- dcplusplus/trunk/ADC.txt 2007-11-29 23:02:47 UTC (rev 914) +++ dcplusplus/trunk/ADC.txt 2007-11-29 23:07:27 UTC (rev 915) @@ -15,9 +15,9 @@ Advanced Direct Connect is the first neutral thing that springs to mind =). Many ideas for the protocol come from Jan Vidar Krey's DCTNG draft. Other -contributors include Dustin Brody, Walter Doekes, Timmo Stange, Fredrik Ullner -and others. Jon Hess contributed the original Direct Connect idea through the -Neo-Modus Direct Connect client / hub. +contributors include Dustin Brody, Walter Doekes, Timmo Stange, Fredrik +Ullner, Fredrik Stenberg and others. Jon Hess contributed the original Direct +Connect idea through the Neo-Modus Direct Connect client / hub. The latest draft version of this document can be downloaded from $URL$. @@ -27,9 +27,9 @@ === General * All messages begin with a four-letter word. The first letter designates how the message should be sent and the other three specify what to do. -* Parameters are separated by space, and a newline (codepoint 0x0a) ends each +* Parameters are separated by space and a newline (codepoint 0x0a) ends each message. The string "\s" escapes space, "\n" newline and "\\" backslash. - This version of the protocol reserves all other escapes for future use; and + This version of the protocol reserves all other escapes for future use; any message containing unknown escapes must be discarded. * All text must be sent as UTF-8 encoded Unicode in normalization form C. * Clients must ignore unknown/badly formatted messages. Hubs must ignore @@ -39,18 +39,18 @@ IPv4 and RFC 1884 form for IPv6. Hub addresses must be specified in URL form, with "adc" as protocol specifier ("adc://server:port/"). * Numbers are sent as strings in standard floating point notation, using '.' - as the decimal separator and no thousands separator. Integers are numbers + as the decimal separator and without a thousands separator. Integers are numbers with neither a decimal portion nor an exponent. Applications should be prepared to handle at least 64-bit signed integers and 64-bit floating point numbers. A '-' prefix negates. -* SIDs, PIDs, CIDs and short binary data are sent as base32-encoded strings. +* SIDs, PIDs, CIDs, and short binary data are sent as base32-encoded strings. Long binary data transfers should use the file transfer mechanism with named roots. -* Extension names, protocol names and other text not entered by the user may +* Extension names, protocol names, and other text not entered by the user may only include viewable characters that can be encoded by one byte in the UTF-8 encoding (Unicode codepoints 33-127). ADC is case-sensitive, requiring upper case for command names. -* Some of the commands and functionality require the use of a hash function. +* Some commands and functionality require the use of a hash function. The hash function is negotiated during session setup and stays the same for the duration of the session. @@ -85,11 +85,11 @@ .................. === Message types -Message type specifies how messages should be routed, and thus which -additional fields can be found in the message header. Clients should use the -most limiting type, in terms of recipients, that makes sense for a particular -message when sending it to the hub for distribution. Clients should disregard -the message type when interpreting the message (after having parsed it). The +Message type specifies how messages should be routed and thus which additional +fields can be found in the message header. Clients should use the most +limiting type, in terms of recipients, that makes sense for a particular +message when sending it to the hub for distribution. Clients should use the +message type only to aid in parsing the message and otherwise ignore it. The following message types are defined: [separator="|"] @@ -106,9 +106,9 @@ === Session hash Certain commands require the use of a hash function. The hash function used is -negotiated each time a new connection is established using the SUP mechanism. +negotiated using the SUP mechanism each time a new connection is established. When a client first connects, it offers a set of hash functions as SUP -features. The server picks one of the offered functions and communicates the +features. The server picks one of the offered functions and communicates its choice to the client by placing it before any other hash features present in the first SUP from the server. Clients and hubs are required to support at least one hash function, used both for protocol purposes and file @@ -116,7 +116,7 @@ === Client identification Each client is identified by three different IDs, Session ID (SID), Private ID -(PID) and Client ID (CID). +(PID), and Client ID (CID). ==== Session ID Session IDs appear in all communication that interacts with the hub. They @@ -126,7 +126,7 @@ ==== Private ID Private IDs globally identify a unique client. They function during initial -protocol negotiation to generate the CID, and are invisible to other clients. +protocol negotiation to generate the CID and are invisible to other clients. PIDs should be generated in a way to avoid collisions, for example using the hash of the current time and primary network card MAC address if sufficient randomness cannot be generated. Hubs and clients may not disclose PIDs to @@ -144,18 +144,18 @@ == Files === File names and structure Filenames are relative to a fictive root in the user's share. "/" separates -directories, and each file or directory name must be unique in a -case-insensitive context. All printable characters, including whitespace, are -valid names for files, the "/" and "\" being escaped by "\". Clients must then -properly filter the filename for the target file system, as well as request -filenames from other clients according to these rules. The special names "." -and ".." may not occur as a directory or filename; any file list received -containing those must be ignored. All directory names must end with a "/". +directories; each file or directory name must be unique in a case-insensitive +context. All printable characters, including whitespace, are valid names for +files, the "/" and "\" being escaped by "\". Clients must then properly filter +the filename for the target file system, as well as request filenames from +other clients according to these rules. The special names "." and ".." may not +occur as a directory or filename; any file list received containing those must +be ignored. All directory names must end with a "/". Shared files are identified relative to the unnamed root "/" ("/dir/subdir/filename.ext"), while extensions can add named roots to this namespace. For example, "TTH/..." from the TIGR extension uses the named root -"TTH" to identify files by their tiger tree hash. It is invalid for names +"TTH" to identify files by their Tiger tree hash. It is invalid for names from the unnamed root to appear in the share without also being identified by at least one hash value. @@ -322,7 +322,7 @@ During login, the client goes through a number of stages. An action is valid only in the NORMAL stage unless otherwise noted. The stages, in login order, are PROTOCOL (feature support discovery), IDENTIFY (user identification, -static checks), VERIFY (password check), NORMAL (normal operation) and DATA +static checks), VERIFY (password check), NORMAL (normal operation), and DATA (for binary transfers). === Client – Client communication @@ -340,7 +340,7 @@ States: All -Status code in the form "xyy" where x specifies severity, and yy the specific +Status code in the form "xyy" where x specifies severity and yy the specific error code. The severity and error code are treated separately, the same error could occur at different severity levels. @@ -348,7 +348,7 @@ [separator="|"] ``_ -0 | Success (used for confirming commands), error code must be "00" and an additional flag "FC" contains the FOURCC of the command being confirmed if applicable. +0 | Success (used for confirming commands), error code must be "00", and an additional flag "FC" contains the FOURCC of the command being confirmed if applicable. 1 | Recoverable (error but no disconnect) 2 | Fatal (disconnect) ___ @@ -380,10 +380,12 @@ 44 | Invalid state, flag "FC" the FOURCC of the offending command. 45 | Required feature missing, flag "FC" specifies the FOURCC of the missing feature. 46 | Invalid IP supplied in INF, flag "I4" or "I6" specifies the correct IP. +47 | No hash support overlap in SUP between client and hub. 50 | Client-client / file transfer error 51 | File not available 52 | File part not available 53 | Slots full +54 | No hash support overlap in SUP between clients. ___ Description: @@ -410,11 +412,11 @@ indicates support for regardless of its own SUP, and vice versa. This command can also be used to dynamically add / remove features, 'AD' -meaning add and 'RM' remove. +meaning add and 'RM' meaning remove. When the server receives this message the first time, it should reply in kind, -assign an SID to the client, send an INF about itself and move to the IDENTIFY -state. +assign an SID to the client, send an INF about itself, and move to the +IDENTIFY state. ==== SID SID sid @@ -437,7 +439,7 @@ This command updates the information about a client. Each time this is received, it means that the fields specified have been added or updated. Each field is identified by two characters, directly followed by the data -associated with that field. A field (and the effects of its presence) can be +associated with that field. A field, and the effects of its presence, can be canceled by sending the field name without data. Clients must ignore fields they don't recognize. Most of these fields are only interesting in the client-hub communication; during client-client this command is mainly used for @@ -458,7 +460,7 @@ ___ ID | base32 | The CID of the client. Mandatory for C-C connections. PD | base32 | The PID of the client. Hubs must check that the hash(PID) == CID and then discard the field before broadcasting it to other clients. Must not be sent in C-C connections. -I4 | IPv4 | IPv4 address without port. A zero address (0.0.0.0) means that the server should replace it with the real IP of the client. Hubs must check that a specified address corresponds to what the client is connecting from to avoid DoS attacks, and only allow trusted clients to specify a different address. Clients should use the zero address when connecting, but may opt not to do so at the user's discretion. Any client that supports incoming TCPv4 connections must also add the feature TCP4 to their SU field. +I4 | IPv4 | IPv4 address without port. A zero address (0.0.0.0) means that the server should replace it with the real IP of the client. Hubs must check that a specified address corresponds to what the client is connecting from to avoid DoS attacks and only allow trusted clients to specify a different address. Clients should use the zero address when connecting, but may opt not to do so at the user's discretion. Any client that supports incoming TCPv4 connections must also add the feature TCP4 to their SU field. I6 | IPv6 | IPv6 address without port. A zero address (::) means that the server should replace it with the IP of the client. Any client that supports incoming TCPv6 connections must also add the feature TCP6 to their SU field. U4 | integer | Client UDP port. Any client that supports incoming UDPv4 packets must also add the feature UDP4 to their SU field. U6 | integer | Same as U4, but for IPv6. Any client that supports incoming UDPv6 packets must also add the feature UDP6 to their SU field. @@ -486,17 +488,16 @@ merrier (and clients could be disconnected for not sending some of them). Note; normally one would only accept an IP (I4 or I6) that is the same as the -source IP of the connecting peer, allowing otherwise for trusted users only -because your could channel DDoS attacks. Use caution when accepting unknown -IPs. Only for trusted users one may allow a different IP or an IP from a -different domain (Ipv4 or Ipv6) to be specified. If you fail to do this, your -hub can be used as a medium for DDoS attacks. +source IP of the connecting peer. Use caution when accepting unknown IPs. Only +for trusted users one may allow a different IP or an IP from a different +domain (IPv4 or IPv6) to be specified. If you fail to do this, your hub can be +used as a medium for DDoS attacks. When a hub receives this message in the IDENTIFY state, it should proceed to the VERIFY state by sending a PAS request or NORMAL state by starting sending the INF of all clients, where the INF of the connecting client must come last. -When the hub that sends an INF about itself, the NI becomes hub name, VE -version etc. +When the hub that sends an INF about itself, the NI becomes hub name, the VE +the hub version, and DE the hub description. When the server receives this during client-client communication in IDENTIFY state, it should verify the ID and TO fields, send an INF about itself and @@ -539,8 +540,8 @@ TY | File type, to be chosen from the following (none specified = any type): 1 = File, 2 = Directory ___ -Searching by UDP is subject to IP spoofing, and can thus be used to initiate a -DoS attack. Clients should only accept incoming UDP searches in a trusted +Searching by UDP is subject to IP spoofing; can thus be used to initiate a DoS +attack. Clients should only accept incoming UDP searches in a trusted environment. ==== RES @@ -568,11 +569,11 @@ Connect to me. Used by active clients that want to connect to someone, or in response to RCM. Only TCP active clients may send this. <token> is a string -that identifies the incoming connection triggered by this command, and must be +that identifies the incoming connection triggered by this command and must be present in the INF command of the connecting client. Clients should not accept incoming connections with a token they did not send earlier. <protocol> is an arbitrary string specifying the protocol to connect with; in the case of an -ADC compliant connection attempt, this should be the string "ADC/1.0". If +ADC 1.0 compliant connection attempt, this should be the string "ADC/1.0". If <protocol> is supported, a response to RCM must copy the <token> and <protocol> fields directly. If a protocol is not supported, a DSTA must be sent indicating this. @@ -674,9 +675,9 @@ Contexts: C Transitions to DATA state. The sender will transmit until <bytes> bytes of -binary data have been sent, and then will transition back to NORMAL state. The -parameters essentially correspond to the GET parameters, but if <bytes> equals --1 it must be replaced by the number of bytes needed to complete the file +binary data have been sent and then will transition back to NORMAL state. The +parameters correspond to the GET parameters except that if <bytes> equals -1 +it must be replaced by the number of bytes needed to complete the file starting at <start_pos>. == Examples @@ -715,19 +716,23 @@ == Standard Extensions +Apart from supporting BASE, clients may opt to implement one or more of the +following standard extensions. To be considered for addition, an extension must +be well documented and must be implemented and tested in the real world. + === TIGR - Tiger tree hash support ==== General -This extension adds tiger tree hash support to the base protocol. It is -intended to be used both for identifying files and for protocol purposes such -as CID generation and password negotiation +This extension adds Tiger tree hash support to the base protocol. It is +intended to be used both for identifying files and for purposes such as CID +generation and password negotiation ==== TIGR for shared files All files shared by TIGR supporting clients must have been hashed using Merkle Hash trees, as defined by http://www.open-content.net/specs/draft-jchapweske-thex-02.html. The Tiger -algorithm, as specified by http://www.cs.technion.ac.il/~biham/Reports/Tiger/ +algorithm, as specified by http://www.cs.technion.ac.il/~biham/Reports/Tiger/, functions as the hash algorithm. A base segment size of 1024 bytes must be used when generating the tree, but clients may then discard parts of the tree as long as at least 7 levels are kept or a block granularity of 64 KiB is @@ -735,23 +740,23 @@ Generally, the root of the tree (TTH) serves to identify a file uniquely. Searches use it and it must be present in the file list. Further, the root of -the file list must also be available, and discoverable via GFI. A client may +the file list must also be available and discoverable via GFI. A client may also request the rest of the tree using the normal client-client transfer procedure. The root must be encoded using base32 encoding when converted to text. In the file list, each File element carries an additional attribute "TTH" -containing the base32-encoded value of the tiger tree root. +containing the base32-encoded value of the Tiger tree root. In the GET/GFI type, the full tree may be accessed using the "tthl" type. "tthl" transfers send the largest set of leaves available) as a binary stream of leaf data, right-to-left, with no spacing in between them. <start_pos> must be set to 0 and <bytes> to -1 when requesting the data. <bytes> must -contain the total binary size of the leaf stream in SND, and by dividing this +contain the total binary size of the leaf stream in SND; by dividing this length by the individual hash length, the number of leaves, and thus the leaf -level can be deducted. The received leaves can then be used to reconstruct the -entire tree, and the resulting root must match the root of the file (this +level, can be deducted. The received leaves can then be used to reconstruct +the entire tree, and the resulting root must match the root of the file (this verifies the integrity of the tree itself). Identifier must be a TTH root value from the "TTH/" root. @@ -762,7 +767,7 @@ [separator="|"] ``_ -TR | Tiger tree hash root, encoded with base32. +TR | Tiger tree Hash root, encoded with base32. TD | Tree depth, index of the highest level of tree data available, root-only = 0, first level (2 leaves) = 1, second level = 2, etc... ___ @@ -770,12 +775,6 @@ This extension adds a special file "files.xml.bz2" in the unnamed root of the share which contains "files.xml" compressed with bzip2 1.0.3+ (www.bzip.org). -=== REGX - Regular expressions in searches -This extension adds to the SCH command an additional operator RE that takes a -Perl regular expression (http://perldoc.perl.org/perlre.html) with full -Unicode support. Clients that support this must send "REGX" in their support -string in the INF SU field. - === ZLIB - Compressed communication There are two variants of zlib support, FULL and GET, and only one should be used on a each communications channel set up. @@ -801,11 +800,11 @@ === UCMD - User commands User commands are used to send hub-specific commands to the client which provide useful shortcuts for the user. These commands contain strings which -must be sent back to the hub, and parameter substitutions in the strings. Each +must be sent back to the hub and parameter substitutions in the strings. Each user command has a display name, a string to be sent to the hub, and one or more categories where it may appear. The strings passed to the hub must first be passed through a dictionary replacement that replaces all keywords in the -string, and then through the equivalent of the C standard function "strftime", +string and then through the equivalent of the C standard function "strftime", with the current time. ==== CMD @@ -826,7 +825,7 @@ | 2 = User list command, client and user parameters | 4 = Search result command, client, user and file parameters | 8 = File list command, client, user and file parameters -TT | The full text to be sent to hub, including fourcc and any parameters +TT | The full text to be sent to hub, including FOURCC and any parameters CO | 1 = Constrained, when sending this command on multiple users (for example in search results), constrain it to once per CID only SP | 1 = Insert separator instead of command name (name must still be present to uniquely identify the command) ___ @@ -843,7 +842,7 @@ ``_ myCID | Client CID mySID | Client SID -myXX | One for each flag on that particular hub, for example myI4, myNI, etc. +myXX | One for each flag on that particular hub; for example, myI4 and myNI ___ User parameters @@ -852,7 +851,7 @@ ``_ userCID | User CID userSID | SID of the user -userXX | One for each flag the user sent, for example userI4, userNI, etc. +userXX | One for each flag the user sent; for example, userI4 and userNI ___ File parameters @@ -869,24 +868,4 @@ hubXX | One for each flag of the hub ___ -=== ADCS - Secure ADC <work-in-progress> -==== Introduction -Secure ADC connections can be established using a TLS tunnel, both for hub and -for client connections. Certificates can be used to authenticate both hub and -user, for example by making the hub the root CA, and only allow clients signed -by the hub to connect. Ephemeral keys should be use to ensure forward secrecy -when possible. - -==== Client-Hub encryption -TLS client-hub connections can be initiated either by negotiating the feature -"ADCS" on connection or by using the protocol adcs:// when initiating the -connection. Hubs can choose to request a certificate for the user on login, -and use this certificate to replace password-based login. - -==== Client-Client encryption -TLS client-client connections can be established either by negotiating the -feature "ADCS" on connection or by specifying "ADCS/1.0" in the CTM protocol -field. Clients supporting encrypted connections must indicate this in the INF -SU field with "ADCS" - // vim: set syntax=asciidoc: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2007-11-30 18:57:51
|
Revision: 917 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=917&view=rev Author: zouzou123gen Date: 2007-11-30 10:57:40 -0800 (Fri, 30 Nov 2007) Log Message: ----------- user list filter: no multiline & combobox items visible Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/PublicHubsFrame.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-11-30 18:30:26 UTC (rev 916) +++ dcplusplus/trunk/changelog.txt 2007-11-30 18:57:40 UTC (rev 917) @@ -16,6 +16,7 @@ * Message always focused first in chats (poy) * Fixed filter in public hubs (thanks poy) * Fixed missing title changes on tab change (thanks poy) +* Fixed user list filter (poy) -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2007-11-30 18:30:26 UTC (rev 916) +++ dcplusplus/trunk/win32/HubFrame.cpp 2007-11-30 18:57:40 UTC (rev 917) @@ -105,7 +105,7 @@ { WidgetTextBox::Seed cs = WinUtil::Seeds::textBox; - cs.style = WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE; + cs.style = WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL; filter = createTextBox(cs); addWidget(filter); filter->onKeyUp(std::tr1::bind(&HubFrame::handleFilterKey, this, _1)); @@ -118,7 +118,7 @@ for(int j=0; j<COLUMN_LAST; j++) { filterType->addValue(TSTRING_I(columnNames[j])); } - filterType->addValue(CTSTRING(ANY)); + filterType->addValue(TSTRING(ANY)); filterType->setSelectedIndex(COLUMN_LAST); filterType->onSelectionChanged(std::tr1::bind(&HubFrame::updateUserList, this, (UserInfo*)0)); } @@ -206,6 +206,8 @@ int xfilter = showUsers->getChecked() ? std::min(r.size.x / 4, 200l) : 0; SmartWin::Rectangle rm(0, r.size.y - ymessage, r.size.x - xfilter, ymessage); message->setBounds(rm); + + r.size.y -= rm.size.y + border; rm.pos.x += rm.size.x + border; rm.size.x = showUsers->getChecked() ? xfilter * 2 / 3 - border : 0; @@ -213,9 +215,8 @@ rm.pos.x += rm.size.x + border; rm.size.x = showUsers->getChecked() ? xfilter / 3 - border : 0; + rm.size.y += 140; filterType->setBounds(rm); - - r.size.y -= rm.size.y + border; bool checked = showUsers->getChecked(); if(checked && !paned->getSecond()) { Modified: dcplusplus/trunk/win32/PublicHubsFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PublicHubsFrame.cpp 2007-11-30 18:30:26 UTC (rev 916) +++ dcplusplus/trunk/win32/PublicHubsFrame.cpp 2007-11-30 18:57:40 UTC (rev 917) @@ -157,9 +157,9 @@ //populate the filter list with the column names for(int j=0; j<COLUMN_LAST; j++) { - filterSel->addValue(CTSTRING_I(columnNames[j])); + filterSel->addValue(TSTRING_I(columnNames[j])); } - filterSel->addValue(CTSTRING(ANY)); + filterSel->addValue(TSTRING(ANY)); filterSel->setSelectedIndex(COLUMN_LAST); filterSel->onSelectionChanged(std::tr1::bind(&PublicHubsFrame::updateList, this)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2007-11-30 20:08:13
|
Revision: 918 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=918&view=rev Author: zouzou123gen Date: 2007-11-30 12:08:08 -0800 (Fri, 30 Nov 2007) Log Message: ----------- chat message box auto-scroll Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/PrivateFrame.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-11-30 18:57:40 UTC (rev 917) +++ dcplusplus/trunk/changelog.txt 2007-11-30 20:08:08 UTC (rev 918) @@ -17,6 +17,7 @@ * Fixed filter in public hubs (thanks poy) * Fixed missing title changes on tab change (thanks poy) * Fixed user list filter (poy) +* Readded chat message box auto-scroll (poy) -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2007-11-30 18:57:40 UTC (rev 917) +++ dcplusplus/trunk/win32/HubFrame.cpp 2007-11-30 20:08:08 UTC (rev 918) @@ -86,7 +86,7 @@ { WidgetTextBox::Seed cs = WinUtil::Seeds::textBox; - cs.style = WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_AUTOVSCROLL | ES_MULTILINE; + cs.style = WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE; message = createTextBox(cs); addWidget(message, true); message->onKeyDown(std::tr1::bind(&HubFrame::handleMessageKeyDown, this, _1)); Modified: dcplusplus/trunk/win32/PrivateFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PrivateFrame.cpp 2007-11-30 18:57:40 UTC (rev 917) +++ dcplusplus/trunk/win32/PrivateFrame.cpp 2007-11-30 20:08:08 UTC (rev 918) @@ -100,7 +100,7 @@ { { WidgetTextBox::Seed cs = WinUtil::Seeds::textBox; - cs.style = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | ES_AUTOVSCROLL | ES_MULTILINE; + cs.style = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE; message = createTextBox(cs); addWidget(message, true); message->onKeyDown(std::tr1::bind(&PrivateFrame::handleKeyDown, this, _1)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-01 12:14:32
|
Revision: 919 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=919&view=rev Author: arnetheduck Date: 2007-12-01 04:14:25 -0800 (Sat, 01 Dec 2007) Log Message: ----------- ADC 1.0 preparation Modified Paths: -------------- dcplusplus/trunk/ADC-EXT.txt dcplusplus/trunk/ADC.txt Modified: dcplusplus/trunk/ADC-EXT.txt =================================================================== --- dcplusplus/trunk/ADC-EXT.txt 2007-11-30 20:08:08 UTC (rev 918) +++ dcplusplus/trunk/ADC-EXT.txt 2007-12-01 12:14:25 UTC (rev 919) @@ -29,4 +29,75 @@ field. Clients supporting encrypted connections must indicate this in the INF SU field with "ADCS" +=== UCMD - User commands +User commands are used to send hub-specific commands to the client which +provide useful shortcuts for the user. These commands contain strings which +must be sent back to the hub and parameter substitutions in the strings. Each +user command has a display name, a string to be sent to the hub, and one or +more categories where it may appear. The strings passed to the hub must first +be passed through a dictionary replacement that replaces all keywords in the +string and then through the equivalent of the C standard function "strftime", +with the current time. + +==== CMD + CMD name + +Context: F + +Name uniquely (per hub) identifies a particular user command. The name may +contain "/" to indicate a logical structure on the viewing client, where each +"/" introduces a new submenu level. Other than name, the command also has a +number of flags that further detail what to do with it. + +[separator="|"] +``_ +RM | 1 = Remove command +CT | Context, the following flags summed: + | 1 = Hub command, client parameters only + | 2 = User list command, client and user parameters + | 4 = Search result command, client, user and file parameters + | 8 = File list command, client, user and file parameters +TT | The full text to be sent to hub, including FOURCC and any parameters +CO | 1 = Constrained, when sending this command on multiple users (for example in search results), constrain it to once per CID only +SP | 1 = Insert separator instead of command name (name must still be present to uniquely identify the command) +___ + +Keywords are specified using "%[keyword]". Unknown keywords must be replaced +by the empty string. Additionally, all %-substitutions of the C function +"strftime" must be supported. + +The following tables specify the parameters that must be available. + +Client parameters + +[separator="|"] +``_ +myCID | Client CID +mySID | Client SID +myXX | One for each flag on that particular hub; for example, myI4 and myNI +___ + +User parameters + +[separator="|"] +``_ +userCID | User CID +userSID | SID of the user +userXX | One for each flag the user sent; for example, userI4 and userNI +___ + +File parameters + +[separator="|"] +``_ +fileXX | One for each flag contained within a search result or file list entry (see RES) +___ + +Hub parameters + +[separator="|"] +``_ +hubXX | One for each flag of the hub +___ + // vim: set syntax=asciidoc: Modified: dcplusplus/trunk/ADC.txt =================================================================== --- dcplusplus/trunk/ADC.txt 2007-11-30 20:08:08 UTC (rev 918) +++ dcplusplus/trunk/ADC.txt 2007-12-01 12:14:25 UTC (rev 919) @@ -1,12 +1,12 @@ = ADC Protocol Draft Jacek Sieka <arn...@gm...> -0.14, November 2007 +1.0, December 2007 == Abstract ADC is a text protocol for a client-server network similar to Neo-Modus' Direct Connect (NMDC). The goal is to create a simple protocol that doesn't require much effort neither in hub nor client, and is yet extensible. It -addresses some of the issues in the NMDC protocol, but definitely not all. +addresses some of the issues in the NMDC protocol, but not all. The same protocol structure is used both for client-hub and client-client communication. This document is split into two parts; the first shows the @@ -14,7 +14,7 @@ this structure. ADC stands for anything you would like it to stand for; Advanced Direct Connect is the first neutral thing that springs to mind =). -Many ideas for the protocol come from Jan Vidar Krey's DCTNG draft. Other +Many ideas for the protocol come from Jan Vidar Krey's DCTNG draft. Major contributors include Dustin Brody, Walter Doekes, Timmo Stange, Fredrik Ullner, Fredrik Stenberg and others. Jon Hess contributed the original Direct Connect idea through the Neo-Modus Direct Connect client / hub. @@ -414,10 +414,14 @@ This command can also be used to dynamically add / remove features, 'AD' meaning add and 'RM' meaning remove. -When the server receives this message the first time, it should reply in kind, -assign an SID to the client, send an INF about itself, and move to the -IDENTIFY state. +When the hub receives this message in PROTOCOL state, it should reply in kind, +assign and SID to the client, optionally send an INF about itself, and move to +the IDENTIFY state. +When the server receives this message in a client-client connection in the +PROTOCOL state, it should reply in kind, send an INF about itself, and move to +the IDENTIFY state. + ==== SID SID sid @@ -493,11 +497,12 @@ domain (IPv4 or IPv6) to be specified. If you fail to do this, your hub can be used as a medium for DDoS attacks. -When a hub receives this message in the IDENTIFY state, it should proceed to -the VERIFY state by sending a PAS request or NORMAL state by starting sending -the INF of all clients, where the INF of the connecting client must come last. -When the hub that sends an INF about itself, the NI becomes hub name, the VE -the hub version, and DE the hub description. +When a hub receives this message in the IDENTIFY state, it should verify the +PD and ID fields, and proceed to the VERIFY state by sending a PAS request or +NORMAL state by sending its own INF (unless it already did so previously), +then the INF of all connected clients in NORMAL state, and last the INF of the +connecting client. When the hub that sends an INF about itself, the NI becomes +hub name, the VE the hub version, and DE the hub description. When the server receives this during client-client communication in IDENTIFY state, it should verify the ID and TO fields, send an INF about itself and @@ -797,75 +802,4 @@ parameter of the GET and SND commands is to be interpreted as the number of uncompressed bytes to be transferred. -=== UCMD - User commands -User commands are used to send hub-specific commands to the client which -provide useful shortcuts for the user. These commands contain strings which -must be sent back to the hub and parameter substitutions in the strings. Each -user command has a display name, a string to be sent to the hub, and one or -more categories where it may appear. The strings passed to the hub must first -be passed through a dictionary replacement that replaces all keywords in the -string and then through the equivalent of the C standard function "strftime", -with the current time. - -==== CMD - CMD name - -Context: F - -Name uniquely (per hub) identifies a particular user command. The name may -contain "/" to indicate a logical structure on the viewing client, where each -"/" introduces a new submenu level. Other than name, the command also has a -number of flags that further detail what to do with it. - -[separator="|"] -``_ -RM | 1 = Remove command -CT | Context, the following flags summed: - | 1 = Hub command, client parameters only - | 2 = User list command, client and user parameters - | 4 = Search result command, client, user and file parameters - | 8 = File list command, client, user and file parameters -TT | The full text to be sent to hub, including FOURCC and any parameters -CO | 1 = Constrained, when sending this command on multiple users (for example in search results), constrain it to once per CID only -SP | 1 = Insert separator instead of command name (name must still be present to uniquely identify the command) -___ - -Keywords are specified using "%[keyword]". Unknown keywords must be replaced -by the empty string. Additionally, all %-substitutions of the C function -"strftime" must be supported. - -The following tables specify the parameters that must be available. - -Client parameters - -[separator="|"] -``_ -myCID | Client CID -mySID | Client SID -myXX | One for each flag on that particular hub; for example, myI4 and myNI -___ - -User parameters - -[separator="|"] -``_ -userCID | User CID -userSID | SID of the user -userXX | One for each flag the user sent; for example, userI4 and userNI -___ - -File parameters - -[separator="|"] -``_ -fileXX | One for each flag contained within a search result or file list entry (see RES) -___ - -Hub parameters - -[separator="|"] -``_ -hubXX | One for each flag of the hub -___ - // vim: set syntax=asciidoc: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2007-12-01 23:34:05
|
Revision: 925 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=925&view=rev Author: zouzou123gen Date: 2007-12-01 15:34:02 -0800 (Sat, 01 Dec 2007) Log Message: ----------- tab order & missing addWidget in PublicHubsFrame Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/PublicHubsFrame.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-01 23:05:03 UTC (rev 924) +++ dcplusplus/trunk/changelog.txt 2007-12-01 23:34:02 UTC (rev 925) @@ -18,6 +18,7 @@ * Fixed missing title changes on tab change (thanks poy) * Fixed user list filter (poy) * Readded chat message box auto-scroll (poy) +* Fixed tab order in public hubs (poy) -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/win32/PublicHubsFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PublicHubsFrame.cpp 2007-12-01 23:05:03 UTC (rev 924) +++ dcplusplus/trunk/win32/PublicHubsFrame.cpp 2007-12-01 23:34:02 UTC (rev 925) @@ -120,8 +120,33 @@ hubs->onKeyDown(std::tr1::bind(&PublicHubsFrame::handleKeyDown, this, _1)); hubs->onContextMenu(std::tr1::bind(&PublicHubsFrame::handleContextMenu, this, _1)); } - + { + WidgetTextBox::Seed cs = WinUtil::Seeds::textBox; + cs.style = WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL; + filter = createTextBox(cs); + addWidget(filter); + filter->onKeyDown(std::tr1::bind(&PublicHubsFrame::handleFilterKeyDown, this, _1)); + } + + { + filterSel = createComboBox(WinUtil::Seeds::comboBoxStatic); + addWidget(filterSel); + + //populate the filter list with the column names + for(int j=0; j<COLUMN_LAST; j++) { + filterSel->addValue(TSTRING_I(columnNames[j])); + } + filterSel->addValue(TSTRING(ANY)); + filterSel->setSelectedIndex(COLUMN_LAST); + filterSel->onSelectionChanged(std::tr1::bind(&PublicHubsFrame::updateList, this)); + + pubLists = createComboBox(WinUtil::Seeds::comboBoxStatic); + addWidget(pubLists); + pubLists->onSelectionChanged(std::tr1::bind(&PublicHubsFrame::handleListSelChanged, this)); + } + + { WidgetButton::Seed cs = WinUtil::Seeds::button; cs.caption = TSTRING(CONFIGURE); @@ -145,32 +170,8 @@ cs.caption = TSTRING(FILTER); filterDesc = createButton(cs); filterDesc->setFont(WinUtil::font); - } - { - pubLists = createComboBox(WinUtil::Seeds::comboBoxStatic); - pubLists->onSelectionChanged(std::tr1::bind(&PublicHubsFrame::handleListSelChanged, this)); - - filterSel = createComboBox(WinUtil::Seeds::comboBoxStatic); - addWidget(filterSel); - - //populate the filter list with the column names - for(int j=0; j<COLUMN_LAST; j++) { - filterSel->addValue(TSTRING_I(columnNames[j])); - } - filterSel->addValue(TSTRING(ANY)); - filterSel->setSelectedIndex(COLUMN_LAST); - filterSel->onSelectionChanged(std::tr1::bind(&PublicHubsFrame::updateList, this)); - } - { - WidgetTextBox::Seed cs = WinUtil::Seeds::textBox; - cs.style = WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL; - filter = createTextBox(cs); - addWidget(filter); - filter->onKeyDown(std::tr1::bind(&PublicHubsFrame::handleFilterKeyDown, this, _1)); - } - initStatus(); FavoriteManager::getInstance()->addListener(this); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-03 22:25:42
|
Revision: 926 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=926&view=rev Author: arnetheduck Date: 2007-12-03 14:25:40 -0800 (Mon, 03 Dec 2007) Log Message: ----------- patches, begin upgrade to adc 1.0 (protocol string, features, error handling etc) Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/AdcCommand.h dcplusplus/trunk/dcpp/AdcHub.cpp dcplusplus/trunk/dcpp/AdcHub.h dcplusplus/trunk/dcpp/BufferedSocket.cpp dcplusplus/trunk/dcpp/ClientManager.cpp dcplusplus/trunk/dcpp/FavoriteManager.cpp dcplusplus/trunk/dcpp/FavoriteManager.h dcplusplus/trunk/dcpp/SearchManager.cpp dcplusplus/trunk/dcpp/User.h dcplusplus/trunk/dcpp/UserCommand.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetToolbar.h dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp dcplusplus/trunk/smartwin/source/widgets/WidgetToolbar.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/changelog.txt 2007-12-03 22:25:40 UTC (rev 926) @@ -7,7 +7,7 @@ * Fixed version info (poy) * Keep selection visible on move up/down in some list views (poy) * Fixed clicking in the header of the favorite hubs list view (poy) -* Update to ADC 0.14 +* Update to ADC 1.0 * Fixed pressing enter in the notepad (poy) * Fixed user commands params (poy) * Readded list view double buffering (thanks poy) @@ -19,6 +19,10 @@ * Fixed user list filter (poy) * Readded chat message box auto-scroll (poy) * Fixed tab order in public hubs (poy) +* Tooltips for toolbars (thanks poy) +* Close tab with middle mouse button (thanks poy) +* Fixed socket ip bind (thanks garg's quasi-friend) +* Finished UCMD extension draft implementation -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/dcpp/AdcCommand.h =================================================================== --- dcplusplus/trunk/dcpp/AdcCommand.h 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/dcpp/AdcCommand.h 2007-12-03 22:25:40 UTC (rev 926) @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if !defined(ADC_COMMAND_H) -#define ADC_COMMAND_H +#ifndef DCPLUSPLUS_DCPP_ADC_COMMAND_H +#define DCPLUSPLUS_DCPP_ADC_COMMAND_H #include "SettingsManager.h" #include "Exception.h" @@ -58,10 +58,12 @@ ERROR_BAD_STATE = 44, ERROR_FEATURE_MISSING = 45, ERROR_BAD_IP = 46, + ERROR_NO_HUB_HASH = 47, ERROR_TRANSFER_GENERIC = 50, ERROR_FILE_NOT_AVAILABLE = 51, ERROR_FILE_PART_NOT_AVAILABLE = 52, - ERROR_SLOTS_FULL = 53 + ERROR_SLOTS_FULL = 53, + ERROR_NO_CLIENT_HASH = 54 }; enum Severity { Modified: dcplusplus/trunk/dcpp/AdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.cpp 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/dcpp/AdcHub.cpp 2007-12-03 22:25:40 UTC (rev 926) @@ -28,21 +28,22 @@ #include "version.h" #include "Util.h" #include "UserCommand.h" -#include "FavoriteManager.h" #include "CryptoManager.h" #include "ResourceManager.h" #include "LogManager.h" namespace dcpp { -const string AdcHub::CLIENT_PROTOCOL("ADC/0.10"); -const string AdcHub::SECURE_CLIENT_PROTOCOL("ADCS/0.10"); +const string AdcHub::CLIENT_PROTOCOL("ADC/1.0"); +const string AdcHub::CLIENT_PROTOCOL_TEST("ADC/0.10"); +const string AdcHub::SECURE_CLIENT_PROTOCOL_TEST("ADCS/0.10"); const string AdcHub::ADCS_FEATURE("ADC0"); const string AdcHub::TCP4_FEATURE("TCP4"); const string AdcHub::UDP4_FEATURE("UDP4"); const string AdcHub::BASE_SUPPORT("ADBASE"); const string AdcHub::BAS0_SUPPORT("ADBAS0"); const string AdcHub::TIGR_SUPPORT("ADTIGR"); +const string AdcHub::UCM0_SUPPORT("ADUCM0"); AdcHub::AdcHub(const string& aHubURL, bool secure) : Client(aHubURL, '\n', secure), sid(0) { TimerManager::getInstance()->addListener(this); @@ -288,10 +289,10 @@ token = c.getParam(2); } - bool secure; - if(protocol == CLIENT_PROTOCOL) { - secure = false; - } else if(protocol == SECURE_CLIENT_PROTOCOL && CryptoManager::getInstance()->TLSOk()) { + bool secure = false; + if(protocol == CLIENT_PROTOCOL || protocol == CLIENT_PROTOCOL_TEST) { + // Nothing special + } else if(protocol == SECURE_CLIENT_PROTOCOL_TEST && CryptoManager::getInstance()->TLSOk()) { secure = true; } else { AdcCommand cmd(AdcCommand::SEV_FATAL, AdcCommand::ERROR_PROTOCOL_UNSUPPORTED, "Protocol unknown"); @@ -328,9 +329,9 @@ bool hasToken = c.getParam("TO", 1, token); bool secure; - if(protocol == CLIENT_PROTOCOL) { + if(protocol == CLIENT_PROTOCOL || protocol == CLIENT_PROTOCOL_TEST) { secure = false; - } else if(protocol == SECURE_CLIENT_PROTOCOL && CryptoManager::getInstance()->TLSOk()) { + } else if(protocol == SECURE_CLIENT_PROTOCOL_TEST && CryptoManager::getInstance()->TLSOk()) { secure = true; } else { AdcCommand cmd(AdcCommand::SEV_FATAL, AdcCommand::ERROR_PROTOCOL_UNSUPPORTED, "Protocol unknown"); @@ -352,9 +353,8 @@ const string& name = c.getParam(0); bool rem = c.hasFlag("RM", 1); if(rem) { - int cmd = FavoriteManager::getInstance()->findUserCommand(name); - if(cmd != -1) - FavoriteManager::getInstance()->removeUserCommand(cmd); + fire(ClientListener::HubUserCommand(), this, (int)UserCommand::TYPE_REMOVE, 0, name, Util::emptyString); + return; } bool sep = c.hasFlag("SP", 1); string sctx; @@ -364,14 +364,14 @@ if(ctx <= 0) return; if(sep) { - FavoriteManager::getInstance()->addUserCommand(UserCommand::TYPE_SEPARATOR, ctx, UserCommand::FLAG_NOSAVE, name, "", getHubUrl()); + fire(ClientListener::HubUserCommand(), this, (int)UserCommand::TYPE_SEPARATOR, ctx, name, Util::emptyString); return; } bool once = c.hasFlag("CO", 1); string txt; if(!c.getParam("TT", 1, txt)) return; - FavoriteManager::getInstance()->addUserCommand(once ? UserCommand::TYPE_RAW_ONCE : UserCommand::TYPE_RAW, ctx, UserCommand::FLAG_NOSAVE, name, txt, getHubUrl()); + fire(ClientListener::HubUserCommand(), this, (int)(once ? UserCommand::TYPE_RAW_ONCE : UserCommand::TYPE_RAW), ctx, name, txt); } void AdcHub::sendUDP(const AdcCommand& cmd) throw() { @@ -417,8 +417,19 @@ if(code == AdcCommand::ERROR_BAD_PASSWORD) { setPassword(Util::emptyString); + } else if(code == AdcCommand::ERROR_PROTOCOL_UNSUPPORTED) { + string tmp; + if(c.getParam("PR", 1, tmp)) { + if(tmp == CLIENT_PROTOCOL) { + u->getUser()->setFlag(User::NO_ADC_1_0_PROTOCOL); + } else if(tmp == CLIENT_PROTOCOL_TEST) { + u->getUser()->setFlag(User::NO_ADC_0_10_PROTOCOL); + } else if(tmp == SECURE_CLIENT_PROTOCOL_TEST) { + u->getUser()->setFlag(User::NO_ADCS_0_10_PROTOCOL); + u->getUser()->unsetFlag(User::TLS); + } + } } - // @todo Check for invalid protocol and unset TLS if necessary fire(ClientListener::Message(), this, *u, c.getParam(1)); } @@ -448,8 +459,26 @@ void AdcHub::connect(const OnlineUser& user, string const& token, bool secure) { if(state != STATE_NORMAL) return; + + const string* proto = 0; + if(secure) { + if(user.getUser()->isSet(User::NO_ADCS_0_10_PROTOCOL)) { + /// @todo log + return; + } + proto = &SECURE_CLIENT_PROTOCOL_TEST; + } else { + if(user.getUser()->isSet(User::NO_ADC_1_0_PROTOCOL)) { + if(user.getUser()->isSet(User::NO_ADC_0_10_PROTOCOL)) { + /// @todo log + return; + } + proto = &CLIENT_PROTOCOL_TEST; + } else { + proto = &CLIENT_PROTOCOL; + } + } - const string& proto = secure ? SECURE_CLIENT_PROTOCOL : CLIENT_PROTOCOL; if(ClientManager::getInstance()->isActive()) { uint16_t port = secure ? ConnectionManager::getInstance()->getSecurePort() : ConnectionManager::getInstance()->getPort(); if(port == 0) { @@ -457,9 +486,9 @@ LogManager::getInstance()->message(STRING(NOT_LISTENING)); return; } - send(AdcCommand(AdcCommand::CMD_CTM, user.getIdentity().getSID(), AdcCommand::TYPE_DIRECT).addParam(proto).addParam(Util::toString(port)).addParam(token)); + send(AdcCommand(AdcCommand::CMD_CTM, user.getIdentity().getSID(), AdcCommand::TYPE_DIRECT).addParam(*proto).addParam(Util::toString(port)).addParam(token)); } else { - send(AdcCommand(AdcCommand::CMD_RCM, user.getIdentity().getSID(), AdcCommand::TYPE_DIRECT).addParam(proto).addParam(token)); + send(AdcCommand(AdcCommand::CMD_RCM, user.getIdentity().getSID(), AdcCommand::TYPE_DIRECT).addParam(*proto).addParam(token)); } } @@ -576,7 +605,6 @@ addParam(lastInfoMap, c, "DS", Util::emptyString); } - string su; if(CryptoManager::getInstance()->TLSOk()) { su += ADCS_FEATURE + ","; @@ -637,7 +665,13 @@ lastInfoMap.clear(); sid = 0; - send(AdcCommand(AdcCommand::CMD_SUP, AdcCommand::TYPE_HUB).addParam(BAS0_SUPPORT).addParam(TIGR_SUPPORT)); + AdcCommand cmd(AdcCommand::CMD_SUP, AdcCommand::TYPE_HUB); + cmd.addParam(BAS0_SUPPORT).addParam(TIGR_SUPPORT); + + if(BOOLSETTING(HUB_USER_COMMANDS)) { + cmd.addParam(UCM0_SUPPORT); + } + send(cmd); } void AdcHub::on(Line, const string& aLine) throw() { Modified: dcplusplus/trunk/dcpp/AdcHub.h =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.h 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/dcpp/AdcHub.h 2007-12-03 22:25:40 UTC (rev 926) @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if !defined(ADC_HUB_H) -#define ADC_HUB_H +#ifndef DCPLUSPLUS_DCPP_ADC_HUB_H +#define DCPLUSPLUS_DCPP_ADC_HUB_H #include "Client.h" #include "AdcCommand.h" @@ -73,13 +73,15 @@ uint32_t sid; static const string CLIENT_PROTOCOL; - static const string SECURE_CLIENT_PROTOCOL; + static const string CLIENT_PROTOCOL_TEST; + static const string SECURE_CLIENT_PROTOCOL_TEST; static const string ADCS_FEATURE; static const string TCP4_FEATURE; static const string UDP4_FEATURE; static const string BASE_SUPPORT; static const string BAS0_SUPPORT; static const string TIGR_SUPPORT; + static const string UCM0_SUPPORT; virtual string checkNick(const string& nick); Modified: dcplusplus/trunk/dcpp/BufferedSocket.cpp =================================================================== --- dcplusplus/trunk/dcpp/BufferedSocket.cpp 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/dcpp/BufferedSocket.cpp 2007-12-03 22:25:40 UTC (rev 926) @@ -112,6 +112,7 @@ sock = secure ? CryptoManager::getInstance()->getClientSocket(allowUntrusted) : new Socket; sock->create(); + sock->bind(0, SETTING(BIND_ADDRESS)); if(SETTING(SOCKET_IN_BUFFER) >= 1024) sock->setSocketOpt(SO_RCVBUF, SETTING(SOCKET_IN_BUFFER)); if(SETTING(SOCKET_OUT_BUFFER) >= 1024) Modified: dcplusplus/trunk/dcpp/ClientManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/ClientManager.cpp 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/dcpp/ClientManager.cpp 2007-12-03 22:25:40 UTC (rev 926) @@ -481,7 +481,11 @@ void ClientManager::on(HubUserCommand, Client* client, int aType, int ctx, const string& name, const string& command) throw() { if(BOOLSETTING(HUB_USER_COMMANDS)) { - if(aType == UserCommand::TYPE_CLEAR) { + if(aType == UserCommand::TYPE_REMOVE) { + int cmd = FavoriteManager::getInstance()->findUserCommand(name, client->getHubUrl()); + if(cmd != -1) + FavoriteManager::getInstance()->removeUserCommand(cmd); + } else if(aType == UserCommand::TYPE_CLEAR) { FavoriteManager::getInstance()->removeHubUserCommands(ctx, client->getHubUrl()); } else { FavoriteManager::getInstance()->addUserCommand(aType, ctx, UserCommand::FLAG_NOSAVE, name, command, client->getHubUrl()); Modified: dcplusplus/trunk/dcpp/FavoriteManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/FavoriteManager.cpp 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/dcpp/FavoriteManager.cpp 2007-12-03 22:25:40 UTC (rev 926) @@ -98,10 +98,10 @@ save(); } -int FavoriteManager::findUserCommand(const string& aName) { +int FavoriteManager::findUserCommand(const string& aName, const string& aUrl) { Lock l(cs); for(UserCommand::List::iterator i = userCommands.begin(); i != userCommands.end(); ++i) { - if(i->getName() == aName) { + if(i->getName() == aName && i->getHub() == aUrl) { return i->getId(); } } Modified: dcplusplus/trunk/dcpp/FavoriteManager.h =================================================================== --- dcplusplus/trunk/dcpp/FavoriteManager.h 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/dcpp/FavoriteManager.h 2007-12-03 22:25:40 UTC (rev 926) @@ -90,7 +90,7 @@ // User Commands UserCommand addUserCommand(int type, int ctx, int flags, const string& name, const string& command, const string& hub); bool getUserCommand(int cid, UserCommand& uc); - int findUserCommand(const string& aName); + int findUserCommand(const string& aName, const string& aUrl); bool moveUserCommand(int cid, int pos); void updateUserCommand(const UserCommand& uc); void removeUserCommand(int cid); Modified: dcplusplus/trunk/dcpp/SearchManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/SearchManager.cpp 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/dcpp/SearchManager.cpp 2007-12-03 22:25:40 UTC (rev 926) @@ -126,7 +126,7 @@ socket = new Socket(); socket->create(Socket::TYPE_UDP); - port = socket->bind(static_cast<uint16_t>(SETTING(UDP_PORT))); + port = socket->bind(static_cast<uint16_t>(SETTING(UDP_PORT)), SETTING(BIND_ADDRESS)); start(); } @@ -166,7 +166,7 @@ try { socket->disconnect(); socket->create(Socket::TYPE_UDP); - socket->bind(port); + socket->bind(port, SETTING(BIND_ADDRESS)); } catch(const SocketException& e) { // Oops, fatal this time... dcdebug("SearchManager::run Stopped listening: %s\n", e.getError().c_str()); Modified: dcplusplus/trunk/dcpp/User.h =================================================================== --- dcplusplus/trunk/dcpp/User.h 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/dcpp/User.h 2007-12-03 22:25:40 UTC (rev 926) @@ -40,7 +40,10 @@ NMDC_BIT, BOT_BIT, TLS_BIT, - OLD_CLIENT_BIT + OLD_CLIENT_BIT, + NO_ADC_1_0_PROTOCOL_BIT, + NO_ADC_0_10_PROTOCOL_BIT, + NO_ADCS_0_10_PROTOCOL_BIT }; /** Each flag is set if it's true in at least one hub */ @@ -51,7 +54,10 @@ NMDC = 1<<NMDC_BIT, BOT = 1<<BOT_BIT, TLS = 1<<TLS_BIT, //< Client supports TLS - OLD_CLIENT = 1<<OLD_CLIENT_BIT //< Can't download - old client + OLD_CLIENT = 1<<OLD_CLIENT_BIT, //< Can't download - old client + NO_ADC_1_0_PROTOCOL = 1<<NO_ADC_1_0_PROTOCOL_BIT, //< Doesn't support "ADC/1.0" (dc++ <=0.703) + NO_ADC_0_10_PROTOCOL = 1<<NO_ADC_0_10_PROTOCOL_BIT, //< Doesn't support "ADC/0.10" + NO_ADCS_0_10_PROTOCOL = 1<< NO_ADCS_0_10_PROTOCOL_BIT //< Doesn't support "ADCS/0.10" }; struct Hash { @@ -90,8 +96,9 @@ CT_BOT = 1, CT_REGGED = 2, CT_OP = 4, - CT_OWNER = 8, - CT_HUB = 16 + CT_SU = 8, + CT_OWNER = 16, + CT_HUB = 32 }; Identity() : sid(0) { } @@ -117,7 +124,7 @@ string getTag() const; bool supports(const string& name) const; bool isHub() const { return isClientType(CT_HUB) || !get("HU").empty(); } - bool isOp() const { return isClientType(CT_OP) || !get("OP").empty(); } + bool isOp() const { return isClientType(CT_OP) || isClientType(CT_SU) || isClientType(CT_OWNER) || !get("OP").empty(); } bool isRegistered() const { return isClientType(CT_REGGED) || !get("RG").empty(); } bool isHidden() const { return !get("HI").empty(); } bool isBot() const { return isClientType(CT_BOT) || !get("BO").empty(); } Modified: dcplusplus/trunk/dcpp/UserCommand.h =================================================================== --- dcplusplus/trunk/dcpp/UserCommand.h 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/dcpp/UserCommand.h 2007-12-03 22:25:40 UTC (rev 926) @@ -32,7 +32,8 @@ TYPE_SEPARATOR, TYPE_RAW, TYPE_RAW_ONCE, - TYPE_CLEAR = 255 + TYPE_REMOVE, + TYPE_CLEAR = 255 // In a momentary lapse of reason, 255 was chosen in the nmdc version of usercommand for clearing them all }; enum { Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabView.h 2007-12-03 22:25:40 UTC (rev 926) @@ -101,6 +101,7 @@ bool handleSized(const WidgetSizedEventResult&); void handleTabSelected(); bool handleContextMenu(SmartWin::ScreenCoordinate pt); + void handleMiddleMouseDown(const MouseEventResult& mouseEventResult); SmartUtil::tstring cutTitle(const SmartUtil::tstring& title); void layout(); Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetToolbar.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetToolbar.h 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetToolbar.h 2007-12-03 22:25:40 UTC (rev 926) @@ -171,8 +171,6 @@ virtual bool tryFire( const MSG & msg, LRESULT & retVal ); private: - std::map< unsigned int, SmartUtil::tstring > itsToolTips; - // Keep references ImageListPtr itsNormalImageList; ImageListPtr itsHotImageList; Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetTabView.cpp 2007-12-03 22:25:40 UTC (rev 926) @@ -31,6 +31,7 @@ onSized(std::tr1::bind(&WidgetTabView::handleSized, this, _1)); tab->onContextMenu(std::tr1::bind(&WidgetTabView::handleContextMenu, this, _1)); + tab->onMiddleMouseDown(std::tr1::bind(&WidgetTabView::handleMiddleMouseDown, this, _1)); } void WidgetTabView::add(WidgetChildWindow* w, const IconPtr& icon) { @@ -268,7 +269,7 @@ return image; } -bool WidgetTabView::handleContextMenu(SmartWin::ScreenCoordinate pt) { +bool WidgetTabView::handleContextMenu(ScreenCoordinate pt) { TabInfo* ti = 0; if(pt.x() == -1 && pt.y() == -1) { int i = tab->getSelectedIndex(); @@ -294,6 +295,12 @@ return false; } +void WidgetTabView::handleMiddleMouseDown(const MouseEventResult& mouseEventResult) { + TabInfo* ti = getTabInfo(tab->hitTest(mouseEventResult.pos)); + if(ti) + ti->w->close(); +} + bool WidgetTabView::filter(const MSG& msg) { if(msg.message == WM_KEYUP && msg.wParam == VK_CONTROL) { inTab = false; Modified: dcplusplus/trunk/smartwin/source/widgets/WidgetToolbar.cpp =================================================================== --- dcplusplus/trunk/smartwin/source/widgets/WidgetToolbar.cpp 2007-12-01 23:34:02 UTC (rev 925) +++ dcplusplus/trunk/smartwin/source/widgets/WidgetToolbar.cpp 2007-12-03 22:25:40 UTC (rev 926) @@ -3,7 +3,7 @@ namespace SmartWin { WidgetToolbar::Seed::Seed() : - Widget::Seed(TOOLBARCLASSNAME, WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS) + Widget::Seed(TOOLBARCLASSNAME, WS_CHILD | WS_VISIBLE | TBSTYLE_LIST | TBSTYLE_TOOLTIPS) { } @@ -11,6 +11,8 @@ { ControlType::create(cs); + this->sendMessage(TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS); + //// Telling the toolbar what the size of TBBUTTON struct is this->sendMessage(TB_BUTTONSTRUCTSIZE, ( WPARAM ) sizeof( TBBUTTON )); } @@ -30,46 +32,25 @@ void WidgetToolbar::appendItem( unsigned int id, int image, const SmartUtil::tstring& toolTip, const Dispatcher::F& f) { - // Checking if tooltip id exists from before - if ( itsToolTips.find( id ) != itsToolTips.end() ) - { - xCeption x( _T( "Tried to add a button with an ID that already exists..." ) ); - throw x; - } - // Adding button TBBUTTON tb = { 0 }; tb.iBitmap = image; tb.idCommand = id; tb.fsState = TBSTATE_ENABLED; tb.fsStyle = BTNS_AUTOSIZE; + tb.iString = reinterpret_cast<INT_PTR>(toolTip.c_str()); if ( this->sendMessage(TB_ADDBUTTONS, 1, reinterpret_cast< LPARAM >( &tb ) ) == FALSE ) { xCeption x( _T( "Error while trying to add a button to toolbar..." ) ); throw x; } - - if(!toolTip.empty()) { - itsToolTips[id] = toolTip; - } - + if(f) setCallback(Message(WM_COMMAND, id), Dispatcher(f)); } bool WidgetToolbar::tryFire( const MSG & msg, LRESULT & retVal ) { - if(msg.message == WM_NOTIFY) { - LPNMHDR hdr = reinterpret_cast< LPNMHDR >( msg.lParam ); - if(hdr->code == TTN_GETDISPINFO) { - LPTOOLTIPTEXT lpttt = reinterpret_cast< LPTOOLTIPTEXT >( msg.lParam ); - if(itsToolTips.find(lpttt->hdr.idFrom) != itsToolTips.end()) { - lpttt->lpszText = const_cast < TCHAR * >( itsToolTips[lpttt->hdr.idFrom].c_str() ); - return true; - } - } - } - bool handled = PolicyType::tryFire(msg, retVal); if(!handled && msg.message == WM_COMMAND) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2007-12-04 18:38:56
|
Revision: 927 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=927&view=rev Author: zouzou123gen Date: 2007-12-04 10:38:49 -0800 (Tue, 04 Dec 2007) Log Message: ----------- actually use the seed made for status bars; fixes size grips Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/AspectStatus.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-03 22:25:40 UTC (rev 926) +++ dcplusplus/trunk/changelog.txt 2007-12-04 18:38:49 UTC (rev 927) @@ -23,6 +23,7 @@ * Close tab with middle mouse button (thanks poy) * Fixed socket ip bind (thanks garg's quasi-friend) * Finished UCMD extension draft implementation +* Fixed status bars (poy) -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/win32/AspectStatus.h =================================================================== --- dcplusplus/trunk/win32/AspectStatus.h 2007-12-03 22:25:40 UTC (rev 926) +++ dcplusplus/trunk/win32/AspectStatus.h 2007-12-04 18:38:49 UTC (rev 927) @@ -41,7 +41,7 @@ if(sizeGrip) { cs.style |= SBARS_SIZEGRIP; } - status = static_cast<WidgetType*>(this)->createStatusBarSections(); + status = static_cast<WidgetType*>(this)->createStatusBarSections(cs); statusTip = static_cast<WidgetType*>(this)->createToolTip(); statusTip->setTool(status, std::tr1::bind(&ThisType::handleToolTip, this)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-04 21:17:21
|
Revision: 928 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=928&view=rev Author: arnetheduck Date: 2007-12-04 13:17:15 -0800 (Tue, 04 Dec 2007) Log Message: ----------- Adc fixes Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/AdcCommand.h dcplusplus/trunk/dcpp/AdcHub.cpp dcplusplus/trunk/dcpp/AdcHub.h dcplusplus/trunk/dcpp/BloomFilter.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-04 18:38:49 UTC (rev 927) +++ dcplusplus/trunk/changelog.txt 2007-12-04 21:17:15 UTC (rev 928) @@ -24,6 +24,7 @@ * Fixed socket ip bind (thanks garg's quasi-friend) * Finished UCMD extension draft implementation * Fixed status bars (poy) +* Fixed protocol error STA being sent as type C -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/dcpp/AdcCommand.h =================================================================== --- dcplusplus/trunk/dcpp/AdcCommand.h 2007-12-04 18:38:49 UTC (rev 927) +++ dcplusplus/trunk/dcpp/AdcCommand.h 2007-12-04 21:17:15 UTC (rev 928) @@ -106,7 +106,7 @@ C(CMD, 'C','M','D'); #undef C - static const uint32_t HUB_SID = 0x41414141; // AAAA in base32 + static const uint32_t HUB_SID = 0xffffffff; // No client will have this sid explicit AdcCommand(uint32_t aCmd, char aType = TYPE_CLIENT); explicit AdcCommand(uint32_t aCmd, const uint32_t aTarget, char aType); Modified: dcplusplus/trunk/dcpp/AdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.cpp 2007-12-04 18:38:49 UTC (rev 927) +++ dcplusplus/trunk/dcpp/AdcHub.cpp 2007-12-04 21:17:15 UTC (rev 928) @@ -45,7 +45,7 @@ const string AdcHub::TIGR_SUPPORT("ADTIGR"); const string AdcHub::UCM0_SUPPORT("ADUCM0"); -AdcHub::AdcHub(const string& aHubURL, bool secure) : Client(aHubURL, '\n', secure), sid(0) { +AdcHub::AdcHub(const string& aHubURL, bool secure) : Client(aHubURL, '\n', secure), oldPassword(false), sid(0) { TimerManager::getInstance()->addListener(this); } @@ -54,7 +54,6 @@ clearUsers(); } - OnlineUser& AdcHub::getUser(const uint32_t aSID, const CID& aCID) { OnlineUser* ou = findUser(aSID); if(ou) { @@ -208,6 +207,7 @@ socket->disconnect(false); return; } else if(!tigrOk) { + oldPassword = true; // What now? Some hubs fake BASE support without TIGR support =/ fire(ClientListener::StatusMessage(), this, "Hub probably uses an old version of ADC, please encourage the owner to upgrade"); } @@ -266,7 +266,7 @@ putUser(s); // No use to hammer if we're banned - if(s == sid && c.hasFlag("TL", 1)) { + if(s == sid && c.hasFlag("TL", 1)) { setAutoReconnect(false); } } @@ -295,7 +295,7 @@ } else if(protocol == SECURE_CLIENT_PROTOCOL_TEST && CryptoManager::getInstance()->TLSOk()) { secure = true; } else { - AdcCommand cmd(AdcCommand::SEV_FATAL, AdcCommand::ERROR_PROTOCOL_UNSUPPORTED, "Protocol unknown"); + AdcCommand cmd(AdcCommand::SEV_FATAL, AdcCommand::ERROR_PROTOCOL_UNSUPPORTED, "Protocol unknown", AdcCommand::TYPE_DIRECT); cmd.setTo(c.getFrom()); cmd.addParam("PR", protocol); @@ -334,7 +334,7 @@ } else if(protocol == SECURE_CLIENT_PROTOCOL_TEST && CryptoManager::getInstance()->TLSOk()) { secure = true; } else { - AdcCommand cmd(AdcCommand::SEV_FATAL, AdcCommand::ERROR_PROTOCOL_UNSUPPORTED, "Protocol unknown"); + AdcCommand cmd(AdcCommand::SEV_FATAL, AdcCommand::ERROR_PROTOCOL_UNSUPPORTED, "Protocol unknown", AdcCommand::TYPE_DIRECT); cmd.setTo(c.getFrom()); cmd.addParam("PR", protocol); @@ -460,7 +460,7 @@ if(state != STATE_NORMAL) return; - const string* proto = 0; + const string* proto; if(secure) { if(user.getUser()->isSet(User::NO_ADCS_0_10_PROTOCOL)) { /// @todo log @@ -468,7 +468,8 @@ } proto = &SECURE_CLIENT_PROTOCOL_TEST; } else { - if(user.getUser()->isSet(User::NO_ADC_1_0_PROTOCOL)) { + // dc++ <= 0.703 has a bug which makes it respond with CSTA to the hub if an unrecognised protocol is used *sigh* + if(true || user.getUser()->isSet(User::NO_ADC_1_0_PROTOCOL)) { if(user.getUser()->isSet(User::NO_ADC_0_10_PROTOCOL)) { /// @todo log return; @@ -547,8 +548,10 @@ AutoArray<uint8_t> buf(saltBytes); Encoder::fromBase32(salt.c_str(), buf, saltBytes); TigerHash th; - CID cid = getMyIdentity().getUser()->getCID(); - th.update(cid.data(), CID::SIZE); + if(oldPassword) { + CID cid = getMyIdentity().getUser()->getCID(); + th.update(cid.data(), CID::SIZE); + } th.update(pwd.data(), pwd.length()); th.update(buf, saltBytes); send(AdcCommand(AdcCommand::CMD_PAS, AdcCommand::TYPE_HUB).addParam(Encoder::toBase32(th.finalize(), TigerHash::HASH_SIZE))); @@ -659,8 +662,8 @@ send(cmd.toString(sid)); } -void AdcHub::on(Connected) throw() { - Client::on(Connected()); +void AdcHub::on(Connected c) throw() { + Client::on(c); lastInfoMap.clear(); sid = 0; @@ -674,8 +677,8 @@ send(cmd); } -void AdcHub::on(Line, const string& aLine) throw() { - Client::on(Line(), aLine); +void AdcHub::on(Line l, const string& aLine) throw() { + Client::on(l, aLine); if(BOOLSETTING(ADC_DEBUG)) { fire(ClientListener::StatusMessage(), this, "<ADC>" + aLine + "</ADC>"); @@ -683,13 +686,13 @@ dispatch(aLine); } -void AdcHub::on(Failed, const string& aLine) throw() { +void AdcHub::on(Failed f, const string& aLine) throw() { clearUsers(); - Client::on(Failed(), aLine); + Client::on(f, aLine); } -void AdcHub::on(Second, uint32_t aTick) throw() { - Client::on(Second(), aTick); +void AdcHub::on(Second s, uint32_t aTick) throw() { + Client::on(s, aTick); if(state == STATE_NORMAL && (aTick > (getLastActivity() + 120*1000)) ) { send("\n", 1); } Modified: dcplusplus/trunk/dcpp/AdcHub.h =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.h 2007-12-04 18:38:49 UTC (rev 927) +++ dcplusplus/trunk/dcpp/AdcHub.h 2007-12-04 21:17:15 UTC (rev 928) @@ -64,6 +64,7 @@ typedef unordered_map<uint32_t, OnlineUser*> SIDMap; typedef SIDMap::iterator SIDIter; + bool oldPassword; Socket udp; SIDMap users; StringMap lastInfoMap; Modified: dcplusplus/trunk/dcpp/BloomFilter.h =================================================================== --- dcplusplus/trunk/dcpp/BloomFilter.h 2007-12-04 18:38:49 UTC (rev 927) +++ dcplusplus/trunk/dcpp/BloomFilter.h 2007-12-04 21:17:15 UTC (rev 928) @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if !defined(BLOOM_FILTER_H) -#define BLOOM_FILTER_H +#ifndef DCPLUSPLUS_DCPP_BLOOM_FILTER_H +#define DCPLUSPLUS_DCPP_BLOOM_FILTER_H #include "ZUtils.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-09 22:06:45
|
Revision: 929 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=929&view=rev Author: arnetheduck Date: 2007-12-09 14:06:36 -0800 (Sun, 09 Dec 2007) Log Message: ----------- tentative multisource crash fix Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/Download.cpp dcplusplus/trunk/dcpp/DownloadManager.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-04 21:17:15 UTC (rev 928) +++ dcplusplus/trunk/changelog.txt 2007-12-09 22:06:36 UTC (rev 929) @@ -25,6 +25,7 @@ * Finished UCMD extension draft implementation * Fixed status bars (poy) * Fixed protocol error STA being sent as type C +* Fixed a multisource download crash -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/dcpp/Download.cpp =================================================================== --- dcplusplus/trunk/dcpp/Download.cpp 2007-12-04 21:17:15 UTC (rev 928) +++ dcplusplus/trunk/dcpp/Download.cpp 2007-12-09 22:06:36 UTC (rev 929) @@ -61,10 +61,10 @@ } if(qi.isSet(QueueItem::FLAG_RESUME)) { +#ifdef PORT_ME const string& target = (getTempTarget().empty() ? getPath() : getTempTarget()); int64_t start = File::getSize(target); -#ifdef PORT_ME // Only use antifrag if we don't have a previous non-antifrag part if( BOOLSETTING(ANTI_FRAG) && (start == -1) ) { int64_t aSize = File::getSize(target + Download::ANTI_FRAG_EXT); @@ -85,6 +85,7 @@ Download::~Download() { getUserConnection().setDownload(0); + delete file; } AdcCommand Download::getCommand(bool zlib) { Modified: dcplusplus/trunk/dcpp/DownloadManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/DownloadManager.cpp 2007-12-04 21:17:15 UTC (rev 928) +++ dcplusplus/trunk/dcpp/DownloadManager.cpp 2007-12-09 22:06:36 UTC (rev 929) @@ -341,8 +341,6 @@ if(d->getType() == Transfer::TYPE_TREE) { d->getFile()->flush(); - delete d->getFile(); - d->setFile(NULL); int64_t bl = 1024; while(bl * (int64_t)d->getTigerTree().getLeaves().size() < d->getTigerTree().getFileSize()) @@ -367,8 +365,6 @@ // First, finish writing the file (flushing the buffers and closing the file...) try { d->getFile()->flush(); - delete d->getFile(); - d->setFile(0); } catch(const FileException& e) { failDownload(aSource, e.getError()); return; @@ -493,8 +489,6 @@ } catch(const Exception&) { } } - delete d->getFile(); - d->setFile(NULL); if(d->isSet(Download::FLAG_ANTI_FRAG)) { d->unsetFlag(Download::FLAG_ANTI_FRAG); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-11 17:07:29
|
Revision: 931 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=931&view=rev Author: arnetheduck Date: 2007-12-11 09:07:20 -0800 (Tue, 11 Dec 2007) Log Message: ----------- fix state issues Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/ConnectionManager.cpp dcplusplus/trunk/dcpp/DownloadManager.cpp dcplusplus/trunk/dcpp/UploadManager.cpp dcplusplus/trunk/dcpp/version.h dcplusplus/trunk/win32/DCPlusPlus.rc Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-10 22:30:37 UTC (rev 930) +++ dcplusplus/trunk/changelog.txt 2007-12-11 17:07:20 UTC (rev 931) @@ -26,6 +26,7 @@ * Fixed status bars (poy) * Fixed protocol error STA being sent as type C * Fixed a multisource download crash +* Fixed state checks for uploads (an invalid sequence could possibly crash client from remote) -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/dcpp/ConnectionManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/ConnectionManager.cpp 2007-12-10 22:30:37 UTC (rev 930) +++ dcplusplus/trunk/dcpp/ConnectionManager.cpp 2007-12-11 17:07:20 UTC (rev 931) @@ -323,7 +323,7 @@ void ConnectionManager::on(AdcCommand::SUP, UserConnection* aSource, const AdcCommand& cmd) throw() { if(aSource->getState() != UserConnection::STATE_SUPNICK) { // Already got this once, ignore...@todo fix support updates - dcdebug("CM::onMyNick %p sent nick twice\n", (void*)aSource); + dcdebug("CM::onSUP %p sent sup twice\n", (void*)aSource); return; } @@ -375,7 +375,7 @@ aSource->setState(UserConnection::STATE_INF); } -void ConnectionManager::on(AdcCommand::STA, UserConnection*, const AdcCommand&) throw() { +void ConnectionManager::on(AdcCommand::STA, UserConnection*, const AdcCommand& cmd) throw() { } @@ -595,9 +595,7 @@ void ConnectionManager::on(AdcCommand::INF, UserConnection* aSource, const AdcCommand& cmd) throw() { if(aSource->getState() != UserConnection::STATE_INF) { - // Already got this once, ignore... aSource->send(AdcCommand(AdcCommand::SEV_FATAL, AdcCommand::ERROR_PROTOCOL_GENERIC, "Expecting INF")); - dcdebug("CM::onINF %p sent INF twice\n", (void*)aSource); aSource->disconnect(); return; } Modified: dcplusplus/trunk/dcpp/DownloadManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/DownloadManager.cpp 2007-12-10 22:30:37 UTC (rev 930) +++ dcplusplus/trunk/dcpp/DownloadManager.cpp 2007-12-11 17:07:20 UTC (rev 931) @@ -515,7 +515,7 @@ } const string& err = cmd.getParameters()[0]; - if(err.length() < 3) { + if(err.length() != 3) { aSource->disconnect(); return; } @@ -533,6 +533,10 @@ noSlots(aSource); return; } + case AdcCommand::SEV_SUCCESS: + // We don't know any messages that would give us these... + dcdebug("Unknown success message %s %s", err.c_str(), cmd.getParam(1).c_str()); + return; } aSource->disconnect(); } Modified: dcplusplus/trunk/dcpp/UploadManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/UploadManager.cpp 2007-12-10 22:30:37 UTC (rev 930) +++ dcplusplus/trunk/dcpp/UploadManager.cpp 2007-12-11 17:07:20 UTC (rev 931) @@ -280,6 +280,11 @@ } void UploadManager::on(AdcCommand::GET, UserConnection* aSource, const AdcCommand& c) throw() { + if(aSource->getState() != UserConnection::STATE_GET) { + dcdebug("UM::onGET Bad state, ignoring\n"); + return; + } + const string& type = c.getParam(0); const string& fname = c.getParam(1); int64_t aStartPos = Util::toInt64(c.getParam(2)); @@ -454,6 +459,11 @@ } void UploadManager::on(AdcCommand::GFI, UserConnection* aSource, const AdcCommand& c) throw() { + if(aSource->getState() != UserConnection::STATE_GET) { + dcdebug("UM::onSend Bad state, ignoring\n"); + return; + } + if(c.getParameters().size() < 2) { aSource->send(AdcCommand(AdcCommand::SEV_RECOVERABLE, AdcCommand::ERROR_PROTOCOL_GENERIC, "Missing parameters")); return; Modified: dcplusplus/trunk/dcpp/version.h =================================================================== --- dcplusplus/trunk/dcpp/version.h 2007-12-10 22:30:37 UTC (rev 930) +++ dcplusplus/trunk/dcpp/version.h 2007-12-11 17:07:20 UTC (rev 931) @@ -17,7 +17,7 @@ */ #define APPNAME "DC++" -#define VERSIONSTRING "0.703" -#define VERSIONFLOAT 0.703 +#define VERSIONSTRING "0.704" +#define VERSIONFLOAT 0.704 /* Update the .rc file as well... */ Modified: dcplusplus/trunk/win32/DCPlusPlus.rc =================================================================== --- dcplusplus/trunk/win32/DCPlusPlus.rc 2007-12-10 22:30:37 UTC (rev 930) +++ dcplusplus/trunk/win32/DCPlusPlus.rc 2007-12-11 17:07:20 UTC (rev 931) @@ -818,8 +818,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,7,0,3 - PRODUCTVERSION 0,7,0,3 + FILEVERSION 0,7,0,4 + PRODUCTVERSION 0,7,0,4 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -836,12 +836,12 @@ BEGIN VALUE "Comments", "http://dcplusplus.sourceforge.net" VALUE "FileDescription", "DC++" - VALUE "FileVersion", "0, 7, 0, 3" + VALUE "FileVersion", "0, 7, 0, 4" VALUE "InternalName", "DC++" VALUE "LegalCopyright", "Copyright 2001-2006 Jacek Sieka" VALUE "OriginalFilename", "DCPlusPlus.exe" VALUE "ProductName", "DC++" - VALUE "ProductVersion", "0, 7, 0, 3" + VALUE "ProductVersion", "0, 7, 0, 4" END END BLOCK "VarFileInfo" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-11 20:00:10
|
Revision: 933 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=933&view=rev Author: arnetheduck Date: 2007-12-11 12:00:08 -0800 (Tue, 11 Dec 2007) Log Message: ----------- fix adc protocol order, chat focus, pageup/down in private frame Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/AdcHub.cpp dcplusplus/trunk/win32/MDIChildFrame.h dcplusplus/trunk/win32/PrivateFrame.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-11 18:25:18 UTC (rev 932) +++ dcplusplus/trunk/changelog.txt 2007-12-11 20:00:08 UTC (rev 933) @@ -27,6 +27,7 @@ * Fixed protocol error STA being sent as type C * Fixed a multisource download crash * Fixed state checks for uploads (an invalid sequence could possibly crash client from remote) +* Page up/down in private chat scrolls chat log just as in hub chat -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/dcpp/AdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.cpp 2007-12-11 18:25:18 UTC (rev 932) +++ dcplusplus/trunk/dcpp/AdcHub.cpp 2007-12-11 20:00:08 UTC (rev 933) @@ -469,14 +469,15 @@ proto = &SECURE_CLIENT_PROTOCOL_TEST; } else { // dc++ <= 0.703 has a bug which makes it respond with CSTA to the hub if an unrecognised protocol is used *sigh* - if(true || user.getUser()->isSet(User::NO_ADC_1_0_PROTOCOL)) { - if(user.getUser()->isSet(User::NO_ADC_0_10_PROTOCOL)) { + // so we try 0.10 first... + if(user.getUser()->isSet(User::NO_ADC_0_10_PROTOCOL)) { + if(user.getUser()->isSet(User::NO_ADC_1_0_PROTOCOL)) { /// @todo log return; } + proto = &CLIENT_PROTOCOL; + } else { proto = &CLIENT_PROTOCOL_TEST; - } else { - proto = &CLIENT_PROTOCOL; } } Modified: dcplusplus/trunk/win32/MDIChildFrame.h =================================================================== --- dcplusplus/trunk/win32/MDIChildFrame.h 2007-12-11 18:25:18 UTC (rev 932) +++ dcplusplus/trunk/win32/MDIChildFrame.h 2007-12-11 20:00:08 UTC (rev 933) @@ -97,7 +97,6 @@ if(alwaysFocus || (lastFocus == NULL)) { lastFocus = widget->handle(); - ::SetFocus(lastFocus); } if(alwaysFocus) alwaysSameFocus = true; Modified: dcplusplus/trunk/win32/PrivateFrame.cpp =================================================================== --- dcplusplus/trunk/win32/PrivateFrame.cpp 2007-12-11 18:25:18 UTC (rev 932) +++ dcplusplus/trunk/win32/PrivateFrame.cpp 2007-12-11 20:00:08 UTC (rev 933) @@ -145,8 +145,8 @@ } line += aLine; - int limit = chat->getTextLimit(); - if(chat->length() + static_cast<int>(line.size()) > limit) { + size_t limit = chat->getTextLimit(); + if(chat->length() + line.size() > limit) { HoldRedraw hold(chat); chat->setSelection(0, chat->lineIndex(chat->lineFromChar(limit / 10))); chat->replaceSelection(_T("")); @@ -336,8 +336,14 @@ bool PrivateFrame::handleKeyDown(int c) { if(c == VK_RETURN && enter()) { return true; + } else if(c == VK_PRIOR) { // page up + chat->sendMessage(WM_VSCROLL, SB_PAGEUP); + return true; + } else if(c == VK_NEXT) { // page down + chat->sendMessage(WM_VSCROLL, SB_PAGEDOWN); + return true; } - + return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zou...@us...> - 2007-12-11 20:41:20
|
Revision: 934 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=934&view=rev Author: zouzou123gen Date: 2007-12-11 12:41:10 -0800 (Tue, 11 Dec 2007) Log Message: ----------- crash on right-click in the download queue Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTreeView.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-11 20:00:08 UTC (rev 933) +++ dcplusplus/trunk/changelog.txt 2007-12-11 20:41:10 UTC (rev 934) @@ -28,6 +28,7 @@ * Fixed a multisource download crash * Fixed state checks for uploads (an invalid sequence could possibly crash client from remote) * Page up/down in private chat scrolls chat log just as in hub chat +* Fixed crash on right-click in the download queue (poy) -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTreeView.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTreeView.h 2007-12-11 20:00:08 UTC (rev 933) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTreeView.h 2007-12-11 20:41:10 UTC (rev 934) @@ -349,7 +349,8 @@ inline HTREEITEM WidgetTreeView::hitTest(const ScreenCoordinate& pt) { ClientCoordinate cc(pt, this); - return TreeView_HitTest(this->handle(), &cc.getPoint()); + TVHITTESTINFO tvhti = { cc.getPoint() }; + return TreeView_HitTest(this->handle(), &tvhti); } inline HTREEITEM WidgetTreeView::getSelection() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-13 20:15:34
|
Revision: 937 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=937&view=rev Author: arnetheduck Date: 2007-12-13 12:15:27 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Fix some connectivity issues, fix download moving Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/AdcHub.cpp dcplusplus/trunk/dcpp/ConnectionManager.cpp dcplusplus/trunk/dcpp/Download.cpp dcplusplus/trunk/dcpp/DownloadManager.cpp dcplusplus/trunk/dcpp/QueueManager.cpp dcplusplus/trunk/dcpp/UserConnection.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-12 19:28:12 UTC (rev 936) +++ dcplusplus/trunk/changelog.txt 2007-12-13 20:15:27 UTC (rev 937) @@ -7,7 +7,7 @@ * Fixed version info (poy) * Keep selection visible on move up/down in some list views (poy) * Fixed clicking in the header of the favorite hubs list view (poy) -* Update to ADC 1.0 +* Update most things to ADC 1.0 * Fixed pressing enter in the notepad (poy) * Fixed user commands params (poy) * Readded list view double buffering (thanks poy) Modified: dcplusplus/trunk/dcpp/AdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.cpp 2007-12-12 19:28:12 UTC (rev 936) +++ dcplusplus/trunk/dcpp/AdcHub.cpp 2007-12-13 20:15:27 UTC (rev 937) @@ -275,20 +275,26 @@ OnlineUser* u = findUser(c.getFrom()); if(!u || u->getUser() == ClientManager::getInstance()->getMe()) return; - if(c.getParameters().size() < 3) + if(c.getParameters().size() < 2) return; const string& protocol = c.getParam(0); const string& port = c.getParam(1); - + string token; - bool hasToken = c.getParam("TO", 2, token); - - if(!hasToken) { - // @todo remove this bugfix for <=0.698 some time - token = c.getParam(2); + if(c.getParameters().size() == 3) { + const string& tok = c.getParam(2); + + // 0.699 put TO before the token, keep this bug fix for a while + if(tok.compare(0, 2, "TO") == 0) { + token = tok.substr(2); + } else { + token = tok; + } + } else { + // <= 0.703 would send an empty token for passive connections... } - + bool secure = false; if(protocol == CLIENT_PROTOCOL || protocol == CLIENT_PROTOCOL_TEST) { // Nothing special @@ -298,10 +304,8 @@ AdcCommand cmd(AdcCommand::SEV_FATAL, AdcCommand::ERROR_PROTOCOL_UNSUPPORTED, "Protocol unknown", AdcCommand::TYPE_DIRECT); cmd.setTo(c.getFrom()); cmd.addParam("PR", protocol); + cmd.addParam("TO", token); - if(hasToken) - cmd.addParam("TO", token); - send(cmd); return; } @@ -315,7 +319,7 @@ } void AdcHub::handle(AdcCommand::RCM, AdcCommand& c) throw() { - if(c.getParameters().empty()) { + if(c.getParameters().size() < 2) { return; } if(!ClientManager::getInstance()->isActive()) @@ -325,8 +329,14 @@ return; const string& protocol = c.getParam(0); + const string& tok = c.getParam(1); string token; - bool hasToken = c.getParam("TO", 1, token); + // 0.699 sent a token with "TO" prefix + if(tok.compare(0, 2, "TO") == 0) { + token = tok.substr(2); + } else { + token = tok; + } bool secure; if(protocol == CLIENT_PROTOCOL || protocol == CLIENT_PROTOCOL_TEST) { @@ -337,10 +347,8 @@ AdcCommand cmd(AdcCommand::SEV_FATAL, AdcCommand::ERROR_PROTOCOL_UNSUPPORTED, "Protocol unknown", AdcCommand::TYPE_DIRECT); cmd.setTo(c.getFrom()); cmd.addParam("PR", protocol); + cmd.addParam("TO", token); - if(hasToken) - cmd.addParam("TO", token); - send(cmd); return; } Modified: dcplusplus/trunk/dcpp/ConnectionManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/ConnectionManager.cpp 2007-12-12 19:28:12 UTC (rev 936) +++ dcplusplus/trunk/dcpp/ConnectionManager.cpp 2007-12-13 20:15:27 UTC (rev 937) @@ -634,9 +634,10 @@ ConnectionQueueItem::Iter i = find(downloads.begin(), downloads.end(), aSource->getUser()); if(i != downloads.end()) { - // Last compare for compatibility with pre-0.700 const string& to = (*i)->getToken(); - if(to == token || (to.size() > 2 && to.compare(0, 2, "TO") == 0 && to.compare(2, to.size() - 2, token) == 0)) { + + // 0.698 would send an empty token in some cases...remove this bugfix at some point + if(to == token || token.empty()) { down = true; } } Modified: dcplusplus/trunk/dcpp/Download.cpp =================================================================== --- dcplusplus/trunk/dcpp/Download.cpp 2007-12-12 19:28:12 UTC (rev 936) +++ dcplusplus/trunk/dcpp/Download.cpp 2007-12-13 20:15:27 UTC (rev 937) @@ -85,7 +85,6 @@ Download::~Download() { getUserConnection().setDownload(0); - delete file; } AdcCommand Download::getCommand(bool zlib) { Modified: dcplusplus/trunk/dcpp/DownloadManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/DownloadManager.cpp 2007-12-12 19:28:12 UTC (rev 936) +++ dcplusplus/trunk/dcpp/DownloadManager.cpp 2007-12-13 20:15:27 UTC (rev 937) @@ -489,10 +489,6 @@ } catch(const Exception&) { } } - - if(d->isSet(Download::FLAG_ANTI_FRAG)) { - d->unsetFlag(Download::FLAG_ANTI_FRAG); - } } { Modified: dcplusplus/trunk/dcpp/QueueManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/QueueManager.cpp 2007-12-12 19:28:12 UTC (rev 936) +++ dcplusplus/trunk/dcpp/QueueManager.cpp 2007-12-13 20:15:27 UTC (rev 937) @@ -797,6 +797,9 @@ { Lock l(cs); + delete aDownload->getFile(); + aDownload->setFile(0); + if(aDownload->getType() == Transfer::TYPE_PARTIAL_LIST) { pair<PfsIter, PfsIter> range = pfsQueue.equal_range(aDownload->getUser()->getCID()); PfsIter i = find_if(range.first, range.second, CompareSecond<CID, string>(aDownload->getPath())); @@ -849,9 +852,6 @@ } if(aDownload->getType() != Transfer::TYPE_FILE || q->isFinished()) { - // Delete file here to ensure that move works - delete aDownload->getFile(); - aDownload->setFile(0); // Check if we're anti-fragging... if(aDownload->isSet(Download::FLAG_ANTI_FRAG)) { Modified: dcplusplus/trunk/dcpp/UserConnection.cpp =================================================================== --- dcplusplus/trunk/dcpp/UserConnection.cpp 2007-12-12 19:28:12 UTC (rev 936) +++ dcplusplus/trunk/dcpp/UserConnection.cpp 2007-12-13 20:15:27 UTC (rev 937) @@ -150,12 +150,7 @@ AdcCommand c(AdcCommand::CMD_INF); c.addParam("ID", ClientManager::getInstance()->getMyCID().toBase32()); if(withToken) { - if(getToken().compare(0, 2, "TO") == 0) { - // Compatibility with pre-0.700 - c.addParam(getToken()); - } else { - c.addParam("TO", getToken()); - } + c.addParam("TO", getToken()); } send(c); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-13 22:28:48
|
Revision: 939 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=939&view=rev Author: arnetheduck Date: 2007-12-13 14:28:47 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Remove some cruft Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/MainWindow.h dcplusplus/trunk/win32/WaitingUsersFrame.cpp dcplusplus/trunk/win32/WaitingUsersFrame.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-13 20:32:16 UTC (rev 938) +++ dcplusplus/trunk/changelog.txt 2007-12-13 22:28:47 UTC (rev 939) @@ -29,6 +29,7 @@ * Fixed state checks for uploads (an invalid sequence could possibly crash client from remote) * Page up/down in private chat scrolls chat log just as in hub chat * Fixed crash on right-click in the download queue (poy) +* Readded waiting users frame keyboard shortcut -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2007-12-13 20:32:16 UTC (rev 938) +++ dcplusplus/trunk/win32/HubFrame.cpp 2007-12-13 22:28:47 UTC (rev 939) @@ -1198,17 +1198,6 @@ layout(); } -#ifdef PORT_ME - -LRESULT HubFrame::OnForwardMsg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/) { - LPMSG pMsg = (LPMSG)lParam; - if((pMsg->message >= WM_MOUSEFIRST) && (pMsg->message <= WM_MOUSELAST)) - ctrlLastLines.RelayEvent(pMsg); - return 0; -} - -#endif - void HubFrame::handleCopyNick() { int i=-1; string nicks; @@ -1234,64 +1223,6 @@ } } -#ifdef PORT_ME -static const COLORREF RED = RGB(255, 0, 0); -static const COLORREF GREEN = RGB(0, 255, 0); - -LRESULT HubFrame::onLButton(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { - HWND focus = GetFocus(); - bHandled = false; - if(focus == ctrlClient.m_hWnd) { - POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; - tstring x; - tstring::size_type start = (tstring::size_type)WinUtil::textUnderCursor(pt, ctrlClient, x); - tstring::size_type end = x.find(_T(" "), start); - - if(end == tstring::npos) - end = x.length(); - - bHandled = WinUtil::parseDBLClick(x, start, end); - if (!bHandled) { - string::size_type end = x.find_first_of(_T(" >\t"), start+1); - - if(end == tstring::npos) // get EOL as well - end = x.length(); - else if(end == start + 1) - return 0; - - // Nickname click, let's see if we can find one like it in the name list... - tstring nick = x.substr(start, end - start); - UserInfo* ui = findUser(nick); - if(ui) { - bHandled = true; - if (wParam & MK_CONTROL) { // MK_CONTROL = 0x0008 - PrivateFrame::openWindow(ui->user); - } else if (wParam & MK_SHIFT) { - try { - QueueManager::getInstance()->addList(ui->user, QueueItem::FLAG_CLIENT_VIEW); - } catch(const Exception& e) { - addClientLine(Text::toT(e.getError())); - } - } else if(showUsers->getChecked()) { - int items = ctrlUsers.GetItemCount(); - int pos = -1; - ctrlUsers.SetRedraw(FALSE); - for(int i = 0; i < items; ++i) { - if(ctrlUsers.getData(i) == ui) - pos = i; - ctrlUsers.SetItemState(i, (i == pos) ? LVIS_SELECTED | LVIS_FOCUSED : 0, LVIS_SELECTED | LVIS_FOCUSED); - } - ctrlUsers.SetRedraw(TRUE); - ctrlUsers.EnsureVisible(pos, FALSE); - } - } - } - } - return 0; -} - -#endif - void HubFrame::runUserCommand(const UserCommand& uc) { if(!WinUtil::getUCParams(this, uc, ucLineParams)) return; @@ -1448,23 +1379,6 @@ } } -#ifdef PORT_ME -LRESULT HubFrame::onGetToolTip(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { - NMTTDISPINFO* nm = (NMTTDISPINFO*)pnmh; - lastLines.clear(); - for(TStringIter i = lastLinesList.begin(); i != lastLinesList.end(); ++i) { - lastLines += *i; - lastLines += _T("\r\n"); - } - if(lastLines.size() > 2) { - lastLines.erase(lastLines.size() - 2); - } - nm->lpszText = const_cast<TCHAR*>(lastLines.c_str()); - return 0; -} - -#endif - void HubFrame::resortUsers() { for(FrameIter i = frames.begin(); i != frames.end(); ++i) (*i)->resortForFavsFirst(true); Modified: dcplusplus/trunk/win32/MainWindow.h =================================================================== --- dcplusplus/trunk/win32/MainWindow.h 2007-12-13 20:32:16 UTC (rev 938) +++ dcplusplus/trunk/win32/MainWindow.h 2007-12-13 22:28:47 UTC (rev 939) @@ -200,46 +200,6 @@ virtual void on(QueueManagerListener::Finished, QueueItem* qi, const string& dir, int64_t speed) throw(); virtual void on(PartialList, const UserPtr&, const string& text) throw(); -#ifdef PORT_ME - - virtual BOOL PreTranslateMessage(MSG* pMsg) - { - if((pMsg->message >= WM_MOUSEFIRST) && (pMsg->message <= WM_MOUSELAST)) - ctrlLastLines.RelayEvent(pMsg); - - if(CMDIFrameWindowImpl<MainFrame>::PreTranslateMessage(pMsg)) - return TRUE; - - HWND hWnd = MDIGetActive(); - if(hWnd != NULL) - return (BOOL)::SendMessage(hWnd, WM_FORWARDMSG, 0, (LPARAM)pMsg); - - return FALSE; - } - - BEGIN_MSG_MAP(MainFrame) - NOTIFY_CODE_HANDLER(TTN_GETDISPINFO, onGetToolTip) - END_MSG_MAP() - - LRESULT OnViewStatusBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); - LRESULT OnViewToolBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); - LRESULT OnViewTransferView(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); - LRESULT onCloseWindows(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); - LRESULT onServerSocket(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - - LRESULT onTrayQuit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { - PostMessage(WM_CLOSE); - return 0; - } - - LRESULT onTrayShow(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { - ShowWindow(SW_SHOW); - ShowWindow(maximized ? SW_MAXIMIZE : SW_RESTORE); - return 0; - } - -#endif - }; #endif // !defined(MAIN_FRM_H) Modified: dcplusplus/trunk/win32/WaitingUsersFrame.cpp =================================================================== --- dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2007-12-13 20:32:16 UTC (rev 938) +++ dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2007-12-13 22:28:47 UTC (rev 939) @@ -40,6 +40,7 @@ addWidget(queued); queued->setColor(WinUtil::textColor, WinUtil::bgColor); queued->onContextMenu(std::tr1::bind(&WaitingUsersFrame::handleContextMenu, this, _1)); + queued->onChar(std::tr1::bind(&WaitingUsersFrame::handleChar, this, _1)); } initStatus(); @@ -190,24 +191,15 @@ speak(SPEAK_ADD_FILE, (LPARAM)new pair<UserPtr, string>(aUser, aFilename)); } -#ifdef PORT_ME - // Keyboard shortcuts -LRESULT WaitingUsersFrame::onChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled) -{ - switch(wParam) - { - case VK_DELETE: +bool WaitingUsersFrame::onChar(int c) { + if(c == VK_DELETE) { onRemove(0, 0, 0, bHandled); - break; - default: - bHandled = FALSE; + return true; } - return 0; + return false; } -#endif - void WaitingUsersFrame::onRemoveUser(const UserPtr& aUser) { HTREEITEM userNode = queued->getRoot(); Modified: dcplusplus/trunk/win32/WaitingUsersFrame.h =================================================================== --- dcplusplus/trunk/win32/WaitingUsersFrame.h 2007-12-13 20:32:16 UTC (rev 938) +++ dcplusplus/trunk/win32/WaitingUsersFrame.h 2007-12-13 22:28:47 UTC (rev 939) @@ -58,7 +58,7 @@ void onRemove(); bool handleContextMenu(SmartWin::ScreenCoordinate pt); HRESULT handleSpeaker(WPARAM wParam, LPARAM lParam); - //LRESULT onChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled); + bool handleChar(int c); void onPrivateMessage(); void onGrantSlot(); void onAddToFavorites(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-14 10:37:28
|
Revision: 940 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=940&view=rev Author: arnetheduck Date: 2007-12-14 02:37:24 -0800 (Fri, 14 Dec 2007) Log Message: ----------- compile fix, some qui flags used Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/AdcHub.cpp dcplusplus/trunk/win32/WaitingUsersFrame.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-13 22:28:47 UTC (rev 939) +++ dcplusplus/trunk/changelog.txt 2007-12-14 10:37:24 UTC (rev 940) @@ -30,6 +30,7 @@ * Page up/down in private chat scrolls chat log just as in hub chat * Fixed crash on right-click in the download queue (poy) * Readded waiting users frame keyboard shortcut +* Handle some QUI flags (thanks pret/poy) -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/dcpp/AdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.cpp 2007-12-13 22:28:47 UTC (rev 939) +++ dcplusplus/trunk/dcpp/AdcHub.cpp 2007-12-14 10:37:24 UTC (rev 940) @@ -263,12 +263,26 @@ void AdcHub::handle(AdcCommand::QUI, AdcCommand& c) throw() { uint32_t s = AdcCommand::toSID(c.getParam(0)); - putUser(s); - - // No use to hammer if we're banned - if(s == sid && c.hasFlag("TL", 1)) { - setAutoReconnect(false); + putUser(s); // @todo: use the DI flag + + string tmp; + if(c.getParam("MS", 1, tmp)) { + fire(ClientListener::StatusMessage(), this, tmp); } + + if(s == sid) { + if(c.getParam("TL", 1, tmp)) { + if(tmp == "-1") { + setAutoReconnect(false); + } else { + setAutoReconnect(true); + setReconnDelay(Util::toUInt32(tmp)); + } + } + if(c.getParam("RD", 1, tmp)) { + fire(ClientListener::Redirect(), this, tmp); + } + } } void AdcHub::handle(AdcCommand::CTM, AdcCommand& c) throw() { Modified: dcplusplus/trunk/win32/WaitingUsersFrame.cpp =================================================================== --- dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2007-12-13 22:28:47 UTC (rev 939) +++ dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2007-12-14 10:37:24 UTC (rev 940) @@ -192,9 +192,9 @@ } // Keyboard shortcuts -bool WaitingUsersFrame::onChar(int c) { +bool WaitingUsersFrame::handleChar(int c) { if(c == VK_DELETE) { - onRemove(0, 0, 0, bHandled); + onRemove(); return true; } return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pie...@us...> - 2007-12-14 16:38:39
|
Revision: 942 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=942&view=rev Author: pietricica Date: 2007-12-14 08:38:27 -0800 (Fri, 14 Dec 2007) Log Message: ----------- edited changelog release date and installer file Modified Paths: -------------- dcplusplus/trunk/DCPlusPlus.nsi dcplusplus/trunk/changelog.txt Modified: dcplusplus/trunk/DCPlusPlus.nsi =================================================================== --- dcplusplus/trunk/DCPlusPlus.nsi 2007-12-14 14:07:34 UTC (rev 941) +++ dcplusplus/trunk/DCPlusPlus.nsi 2007-12-14 16:38:27 UTC (rev 942) @@ -116,13 +116,11 @@ ; remove files Delete "$INSTDIR\DCPlusPlus.exe" Delete "$INSTDIR\DCPlusPlus.chm" - Delete "$INSTDIR\dbghelp.dll" - Delete "$INSTDIR\DCPlusPlus.pdb" + Delete "$INSTDIR\dcppboot.xml" Delete "$INSTDIR\License-GeoIP.txt" Delete "$INSTDIR\License.txt" Delete "$INSTDIR\ChangeLog.txt" - Delete "$INSTDIR\unicows.dll" - Delete "$INSTDIR\unicows.pdb" + Delete "$INSTDIR\LICENSE-OpenSSL.tx" Delete "$INSTDIR\Example.xml" Delete "$INSTDIR\Magnet.exe" Delete "$INSTDIR\GeoIPCountryWhois.csv" Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-14 14:07:34 UTC (rev 941) +++ dcplusplus/trunk/changelog.txt 2007-12-14 16:38:27 UTC (rev 942) @@ -1,4 +1,4 @@ --- 0.704 -- +-- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) * Use system header arrows on common controls 6+ (thanks poy) * Fixed badly drawn arrows (thanks poy) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-14 19:50:38
|
Revision: 944 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=944&view=rev Author: arnetheduck Date: 2007-12-14 11:50:32 -0800 (Fri, 14 Dec 2007) Log Message: ----------- linuxdc++ patches Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/HashManager.cpp dcplusplus/trunk/dcpp/SettingsManager.cpp dcplusplus/trunk/dcpp/SettingsManager.h dcplusplus/trunk/dcpp/ShareManager.cpp dcplusplus/trunk/dcpp/Text.cpp dcplusplus/trunk/dcpp/Util.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-14 16:40:43 UTC (rev 943) +++ dcplusplus/trunk/changelog.txt 2007-12-14 19:50:32 UTC (rev 944) @@ -1,4 +1,7 @@ --- 0.704 2007-12-14 -- +-- 0.705 -- +* Several patches for better *nix compatibility of the core (thanks steven sheehy et al) + +-- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) * Use system header arrows on common controls 6+ (thanks poy) * Fixed badly drawn arrows (thanks poy) Modified: dcplusplus/trunk/dcpp/HashManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/HashManager.cpp 2007-12-14 16:40:43 UTC (rev 943) +++ dcplusplus/trunk/dcpp/HashManager.cpp 2007-12-14 19:50:32 UTC (rev 944) @@ -601,7 +601,7 @@ static const int64_t BUF_SIZE = 0x1000000 - (0x1000000 % getpagesize()); -bool HashManager::Hasher::fastHash(const string& filename, u_int8_t* , TigerTree& tth, int64_t size, CRC32Filter* xcrc32) { +bool HashManager::Hasher::fastHash(const string& filename, uint8_t* , TigerTree& tth, int64_t size, CRC32Filter* xcrc32) { int fd = open(Text::fromUtf8(filename).c_str(), O_RDONLY); if(fd == -1) return false; @@ -611,7 +611,7 @@ int64_t size_read = 0; void *buf = 0; - u_int32_t lastRead = GET_TICK(); + uint32_t lastRead = GET_TICK(); while(pos <= size) { if(size_left > 0) { size_read = std::min(size_left, BUF_SIZE); @@ -624,10 +624,10 @@ madvise(buf, size_read, MADV_SEQUENTIAL | MADV_WILLNEED); if(SETTING(MAX_HASH_SPEED) > 0) { - u_int32_t now = GET_TICK(); - u_int32_t minTime = size_read * 1000LL / (SETTING(MAX_HASH_SPEED) * 1024LL * 1024LL); + uint32_t now = GET_TICK(); + uint32_t minTime = size_read * 1000LL / (SETTING(MAX_HASH_SPEED) * 1024LL * 1024LL); if(lastRead + minTime > now) { - u_int32_t diff = now - lastRead; + uint32_t diff = now - lastRead; Thread::sleep(minTime - diff); } lastRead = lastRead + minTime; @@ -643,7 +643,7 @@ (*xcrc32)(buf, size_read); { Lock l(cs); - currentSize = max(static_cast<u_int64_t>(currentSize - size_read), static_cast<u_int64_t>(0)); + currentSize = max(static_cast<uint64_t>(currentSize - size_read), static_cast<uint64_t>(0)); } if(size_left <= 0) { Modified: dcplusplus/trunk/dcpp/SettingsManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/SettingsManager.cpp 2007-12-14 16:40:43 UTC (rev 943) +++ dcplusplus/trunk/dcpp/SettingsManager.cpp 2007-12-14 19:50:32 UTC (rev 944) @@ -76,7 +76,7 @@ "OpenWaitingUsers", "BoldWaitingUsers", "OpenSystemLog", "BoldSystemLog", "AutoRefreshTime", "UseTLS", "AutoSearchLimit", "AltSortOrder", "AutoKickNoFavs", "PromptPassword", "SpyFrameIgnoreTthSearches", "DontDlAlreadyQueued", "MaxCommandLength", "AllowUntrustedHubs", "AllowUntrustedClients", - "TLSPort", "FastHash", "SortFavUsersFirst", "ShowShellMenu", "MinSegmentSize", + "TLSPort", "FastHash", "SortFavUsersFirst", "ShowShellMenu", "MinSegmentSize", "FollowLinks", "SENTRY", // Int64 "TotalUpload", "TotalDownload", @@ -270,6 +270,7 @@ setDefault(SORT_FAVUSERS_FIRST, false); setDefault(SHOW_SHELL_MENU, false); setDefault(MIN_SEGMENT_SIZE, 1024); + setDefault(FOLLOW_LINKS, false); #ifdef _WIN32 setDefault(MAIN_WINDOW_STATE, SW_SHOWNORMAL); Modified: dcplusplus/trunk/dcpp/SettingsManager.h =================================================================== --- dcplusplus/trunk/dcpp/SettingsManager.h 2007-12-14 16:40:43 UTC (rev 943) +++ dcplusplus/trunk/dcpp/SettingsManager.h 2007-12-14 19:50:32 UTC (rev 944) @@ -88,7 +88,7 @@ OPEN_WAITING_USERS, BOLD_WAITING_USERS, OPEN_SYSTEM_LOG, BOLD_SYSTEM_LOG, AUTO_REFRESH_TIME, USE_TLS, AUTO_SEARCH_LIMIT, ALT_SORT_ORDER, AUTO_KICK_NO_FAVS, PROMPT_PASSWORD, SPY_FRAME_IGNORE_TTH_SEARCHES, DONT_DL_ALREADY_QUEUED, MAX_COMMAND_LENGTH, ALLOW_UNTRUSTED_HUBS, ALLOW_UNTRUSTED_CLIENTS, - TLS_PORT, FAST_HASH, SORT_FAVUSERS_FIRST, SHOW_SHELL_MENU, MIN_SEGMENT_SIZE, + TLS_PORT, FAST_HASH, SORT_FAVUSERS_FIRST, SHOW_SHELL_MENU, MIN_SEGMENT_SIZE, FOLLOW_LINKS, INT_LAST }; enum Int64Setting { INT64_FIRST = INT_LAST + 1, Modified: dcplusplus/trunk/dcpp/ShareManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/ShareManager.cpp 2007-12-14 16:40:43 UTC (rev 943) +++ dcplusplus/trunk/dcpp/ShareManager.cpp 2007-12-14 19:50:32 UTC (rev 944) @@ -552,6 +552,10 @@ return ((dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) || (cFileName[0] == L'.')); } + bool isLink() { + return false; + } + int64_t getSize() { return (int64_t)nFileSizeLow | ((int64_t)nFileSizeHigh)<<32; } @@ -621,6 +625,12 @@ if (!ent) return false; return ent->d_name[0] == '.'; } + bool isLink() { + struct stat inode; + if (!ent) return false; + if (lstat((base + PATH_SEPARATOR + ent->d_name).c_str(), &inode) == -1) return false; + return S_ISLNK(inode.st_mode); + } int64_t getSize() { struct stat inode; if (!ent) return false; @@ -669,8 +679,10 @@ if(name == "." || name == "..") continue; - if(!BOOLSETTING(SHARE_HIDDEN) && i->isHidden() ) + if(!BOOLSETTING(SHARE_HIDDEN) && i->isHidden()) continue; + if(!BOOLSETTING(FOLLOW_LINKS) && i->isLink()) + continue; if(i->isDirectory()) { string newName = aName + name + PATH_SEPARATOR; Modified: dcplusplus/trunk/dcpp/Text.cpp =================================================================== --- dcplusplus/trunk/dcpp/Text.cpp 2007-12-14 16:40:43 UTC (rev 943) +++ dcplusplus/trunk/dcpp/Text.cpp 2007-12-14 19:50:32 UTC (rev 944) @@ -307,11 +307,15 @@ } const string& toUtf8(const string& str, const string& fromCharset, string& tmp) throw() { - if(str.empty() || fromCharset == utf8 || toLower(fromCharset, tmp) == utf8) { + if(str.empty()) { return str; } - + #ifdef _WIN32 + if (fromCharset == utf8 || toLower(fromCharset, tmp) == utf8) { + return str; + } + return acpToUtf8(str, tmp); #else return convert(str, tmp, fromCharset, utf8); @@ -319,11 +323,15 @@ } const string& fromUtf8(const string& str, const string& toCharset, string& tmp) throw() { - if(str.empty() || toCharset == utf8 || toLower(toCharset, tmp) == utf8) { + if(str.empty()) { return str; } - + #ifdef _WIN32 + if (toCharset == utf8 || toLower(toCharset, tmp) == utf8) { + return str; + } + return utf8ToAcp(str, tmp); #else return convert(str, tmp, utf8, toCharset); @@ -331,10 +339,12 @@ } const string& convert(const string& str, string& tmp, const string& fromCharset, const string& toCharset) throw() { - if(str.empty() || Util::stricmp(fromCharset, toCharset) == 0) + if(str.empty()) return str; #ifdef _WIN32 + if (Util::stricmp(fromCharset, toCharset) == 0) + return str; if(toCharset == utf8 || toLower(toCharset, tmp) == utf8) return acpToUtf8(str, tmp); if(fromCharset == utf8 || toLower(fromCharset, tmp) == utf8) Modified: dcplusplus/trunk/dcpp/Util.h =================================================================== --- dcplusplus/trunk/dcpp/Util.h 2007-12-14 16:40:43 UTC (rev 943) +++ dcplusplus/trunk/dcpp/Util.h 2007-12-14 19:50:32 UTC (rev 944) @@ -207,7 +207,7 @@ #ifdef _WIN32 return _atoi64(aString.c_str()); #else - return atoll(aString.c_str()); + return strtoll(aString.c_str(), (char **)NULL, 10); #endif } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-17 23:14:50
|
Revision: 946 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=946&view=rev Author: arnetheduck Date: 2007-12-17 15:14:47 -0800 (Mon, 17 Dec 2007) Log Message: ----------- Patches, initial hub-side bloom filter support Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/dcpp/AdcHub.cpp dcplusplus/trunk/dcpp/AdcHub.h dcplusplus/trunk/dcpp/BitOutputStream.h dcplusplus/trunk/dcpp/BloomFilter.h dcplusplus/trunk/dcpp/BufferedSocket.cpp dcplusplus/trunk/dcpp/BufferedSocket.h dcplusplus/trunk/dcpp/CID.h dcplusplus/trunk/dcpp/ClientManager.cpp dcplusplus/trunk/dcpp/ClientManager.h dcplusplus/trunk/dcpp/DCPlusPlus.h dcplusplus/trunk/dcpp/DirectoryListing.h dcplusplus/trunk/dcpp/FavoriteManager.h dcplusplus/trunk/dcpp/File.h dcplusplus/trunk/dcpp/HashManager.h dcplusplus/trunk/dcpp/HashValue.h dcplusplus/trunk/dcpp/MerkleTree.h dcplusplus/trunk/dcpp/NmdcHub.cpp dcplusplus/trunk/dcpp/QueueManager.cpp dcplusplus/trunk/dcpp/QueueManager.h dcplusplus/trunk/dcpp/SettingsManager.cpp dcplusplus/trunk/dcpp/SettingsManager.h dcplusplus/trunk/dcpp/ShareManager.cpp dcplusplus/trunk/dcpp/ShareManager.h dcplusplus/trunk/dcpp/Socket.cpp dcplusplus/trunk/win32/AboutDlg.cpp Added Paths: ----------- dcplusplus/trunk/dcpp/HashBloom.cpp dcplusplus/trunk/dcpp/HashBloom.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/changelog.txt 2007-12-17 23:14:47 UTC (rev 946) @@ -1,5 +1,7 @@ -- 0.705 -- * Several patches for better *nix compatibility of the core (thanks steven sheehy et al) +* Improve segmented download file sharing +* Fix search request ip when using multiple ip's (thanks stanislav maslovski) -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) Modified: dcplusplus/trunk/dcpp/AdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.cpp 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/AdcHub.cpp 2007-12-17 23:14:47 UTC (rev 946) @@ -44,6 +44,7 @@ const string AdcHub::BAS0_SUPPORT("ADBAS0"); const string AdcHub::TIGR_SUPPORT("ADTIGR"); const string AdcHub::UCM0_SUPPORT("ADUCM0"); +const string AdcHub::BLO0_SUPPORT("ADBLO0"); AdcHub::AdcHub(const string& aHubURL, bool secure) : Client(aHubURL, '\n', secure), oldPassword(false), sid(0) { TimerManager::getInstance()->addListener(this); @@ -476,6 +477,31 @@ SearchManager::getInstance()->onRES(c, ou->getUser()); } +void AdcHub::handle(AdcCommand::GET, AdcCommand& c) throw() { + if(c.getParameters().size() < 5) { + dcdebug("Get with few parameters"); + // TODO return STA? + return; + } + const string& type = c.getParam(0); + string tmp; + if(type == "blom" && c.getParam("BK", 4, tmp)) { + ByteVector v; + size_t m = Util::toUInt32(c.getParam(3)) * 8; + size_t k = Util::toUInt32(tmp); + + ShareManager::getInstance()->getBloom(v, k, m); + AdcCommand cmd(AdcCommand::CMD_SND, AdcCommand::TYPE_HUB); + cmd.addParam(c.getParam(0)); + cmd.addParam(c.getParam(1)); + cmd.addParam(c.getParam(2)); + cmd.addParam(c.getParam(3)); + cmd.addParam(c.getParam(4)); + send(cmd); + send((char*)&v[0], v.size()); + } +} + void AdcHub::connect(const OnlineUser& user, const string& token) { connect(user, token, CryptoManager::getInstance()->TLSOk() && user.getUser()->isSet(User::TLS)); } @@ -699,6 +725,9 @@ if(BOOLSETTING(HUB_USER_COMMANDS)) { cmd.addParam(UCM0_SUPPORT); } + if(BOOLSETTING(SEND_BLOOM)) { + cmd.addParam(BLO0_SUPPORT); + } send(cmd); } Modified: dcplusplus/trunk/dcpp/AdcHub.h =================================================================== --- dcplusplus/trunk/dcpp/AdcHub.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/AdcHub.h 2007-12-17 23:14:47 UTC (rev 946) @@ -83,7 +83,8 @@ static const string BAS0_SUPPORT; static const string TIGR_SUPPORT; static const string UCM0_SUPPORT; - + static const string BLO0_SUPPORT; + virtual string checkNick(const string& nick); OnlineUser& getUser(const uint32_t aSID, const CID& aCID); @@ -105,6 +106,7 @@ void handle(AdcCommand::SCH, AdcCommand& c) throw(); void handle(AdcCommand::CMD, AdcCommand& c) throw(); void handle(AdcCommand::RES, AdcCommand& c) throw(); + void handle(AdcCommand::GET, AdcCommand& c) throw(); template<typename T> void handle(T, AdcCommand&) { } Modified: dcplusplus/trunk/dcpp/BitOutputStream.h =================================================================== --- dcplusplus/trunk/dcpp/BitOutputStream.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/BitOutputStream.h 2007-12-17 23:14:47 UTC (rev 946) @@ -27,8 +27,8 @@ BitOutputStream(string& aStream) : is(aStream), bitPos(0), next(0) { } ~BitOutputStream() { } - void put(vector<uint8_t>& b) { - for(vector<uint8_t>::iterator i = b.begin(); i != b.end(); ++i) { + void put(const ByteVector& b) { + for(ByteVector::const_iterator i = b.begin(); i != b.end(); ++i) { next |= (*i) << bitPos++; if(bitPos > 7) { Modified: dcplusplus/trunk/dcpp/BloomFilter.h =================================================================== --- dcplusplus/trunk/dcpp/BloomFilter.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/BloomFilter.h 2007-12-17 23:14:47 UTC (rev 946) @@ -23,13 +23,7 @@ namespace dcpp { -struct CRC32Hash { - size_t operator()(const void* buf, size_t len) { f(buf, len); return f.getValue(); } -private: - CRC32Filter f; -}; - -template<size_t N, class HashFunc = CRC32Hash> +template<size_t N> class BloomFilter { public: BloomFilter(size_t tableSize) { table.resize(tableSize); } @@ -79,10 +73,15 @@ } } - /* Same functionality, but the old one did not want to compile for some reason. */ + /* This is roughly how boost::hash does it */ size_t getPos(const string& s, size_t i, size_t l) const { - HashFunc hf; - return (hf(&s[i], l) % table.size()); + size_t h = 0; + const char* c = s.data() + i; + const char* end = s.data() + l; + for(; c < end; ++c) { + h ^= *c + 0x9e3779b9 + (h<<6) + (h>>2); + } + return (h % table.size()); } vector<bool> table; Modified: dcplusplus/trunk/dcpp/BufferedSocket.cpp =================================================================== --- dcplusplus/trunk/dcpp/BufferedSocket.cpp 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/BufferedSocket.cpp 2007-12-17 23:14:47 UTC (rev 946) @@ -273,8 +273,8 @@ size_t sockSize = (size_t)sock->getSocketOptInt(SO_SNDBUF); size_t bufSize = max(sockSize, (size_t)64*1024); - vector<uint8_t> readBuf(bufSize); - vector<uint8_t> writeBuf(bufSize); + ByteVector readBuf(bufSize); + ByteVector writeBuf(bufSize); size_t readPos = 0; Modified: dcplusplus/trunk/dcpp/BufferedSocket.h =================================================================== --- dcplusplus/trunk/dcpp/BufferedSocket.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/BufferedSocket.h 2007-12-17 23:14:47 UTC (rev 946) @@ -130,9 +130,9 @@ size_t rollback; bool failed; string line; - vector<uint8_t> inbuf; - vector<uint8_t> writeBuf; - vector<uint8_t> sendBuf; + ByteVector inbuf; + ByteVector writeBuf; + ByteVector sendBuf; Socket* sock; bool disconnecting; Modified: dcplusplus/trunk/dcpp/CID.h =================================================================== --- dcplusplus/trunk/dcpp/CID.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/CID.h 2007-12-17 23:14:47 UTC (rev 946) @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if !defined(CID_H) -#define CID_H +#ifndef DCPLUSPLUS_DCPP_CID_H +#define DCPLUSPLUS_DCPP_CID_H #include "Encoder.h" #include "Util.h" @@ -28,9 +28,6 @@ public: enum { SIZE = 192 / 8 }; - struct Hash { - size_t operator()(const CID& c) const { return c.toHash(); } - }; CID() { memset(cid, 0, sizeof(cid)); } explicit CID(const uint8_t* data) { memcpy(cid, data, sizeof(cid)); } explicit CID(const string& base32) { Encoder::fromBase32(base32.c_str(), cid, sizeof(cid)); } @@ -60,4 +57,14 @@ } // namespace dcpp +namespace std { namespace tr1 { +template<> +struct hash<dcpp::CID> { + size_t operator()(const dcpp::CID& rhs) const { + return *reinterpret_cast<const size_t*>(rhs.data()); + } +}; +} +} + #endif // !defined(CID_H) Modified: dcplusplus/trunk/dcpp/ClientManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/ClientManager.cpp 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/ClientManager.cpp 2007-12-17 23:14:47 UTC (rev 946) @@ -409,8 +409,6 @@ void ClientManager::search(int aSizeMode, int64_t aSize, int aFileType, const string& aString, const string& aToken) { Lock l(cs); - updateCachedIp(); // no point in doing a resolve for every single hub we're searching on - for(Client::Iter i = clients.begin(); i != clients.end(); ++i) { if((*i)->isConnected()) { (*i)->search(aSizeMode, aSize, aFileType, aString, aToken); @@ -421,8 +419,6 @@ void ClientManager::search(StringList& who, int aSizeMode, int64_t aSize, int aFileType, const string& aString, const string& aToken) { Lock l(cs); - updateCachedIp(); // no point in doing a resolve for every single hub we're searching on - for(StringIter it = who.begin(); it != who.end(); ++it) { string& client = *it; for(Client::Iter j = clients.begin(); j != clients.end(); ++j) { @@ -493,25 +489,4 @@ } } -void ClientManager::updateCachedIp() { - // Best case - the server detected it - if((!BOOLSETTING(NO_IP_OVERRIDE) || SETTING(EXTERNAL_IP).empty())) { - for(Client::Iter i = clients.begin(); i != clients.end(); ++i) { - if(!(*i)->getMyIdentity().getIp().empty()) { - cachedIp = (*i)->getMyIdentity().getIp(); - return; - } - } - } - - if(!SETTING(EXTERNAL_IP).empty()) { - cachedIp = Socket::resolve(SETTING(EXTERNAL_IP)); - return; - } - - //if we've come this far just use the first client to get the ip. - if(clients.size() > 0) - cachedIp = (*clients.begin())->getLocalIp(); -} - } // namespace dcpp Modified: dcplusplus/trunk/dcpp/ClientManager.h =================================================================== --- dcplusplus/trunk/dcpp/ClientManager.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/ClientManager.h 2007-12-17 23:14:47 UTC (rev 946) @@ -91,8 +91,6 @@ Client::List& getClients() { return clients; } - string getCachedIp() const { Lock l(cs); return cachedIp; } - CID getMyCID(); const CID& getMyPID(); @@ -100,10 +98,10 @@ typedef unordered_map<string, UserPtr> LegacyMap; typedef LegacyMap::iterator LegacyIter; - typedef unordered_map<CID, UserPtr, CID::Hash> UserMap; + typedef unordered_map<CID, UserPtr> UserMap; typedef UserMap::iterator UserIter; - typedef unordered_multimap<CID, OnlineUser*, CID::Hash> OnlineMap; + typedef unordered_multimap<CID, OnlineUser*> OnlineMap; typedef OnlineMap::iterator OnlineIter; typedef OnlineMap::const_iterator OnlineIterC; typedef pair<OnlineIter, OnlineIter> OnlinePair; @@ -119,7 +117,6 @@ Socket udp; - string cachedIp; CID pid; friend class Singleton<ClientManager>; @@ -132,8 +129,6 @@ TimerManager::getInstance()->removeListener(this); } - void updateCachedIp(); - // ClientListener virtual void on(Connected, Client* c) throw() { fire(ClientManagerListener::ClientConnected(), c); } virtual void on(UserUpdated, Client*, const OnlineUser& user) throw() { fire(ClientManagerListener::UserUpdated(), user); } Modified: dcplusplus/trunk/dcpp/DCPlusPlus.h =================================================================== --- dcplusplus/trunk/dcpp/DCPlusPlus.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/DCPlusPlus.h 2007-12-17 23:14:47 UTC (rev 946) @@ -97,6 +97,8 @@ typedef vector<WStringPair> WStringPairList; typedef WStringPairList::iterator WStringPairIter; +typedef vector<uint8_t> ByteVector; + #if defined(_MSC_VER) || defined(__MINGW32__) #define _LL(x) x##ll #define _ULL(x) x##ull Modified: dcplusplus/trunk/dcpp/DirectoryListing.h =================================================================== --- dcplusplus/trunk/dcpp/DirectoryListing.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/DirectoryListing.h 2007-12-17 23:14:47 UTC (rev 946) @@ -80,7 +80,7 @@ typedef vector<Ptr> List; typedef List::iterator Iter; - typedef unordered_set<TTHValue, TTHValue::Hash> TTHSet; + typedef unordered_set<TTHValue> TTHSet; List directories; File::List files; Modified: dcplusplus/trunk/dcpp/FavoriteManager.h =================================================================== --- dcplusplus/trunk/dcpp/FavoriteManager.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/FavoriteManager.h 2007-12-17 23:14:47 UTC (rev 946) @@ -59,7 +59,7 @@ bool isDownloading() { return (useHttp && running); } // Favorite Users - typedef unordered_map<CID, FavoriteUser, CID::Hash> FavoriteMap; + typedef unordered_map<CID, FavoriteUser> FavoriteMap; FavoriteMap getFavoriteUsers() { Lock l(cs); return users; } void addFavoriteUser(UserPtr& aUser); Modified: dcplusplus/trunk/dcpp/File.h =================================================================== --- dcplusplus/trunk/dcpp/File.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/File.h 2007-12-17 23:14:47 UTC (rev 946) @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if !defined(FILE_H) -#define FILE_H +#ifndef DCPLUSPLUS_DCPP_FILE_H +#define DCPLUSPLUS_DCPP_FILE_H #include "SettingsManager.h" Added: dcplusplus/trunk/dcpp/HashBloom.cpp =================================================================== --- dcplusplus/trunk/dcpp/HashBloom.cpp (rev 0) +++ dcplusplus/trunk/dcpp/HashBloom.cpp 2007-12-17 23:14:47 UTC (rev 946) @@ -0,0 +1,68 @@ +#include "stdinc.h" +#include "DCPlusPlus.h" + +#include "HashBloom.h" + +namespace dcpp { + +size_t HashBloom::get_k(size_t n) { + const size_t bits = TTHValue::SIZE * 8; + for(size_t k = static_cast<size_t>(sqrt(bits)); k > 1; --k) { + // We only want the k's where the bits will end up on a byte boundary to ease hash implementation + if((bits % k) == 0 && (bits / k) % 8 == 0) { + uint64_t m = get_m(n, k); + if(m >> (TTHValue::SIZE * 8 / k) == 0) { + return k; + } + } + } + return 1; +} + +uint64_t HashBloom::get_m(size_t n, size_t k) { + uint64_t m = (static_cast<uint64_t>(ceil(static_cast<double>(n) * k / log(2.)))); + return ((m / 8) + 1) * 8; +} + +void HashBloom::add(const TTHValue& tth) { + for(size_t i = 0; i < k; ++i) { + bloom[pos(tth, i)] = true; + } +} + +bool HashBloom::match(const TTHValue& tth) const { + if(bloom.empty()) { + return true; + } + for(size_t i = 0; i < k; ++i) { + if(!bloom[pos(tth, i)]) { + return false; + } + } + return true; +} + +void HashBloom::push_back(bool v) { + bloom.push_back(v); +} + +void HashBloom::reset(size_t k_, size_t m) { + bloom.resize(m); + k = k_; +} + +size_t HashBloom::pos(const TTHValue& tth, size_t n) const { + return (*(size_t*)(tth.data + (TTHValue::SIZE / k) * n )) % bloom.size(); +} + +void HashBloom::copy_to(ByteVector& v) const { + size_t ones = 0; + v.resize(bloom.size() / 8); + for(size_t i = 0; i < bloom.size(); ++i) { + ones += bloom[i]; + v[i/8] |= bloom[i] << i % 8; + } + dcdebug("Bloom fill: %u/%u = %lf\n", ones, bloom.size(), static_cast<double>(ones)/bloom.size()); +} + +} Added: dcplusplus/trunk/dcpp/HashBloom.h =================================================================== --- dcplusplus/trunk/dcpp/HashBloom.h (rev 0) +++ dcplusplus/trunk/dcpp/HashBloom.h 2007-12-17 23:14:47 UTC (rev 946) @@ -0,0 +1,40 @@ +#ifndef HASHBLOOM_H_ +#define HASHBLOOM_H_ + +#include "MerkleTree.h" + +namespace dcpp { +/** + * According to http://www.eecs.harvard.edu/~michaelm/NEWWORK/postscripts/BloomFilterSurvey.pdf + * the optimal number of hashes k is (m/n)*ln(2), m = number of bits in the filter and n = number + * of items added. The largest k that we can get from a single TTH value depends on the number of + * bits we need to address the bloom structure, which in turn depends on m, so the optimal size + * for our filter is m = n * k / ln(2) where n is the number of TTH values, or in our case, number of + * files in share since each file is identified by one TTH value. We try that for each even dividend + * of the key size (2, 3, 4, 6, 8, 12) and if m fits within the bits we're able to address (2^(keysize/k)), + * we can use that value when requesting the bloom filter. + */ +class HashBloom { +public: + /** Return the largest k such that get_m returns a value smaller than 2^(TTHValue::SIZE/k) */ + static size_t get_k(size_t n); + /** Optimal number of bits to allocate for n elements when using k hashes */ + static uint64_t get_m(size_t n, size_t k); + + void add(const TTHValue& tth); + bool match(const TTHValue& tth) const; + void reset(size_t k, size_t m); + void push_back(bool v); + + void copy_to(ByteVector& v) const; +private: + + size_t pos(const TTHValue& tth, size_t n) const; + + std::vector<bool> bloom; + size_t k; +}; + +} + +#endif /*HASHBLOOM_H_*/ Modified: dcplusplus/trunk/dcpp/HashManager.h =================================================================== --- dcplusplus/trunk/dcpp/HashManager.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/HashManager.h 2007-12-17 23:14:47 UTC (rev 946) @@ -178,7 +178,7 @@ typedef unordered_map<string, FileInfoList> DirMap; typedef DirMap::iterator DirIter; - typedef unordered_map<TTHValue, TreeInfo, TTHValue::Hash> TreeMap; + typedef unordered_map<TTHValue, TreeInfo> TreeMap; typedef TreeMap::iterator TreeIter; friend class HashLoader; Modified: dcplusplus/trunk/dcpp/HashValue.h =================================================================== --- dcplusplus/trunk/dcpp/HashValue.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/HashValue.h 2007-12-17 23:14:47 UTC (rev 946) @@ -16,10 +16,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if !defined(HASH_VALUE_H) -#define HASH_VALUE_H +#ifndef DCPLUSPLUS_DCPP_HASH_VALUE_H +#define DCPLUSPLUS_DCPP_HASH_VALUE_H #include "FastAlloc.h" +#include "Encoder.h" namespace dcpp { @@ -27,25 +28,30 @@ struct HashValue : FastAlloc<HashValue<Hasher> >{ static const size_t SIZE = Hasher::HASH_SIZE; - struct Hash { - size_t operator()(const HashValue& rhs) const { return *(size_t*)&rhs; } - }; - HashValue() { } explicit HashValue(uint8_t* aData) { memcpy(data, aData, SIZE); } - explicit HashValue(const string& base32) { Encoder::fromBase32(base32.c_str(), data, SIZE); } + explicit HashValue(const std::string& base32) { Encoder::fromBase32(base32.c_str(), data, SIZE); } HashValue(const HashValue& rhs) { memcpy(data, rhs.data, SIZE); } HashValue& operator=(const HashValue& rhs) { memcpy(data, rhs.data, SIZE); return *this; } bool operator!=(const HashValue& rhs) const { return !(*this == rhs); } bool operator==(const HashValue& rhs) const { return memcmp(data, rhs.data, SIZE) == 0; } bool operator<(const HashValue& rhs) const { return memcmp(data, rhs.data, SIZE) < 0; } - string toBase32() const { return Encoder::toBase32(data, SIZE); } - string& toBase32(string& tmp) const { return Encoder::toBase32(data, SIZE, tmp); } + std::string toBase32() const { return Encoder::toBase32(data, SIZE); } + std::string& toBase32(std::string& tmp) const { return Encoder::toBase32(data, SIZE, tmp); } uint8_t data[SIZE]; }; } // namespace dcpp +namespace std { namespace tr1 { +template<> +template<typename T> +struct hash<dcpp::HashValue<T> > { + size_t operator()(const dcpp::HashValue<T>& rhs) const { return *(size_t*)rhs.data; } +}; +} +} + #endif // !defined(HASH_VALUE_H) Modified: dcplusplus/trunk/dcpp/MerkleTree.h =================================================================== --- dcplusplus/trunk/dcpp/MerkleTree.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/MerkleTree.h 2007-12-17 23:14:47 UTC (rev 946) @@ -146,8 +146,8 @@ root = getHash(0, fileSize); } - vector<uint8_t> getLeafData() { - vector<uint8_t> buf(getLeaves().size() * HASH_SIZE); + ByteVector getLeafData() { + ByteVector buf(getLeaves().size() * HASH_SIZE); uint8_t* p = &buf[0]; for(size_t i = 0; i < getLeaves().size(); ++i) { memcpy(p + i * HASH_SIZE, &getLeaves()[i], HASH_SIZE); Modified: dcplusplus/trunk/dcpp/NmdcHub.cpp =================================================================== --- dcplusplus/trunk/dcpp/NmdcHub.cpp 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/NmdcHub.cpp 2007-12-17 23:14:47 UTC (rev 946) @@ -238,7 +238,7 @@ // Filter own searches if(ClientManager::getInstance()->isActive()) { - if(seeker == (ClientManager::getInstance()->getCachedIp() + ":" + Util::toString(SearchManager::getInstance()->getPort()))) { + if(seeker == (getLocalIp() + ":" + Util::toString(SearchManager::getInstance()->getPort()))) { return; } } else { @@ -810,7 +810,7 @@ int chars = 0; size_t BUF_SIZE; if(ClientManager::getInstance()->isActive()) { - string x = ClientManager::getInstance()->getCachedIp(); + string x = getLocalIp(); BUF_SIZE = x.length() + aString.length() + 64; buf = new char[BUF_SIZE]; chars = snprintf(buf, BUF_SIZE, "$Search %s:%d %c?%c?%s?%d?%s|", x.c_str(), (int)SearchManager::getInstance()->getPort(), c1, c2, Util::toString(aSize).c_str(), aFileType+1, tmp.c_str()); Modified: dcplusplus/trunk/dcpp/QueueManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/QueueManager.cpp 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/QueueManager.cpp 2007-12-17 23:14:47 UTC (rev 946) @@ -556,7 +556,7 @@ return qi->getPriority(); } namespace { -typedef unordered_map<TTHValue, const DirectoryListing::File*, TTHValue::Hash> TTHMap; +typedef unordered_map<TTHValue, const DirectoryListing::File*> TTHMap; // *** WARNING *** // Lock(cs) makes sure that there's only one thread accessing this Modified: dcplusplus/trunk/dcpp/QueueManager.h =================================================================== --- dcplusplus/trunk/dcpp/QueueManager.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/QueueManager.h 2007-12-17 23:14:47 UTC (rev 946) @@ -135,7 +135,7 @@ CriticalSection cs; } mover; - typedef unordered_map<CID, string, CID::Hash> PfsQueue; + typedef unordered_map<CID, string> PfsQueue; typedef PfsQueue::iterator PfsIter; /** All queue items by target */ Modified: dcplusplus/trunk/dcpp/SettingsManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/SettingsManager.cpp 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/SettingsManager.cpp 2007-12-17 23:14:47 UTC (rev 946) @@ -77,6 +77,7 @@ "UseTLS", "AutoSearchLimit", "AltSortOrder", "AutoKickNoFavs", "PromptPassword", "SpyFrameIgnoreTthSearches", "DontDlAlreadyQueued", "MaxCommandLength", "AllowUntrustedHubs", "AllowUntrustedClients", "TLSPort", "FastHash", "SortFavUsersFirst", "ShowShellMenu", "MinSegmentSize", "FollowLinks", + "SendBloom", "SENTRY", // Int64 "TotalUpload", "TotalDownload", @@ -271,6 +272,7 @@ setDefault(SHOW_SHELL_MENU, false); setDefault(MIN_SEGMENT_SIZE, 1024); setDefault(FOLLOW_LINKS, false); + setDefault(SEND_BLOOM, true); #ifdef _WIN32 setDefault(MAIN_WINDOW_STATE, SW_SHOWNORMAL); Modified: dcplusplus/trunk/dcpp/SettingsManager.h =================================================================== --- dcplusplus/trunk/dcpp/SettingsManager.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/SettingsManager.h 2007-12-17 23:14:47 UTC (rev 946) @@ -89,6 +89,7 @@ USE_TLS, AUTO_SEARCH_LIMIT, ALT_SORT_ORDER, AUTO_KICK_NO_FAVS, PROMPT_PASSWORD, SPY_FRAME_IGNORE_TTH_SEARCHES, DONT_DL_ALREADY_QUEUED, MAX_COMMAND_LENGTH, ALLOW_UNTRUSTED_HUBS, ALLOW_UNTRUSTED_CLIENTS, TLS_PORT, FAST_HASH, SORT_FAVUSERS_FIRST, SHOW_SHELL_MENU, MIN_SEGMENT_SIZE, FOLLOW_LINKS, + SEND_BLOOM, INT_LAST }; enum Int64Setting { INT64_FIRST = INT_LAST + 1, Modified: dcplusplus/trunk/dcpp/ShareManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/ShareManager.cpp 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/ShareManager.cpp 2007-12-17 23:14:47 UTC (rev 946) @@ -36,6 +36,7 @@ #include "Transfer.h" #include "UserConnection.h" #include "Download.h" +#include "HashBloom.h" #ifndef _WIN32 #include <sys/types.h> @@ -178,7 +179,7 @@ } } - vector<uint8_t> buf = tree.getLeafData(); + ByteVector buf = tree.getLeafData(); return new MemoryInputStream(&buf[0], buf.size()); } @@ -831,6 +832,19 @@ return 0; } +void ShareManager::getBloom(ByteVector& v, size_t k, size_t m) const { + dcdebug("Creating bloom filter, k=%u, m=%u\n", k, m); + Lock l(cs); + + HashBloom bloom; + bloom.reset(k, m); + for(HashFileMap::const_iterator i = tthIndex.begin(); i != tthIndex.end(); ++i) { + bloom.add(i->first); + } + bloom.copy_to(v); +} + + void ShareManager::generateXmlList() { Lock l(cs); if(xmlDirty && (lastXmlUpdate + 15 * 60 * 1000 < GET_TICK() || lastXmlUpdate < lastFullUpdate)) { Modified: dcplusplus/trunk/dcpp/ShareManager.h =================================================================== --- dcplusplus/trunk/dcpp/ShareManager.h 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/ShareManager.h 2007-12-17 23:14:47 UTC (rev 946) @@ -80,6 +80,8 @@ string getShareSizeString() const { return Util::toString(getShareSize()); } string getShareSizeString(const string& aDir) const { return Util::toString(getShareSize(aDir)); } + + void getBloom(ByteVector& v, size_t k, size_t m) const; SearchManager::TypeModes getType(const string& fileName) const throw(); @@ -256,7 +258,7 @@ // Map real name to directory structure Directory::Map directories; - typedef unordered_map<TTHValue, Directory::File::Set::const_iterator, TTHValue::Hash> HashFileMap; + typedef unordered_map<TTHValue, Directory::File::Set::const_iterator> HashFileMap; typedef HashFileMap::iterator HashFileIter; HashFileMap tthIndex; Modified: dcplusplus/trunk/dcpp/Socket.cpp =================================================================== --- dcplusplus/trunk/dcpp/Socket.cpp 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/dcpp/Socket.cpp 2007-12-17 23:14:47 UTC (rev 946) @@ -179,7 +179,7 @@ socksAuth(timeLeft(start, timeout)); - vector<uint8_t> connStr; + ByteVector connStr; // Authenticated, let's get on with it... connStr.push_back(5); // SOCKSv5 Modified: dcplusplus/trunk/win32/AboutDlg.cpp =================================================================== --- dcplusplus/trunk/win32/AboutDlg.cpp 2007-12-15 22:26:23 UTC (rev 945) +++ dcplusplus/trunk/win32/AboutDlg.cpp 2007-12-17 23:14:47 UTC (rev 946) @@ -41,7 +41,8 @@ "defr, ullner, fleetcommand, liny, xan, olle svensson, mark gillespie, jeremy huddleston, " "bsod, sulan, jonathan stone, tim burton, izzzo, guitarm, paka, nils maier, jens oknelid, yoji, " "krzysztof tyszecki, poison, pothead, pur, bigmuscle, martin, jove, bart vullings, " -"steven sheehy, tobias nygren, poy, dorian, stephan hohe, mafa_45, mikael eman, james ross. " +"steven sheehy, tobias nygren, poy, dorian, stephan hohe, mafa_45, mikael eman, james ross," +"stanislav maslovski. " "Keep it coming!"; AboutDlg::AboutDlg(SmartWin::Widget* parent) : SmartWin::WidgetFactory<SmartWin::WidgetModalDialog>(parent) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-23 11:04:39
|
Revision: 949 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=949&view=rev Author: arnetheduck Date: 2007-12-23 03:04:30 -0800 (Sun, 23 Dec 2007) Log Message: ----------- Fix crash, use token field Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/DirectoryListingFrame.cpp dcplusplus/trunk/win32/SearchFrame.cpp dcplusplus/trunk/win32/SearchFrame.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-22 22:38:16 UTC (rev 948) +++ dcplusplus/trunk/changelog.txt 2007-12-23 11:04:30 UTC (rev 949) @@ -1,7 +1,10 @@ -- 0.705 -- * Several patches for better *nix compatibility of the core (thanks steven sheehy et al) -* Improve segmented download file sharing +* Improve segmented download implementation * Fix search request ip when using multiple ip's (thanks stanislav maslovski) +* Fixed a crash when right-clicking in own file list +* [ADC] Searches filtered by token if available so that each search window only gets its own results +* [ADC] Implemented test version of bloom filters which will dramatically reduce hub bandwidth usage for TTH searches -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) Modified: dcplusplus/trunk/win32/DirectoryListingFrame.cpp =================================================================== --- dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2007-12-22 22:38:16 UTC (rev 948) +++ dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2007-12-23 11:04:30 UTC (rev 949) @@ -396,9 +396,9 @@ } if(files->getSelectedCount() == 1) { - if(BOOLSETTING(SHOW_SHELL_MENU) && (dl->getUser() == ClientManager::getInstance()->getMe())) { + ItemInfo* ii = files->getSelectedData(); + if(BOOLSETTING(SHOW_SHELL_MENU) && (dl->getUser() == ClientManager::getInstance()->getMe()) && ii->type == ItemInfo::FILE) { string path; - ItemInfo* ii = files->getSelectedData(); try { path = ShareManager::getInstance()->toReal(Util::toAdcFile(dl->getPath(ii->file) + ii->file->getName())); } catch(const ShareException&) { @@ -412,7 +412,6 @@ return true; } } - ItemInfo* ii = files->getSelectedData(); contextMenu = makeSingleMenu(ii); } else { Modified: dcplusplus/trunk/win32/SearchFrame.cpp =================================================================== --- dcplusplus/trunk/win32/SearchFrame.cpp 2007-12-22 22:38:16 UTC (rev 948) +++ dcplusplus/trunk/win32/SearchFrame.cpp 2007-12-23 11:04:30 UTC (rev 949) @@ -836,6 +836,12 @@ if(currentSearch.empty()) { return; } + + if(!aResult->getToken().empty() && token != aResult->getToken()) { + droppedResults++; + speak(SPEAK_FILTER_RESULT); + return; + } if(isHash) { if(aResult->getType() != SearchResult::TYPE_FILE || TTHValue(Text::fromT(currentSearch[0])) != aResult->getTTH()) { @@ -970,6 +976,7 @@ } s = s.substr(0, max(s.size(), static_cast<tstring::size_type>(1)) - 1); + token = Util::toString(Util::rand()); } @@ -1004,7 +1011,7 @@ if(SearchManager::getInstance()->okToSearch()) { SearchManager::getInstance()->search(clients, Text::fromT(s), llsize, - (SearchManager::TypeModes)ftype, mode, "manual"); + (SearchManager::TypeModes)ftype, mode, token); if(BOOLSETTING(CLEAR_SEARCH)) // Only clear if the search was sent searchBox->setText(Util::emptyStringT); } else { Modified: dcplusplus/trunk/win32/SearchFrame.h =================================================================== --- dcplusplus/trunk/win32/SearchFrame.h 2007-12-22 22:38:16 UTC (rev 948) +++ dcplusplus/trunk/win32/SearchFrame.h 2007-12-23 11:04:30 UTC (rev 949) @@ -200,6 +200,8 @@ CriticalSection cs; StringMap ucLineParams; + + std::string token; SearchFrame(SmartWin::WidgetTabView* mdiParent, const tstring& initialString_, LONGLONG initialSize_, SearchManager::SizeModes initialMode_, SearchManager::TypeModes initialType_); virtual ~SearchFrame(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-23 22:35:15
|
Revision: 951 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=951&view=rev Author: arnetheduck Date: 2007-12-23 14:35:08 -0800 (Sun, 23 Dec 2007) Log Message: ----------- crash fix Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/DirectoryListingFrame.cpp Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-23 20:29:57 UTC (rev 950) +++ dcplusplus/trunk/changelog.txt 2007-12-23 22:35:08 UTC (rev 951) @@ -5,6 +5,7 @@ * Fixed a crash when right-clicking in own file list * [ADC] Searches filtered by token if available so that each search window only gets its own results * [ADC] Implemented test version of bloom filters which will dramatically reduce hub bandwidth usage for TTH searches +* Fixed a crash with partial list browsing -- 0.704 2007-12-14 -- * Hub lists added to utilize Coral's distributed network (ullner) Modified: dcplusplus/trunk/win32/DirectoryListingFrame.cpp =================================================================== --- dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2007-12-23 20:29:57 UTC (rev 950) +++ dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2007-12-23 22:35:08 UTC (rev 951) @@ -274,7 +274,6 @@ void DirectoryListingFrame::refreshTree(const tstring& root) { HoldRedraw hold(dirs); - HTREEITEM ht = findItem(treeRoot, root); if(ht == NULL) { ht = treeRoot; @@ -286,12 +285,12 @@ while((next = dirs->getChild(ht)) != NULL) { dirs->erase(next); } - updateTree(d, ht); dirs->select(NULL); selectItem(root); + dcdebug("selected"); dirs->expand(treeRoot); } @@ -674,8 +673,12 @@ } void DirectoryListingFrame::handleSelectionChanged() { + ItemInfo* ii = dirs->getSelectedData(); + if(!ii) { + return; + } - DirectoryListing::Directory* d = dirs->getSelectedData()->dir; + DirectoryListing::Directory* d = ii->dir; if(d == 0) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-29 14:48:03
|
Revision: 953 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=953&view=rev Author: arnetheduck Date: 2007-12-29 06:47:58 -0800 (Sat, 29 Dec 2007) Log Message: ----------- libintl support Modified Paths: -------------- dcplusplus/trunk/SConstruct dcplusplus/trunk/build_util.py dcplusplus/trunk/dcpp/DCPlusPlus.cpp dcplusplus/trunk/dcpp/DCPlusPlus.h dcplusplus/trunk/dcpp/SConscript dcplusplus/trunk/dcpp/SettingsManager.cpp dcplusplus/trunk/dcpp/SettingsManager.h dcplusplus/trunk/dcpp/stdinc.h dcplusplus/trunk/win32/SConscript dcplusplus/trunk/win32/main.cpp dcplusplus/trunk/win32/stdafx.h Added Paths: ----------- dcplusplus/trunk/dcpp/po/ dcplusplus/trunk/dcpp/po/dcpp.pot dcplusplus/trunk/intl/ dcplusplus/trunk/intl/COPYING.LIB-2.0 dcplusplus/trunk/intl/COPYING.LIB-2.1 dcplusplus/trunk/intl/SConscript dcplusplus/trunk/intl/bindtextdom.c dcplusplus/trunk/intl/config.h dcplusplus/trunk/intl/dcgettext.c dcplusplus/trunk/intl/dcigettext.c dcplusplus/trunk/intl/dcngettext.c dcplusplus/trunk/intl/dgettext.c dcplusplus/trunk/intl/dngettext.c dcplusplus/trunk/intl/eval-plural.h dcplusplus/trunk/intl/explodename.c dcplusplus/trunk/intl/finddomain.c dcplusplus/trunk/intl/gettext.c dcplusplus/trunk/intl/gettextP.h dcplusplus/trunk/intl/gmo.h dcplusplus/trunk/intl/hash-string.c dcplusplus/trunk/intl/hash-string.h dcplusplus/trunk/intl/intl-compat.c dcplusplus/trunk/intl/l10nflist.c dcplusplus/trunk/intl/langprefs.c dcplusplus/trunk/intl/libgnuintl.h dcplusplus/trunk/intl/libgnuintl.h.in dcplusplus/trunk/intl/libintl.h dcplusplus/trunk/intl/loadinfo.h dcplusplus/trunk/intl/loadmsgcat.c dcplusplus/trunk/intl/localcharset.c dcplusplus/trunk/intl/localcharset.h dcplusplus/trunk/intl/locale.alias dcplusplus/trunk/intl/localealias.c dcplusplus/trunk/intl/localename.c dcplusplus/trunk/intl/lock.c dcplusplus/trunk/intl/lock.h dcplusplus/trunk/intl/log.c dcplusplus/trunk/intl/ngettext.c dcplusplus/trunk/intl/plural-exp.c dcplusplus/trunk/intl/plural-exp.h dcplusplus/trunk/intl/plural.c dcplusplus/trunk/intl/plural.y dcplusplus/trunk/intl/printf-args.c dcplusplus/trunk/intl/printf-args.h dcplusplus/trunk/intl/printf-parse.c dcplusplus/trunk/intl/printf-parse.h dcplusplus/trunk/intl/printf.c dcplusplus/trunk/intl/relocatable.c dcplusplus/trunk/intl/relocatable.h dcplusplus/trunk/intl/textdomain.c dcplusplus/trunk/intl/vasnprintf.c dcplusplus/trunk/intl/vasnprintf.h dcplusplus/trunk/intl/vasnwprintf.h dcplusplus/trunk/intl/version.c dcplusplus/trunk/intl/wprintf-parse.h dcplusplus/trunk/intl/xsize.h dcplusplus/trunk/win32/po/ Modified: dcplusplus/trunk/SConstruct =================================================================== --- dcplusplus/trunk/SConstruct 2007-12-28 13:17:28 UTC (rev 952) +++ dcplusplus/trunk/SConstruct 2007-12-29 14:47:58 UTC (rev 953) @@ -91,7 +91,7 @@ env.SConsignFile() env.Tool("gch", toolpath=".") -env.Append(CPPPATH = ["#/boost/boost/tr1/tr1/", "#/boost/", "#/htmlhelp/include/"]) +env.Append(CPPPATH = ["#/boost/boost/tr1/tr1/", "#/boost/", "#/htmlhelp/include/", "#/intl/"]) env.Append(LIBPATH = ["#/htmlhelp/lib/"]) if not env['nativestl']: @@ -144,6 +144,25 @@ ) env.Append(SCANNERS=[SWIGScanner]) +# +# internationalization (ardour.org provided the initial idea) +# + +po_args = ['msgmerge', '-q', '--update', '$TARGET', '$SOURCE'] +po_bld = Builder (action = Action([po_args], 'Updating translation $TARGET from $SOURCES')) +env.Append(BUILDERS = {'PoBuild' : po_bld}) + +mo_args = ['msgfmt', '-c', '-o', '$TARGET', '$SOURCE'] +mo_bld = Builder (action = Action([mo_args], 'Compiling message catalog $TARGET from $SOURCES')) +env.Append(BUILDERS = {'MoBuild' : mo_bld}) + +pot_args = ['xgettext','--from-code=UTF-8', '--foreign-user', '--package-name=$PACKAGE', + '--copyright-holder=Jacek Sieka', '--msgid-bugs-address=dcp...@li...', + '--no-wrap', '--keyword=_', '--output=$TARGET', '$SOURCES'] + +pot_bld = Builder (action = Action([pot_args], 'Extracting messages to $TARGET from $SOURCES')) +env.Append(BUILDERS = {'PotBuild' : pot_bld}) + from makedefs import convert env.Command('dcpp/StringDefs.cpp', 'dcpp/StringDefs.h', lambda target, source, env: convert()) env.Depends('dcpp/StringDefs.cpp', 'dcpp/StringDefs.h') @@ -151,6 +170,7 @@ dev.zlib = dev.build('zlib/') dev.bzip2 = dev.build('bzip2/') +dev.intl = dev.build('intl/') dev.boost = dev.build('boost/') dev.client = dev.build('dcpp/') env.Depends(dev.client, 'dcpp/StringDefs.cpp') Modified: dcplusplus/trunk/build_util.py =================================================================== --- dcplusplus/trunk/build_util.py 2007-12-28 13:17:28 UTC (rev 952) +++ dcplusplus/trunk/build_util.py 2007-12-29 14:47:58 UTC (rev 953) @@ -1,5 +1,6 @@ import glob import sys +import os class Dev: def __init__(self, mode, tools, env): @@ -40,6 +41,10 @@ self.env['PROGSUFFIX'] = '.exe' self.env['LIBPREFIX'] = 'lib' self.env['LIBSUFFIX'] = '.a' + self.env['SHLIBSUFFIX'] = '.dll' + + def is_win32(self): + return sys.platform == 'win32' or 'mingw' in self.env['TOOLS'] def get_build_root(self): return '#/build/' + self.mode + '-' + self.tools + '/' @@ -69,6 +74,25 @@ full_path = local_env.Dir('.').path + '/' + source_path return local_env.SConscript(source_path + 'SConscript', exports={'dev' : self, 'source_path' : full_path }) + def i18n (self, source_path, buildenv, sources, name): + p_oze = glob.glob('po/*.po') + languages = [ os.path.basename(po).replace ('.po', '') for po in p_oze ] + potfile = 'po/' + name + '.pot' + buildenv['PACKAGE'] = name + ret = buildenv.PotBuild(potfile, sources) + + for po_file in p_oze: + buildenv.Precious(buildenv.PoBuild(po_file, [potfile])) + lang = os.path.basename(po)[:-3] + mo_file = self.get_target(source_path, "locale/" + lang + "/LC_MESSAGES/" + name + ".mo", True) + buildenv.MoBuild (mo_file, po_file) + +# for lang in languages: +# modir = (os.path.join (install_prefix, 'share/locale/' + lang + '/LC_MESSAGES/')) +# moname = domain + '.mo' +# installenv.Alias('install', installenv.InstallAs (os.path.join (modir, moname), lang + '.mo')) + return ret + def CheckPKGConfig(context, version): context.Message( 'Checking for pkg-config... ' ) ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0] Modified: dcplusplus/trunk/dcpp/DCPlusPlus.cpp =================================================================== --- dcplusplus/trunk/dcpp/DCPlusPlus.cpp 2007-12-28 13:17:28 UTC (rev 952) +++ dcplusplus/trunk/dcpp/DCPlusPlus.cpp 2007-12-29 14:47:58 UTC (rev 953) @@ -43,6 +43,8 @@ } #endif +extern "C" int _nl_msg_cat_cntr; + namespace dcpp { void startup(void (*f)(void*, const string&), void* p) { @@ -57,6 +59,8 @@ #endif Util::initialize(); + + bindtextdomain(PACKAGE, LOCALEDIR); ResourceManager::newInstance(); SettingsManager::newInstance(); @@ -77,6 +81,15 @@ ADLSearchManager::newInstance(); SettingsManager::getInstance()->load(); + + if(!SETTING(LANGUAGE).empty()) { + string language = "LANGUAGE=" + SETTING(LANGUAGE); + putenv(language.c_str()); + // Apparently this is supposted to make gettext reload the message catalog... + _nl_msg_cat_cntr++; + } + + printf(_("test")); if(!SETTING(LANGUAGE_FILE).empty()) { ResourceManager::getInstance()->loadLanguage(SETTING(LANGUAGE_FILE)); Modified: dcplusplus/trunk/dcpp/DCPlusPlus.h =================================================================== --- dcplusplus/trunk/dcpp/DCPlusPlus.h 2007-12-28 13:17:28 UTC (rev 952) +++ dcplusplus/trunk/dcpp/DCPlusPlus.h 2007-12-29 14:47:58 UTC (rev 953) @@ -20,8 +20,10 @@ #define DCPP_DCPLUSPLUS_H #ifdef _WIN32 +#ifndef snprintf #define snprintf _snprintf #endif +#endif #ifdef _DEBUG @@ -166,6 +168,12 @@ extern void startup(void (*f)(void*, const string&), void* p); extern void shutdown(); +#ifdef BUILDING_DCPP +#define PACKAGE "dcpp" +#define LOCALEDIR (Util::getDataPath() + "/locale/").c_str() +#define _(String) dgettext(PACKAGE, String) +#endif + } // namespace dcpp #endif // !defined(DC_PLUS_PLUS_H) Modified: dcplusplus/trunk/dcpp/SConscript =================================================================== --- dcplusplus/trunk/dcpp/SConscript 2007-12-28 13:17:28 UTC (rev 952) +++ dcplusplus/trunk/dcpp/SConscript 2007-12-29 14:47:58 UTC (rev 953) @@ -37,6 +37,10 @@ if 'gcc' in env['TOOLS']: env['Gch'] = env.Gch('stdinc.h')[0] +env.Append(CPPDEFINES=["BUILDING_DCPP=1"]) + +dev.i18n(source_path, env, sources, 'dcpp') + ret = env.StaticLibrary(target, sources) Return('ret') Modified: dcplusplus/trunk/dcpp/SettingsManager.cpp =================================================================== --- dcplusplus/trunk/dcpp/SettingsManager.cpp 2007-12-28 13:17:28 UTC (rev 952) +++ dcplusplus/trunk/dcpp/SettingsManager.cpp 2007-12-29 14:47:58 UTC (rev 953) @@ -47,6 +47,7 @@ "LogFilePrivateChat", "LogFileStatus", "LogFileUpload", "LogFileDownload", "LogFileSystem", "LogFormatSystem", "LogFormatStatus", "DirectoryListingFrameOrder", "DirectoryListingFrameWidths", "TLSPrivateKeyFile", "TLSCertificateFile", "TLSTrustedCertificatesPath", "BeepFile", + "Language", "SENTRY", // Ints "IncomingConnections", "InPort", "Slots", "AutoFollow", "ClearSearch", Modified: dcplusplus/trunk/dcpp/SettingsManager.h =================================================================== --- dcplusplus/trunk/dcpp/SettingsManager.h 2007-12-28 13:17:28 UTC (rev 952) +++ dcplusplus/trunk/dcpp/SettingsManager.h 2007-12-29 14:47:58 UTC (rev 953) @@ -58,6 +58,7 @@ LOG_FILE_PRIVATE_CHAT, LOG_FILE_STATUS, LOG_FILE_UPLOAD, LOG_FILE_DOWNLOAD, LOG_FILE_SYSTEM, LOG_FORMAT_SYSTEM, LOG_FORMAT_STATUS, DIRECTORLISTINGFRAME_ORDER, DIRECTORLISTINGFRAME_WIDTHS, TLS_PRIVATE_KEY_FILE, TLS_CERTIFICATE_FILE, TLS_TRUSTED_CERTIFICATES_PATH, BEEPFILE, + LANGUAGE, STR_LAST }; enum IntSetting { INT_FIRST = STR_LAST + 1, Added: dcplusplus/trunk/dcpp/po/dcpp.pot =================================================================== --- dcplusplus/trunk/dcpp/po/dcpp.pot (rev 0) +++ dcplusplus/trunk/dcpp/po/dcpp.pot 2007-12-29 14:47:58 UTC (rev 953) @@ -0,0 +1,22 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Jacek Sieka +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: dcpp\n" +"Report-Msgid-Bugs-To: dcp...@li...\n" +"POT-Creation-Date: 2007-12-29 13:55+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL...@li...>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: dcpp/DCPlusPlus.cpp:92 +#, c-format +msgid "test" +msgstr "" Modified: dcplusplus/trunk/dcpp/stdinc.h =================================================================== --- dcplusplus/trunk/dcpp/stdinc.h 2007-12-28 13:17:28 UTC (rev 952) +++ dcplusplus/trunk/dcpp/stdinc.h 2007-12-29 14:47:58 UTC (rev 953) @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if !defined(STDINC_H) -#define STDINC_H +#ifndef DCPLUSPLUS_DCPP_STDINC_H +#define DCPLUSPLUS_DCPP_STDINC_H // This enables stlport's debug mode (and slows it down to a crawl...) //#define _STLP_DEBUG 1 @@ -117,6 +117,7 @@ #include <memory> #include <numeric> #include <limits> +#include <libintl.h> #ifdef _STLPORT_VERSION Added: dcplusplus/trunk/intl/COPYING.LIB-2.0 =================================================================== --- dcplusplus/trunk/intl/COPYING.LIB-2.0 (rev 0) +++ dcplusplus/trunk/intl/COPYING.LIB-2.0 2007-12-29 14:47:58 UTC (rev 953) @@ -0,0 +1,482 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! Added: dcplusplus/trunk/intl/COPYING.LIB-2.1 =================================================================== --- dcplusplus/trunk/intl/COPYING.LIB-2.1 (rev 0) +++ dcplusplus/trunk/intl/COPYING.LIB-2.1 2007-12-29 14:47:58 UTC (rev 953) @@ -0,0 +1,516 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. +^L + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. +^L + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. +^L + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. +^L + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. +^L + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. +^L + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Suc... [truncated message content] |