From o2on-svn @ lists.sourceforge.jp Mon Jul 21 16:24:31 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Mon, 21 Jul 2008 16:24:31 +0900 Subject: [o2on-svn] =?utf-8?b?WzEwNF0gIERC5YaN5qeL56+J44Gu5pa55rOV44KS5aSJ?= =?utf-8?b?5pu0?= Message-ID: <1216625071.499735.27579.nullmailer@users.sourceforge.jp> Revision: 104 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=104 Author: electrolysis Date: 2008-07-21 16:24:31 +0900 (Mon, 21 Jul 2008) Log Message: ----------- DB???膀???号?????? 荅括完: ??at.db.rebuild筝?????膀?????篋????勲???????at????????軌?祉????膀????????茵?? Modified Paths: -------------- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h branches/BRANCH_0043/o2on/src.o2on/O2DatIO.cpp branches/BRANCH_0043/o2on/src.o2on/O2DatIO.h branches/BRANCH_0043/o2on/src.o2on/main.cpp Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-06-26 11:53:50 UTC (rev 103) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-07-21 07:24:31 UTC (rev 104) @@ -47,6 +47,7 @@ , UpdateThreadHandle(NULL) , UpdateThreadLoop(false) { + dbfilename_to_rebuild = dbfilename + L".rebuild"; } @@ -173,17 +174,53 @@ +bool +O2DatDB:: +check_queue_size(O2DatRecList &reclist) +{ + return (reclist.size() < MAX_UPDATE_QUEUE_SIZE ? true : false); +} + + + bool O2DatDB:: -create_table(void) +before_rebuild(void) { + if (!DeleteFile(dbfilename_to_rebuild.c_str()) && GetLastError() != ERROR_FILE_NOT_FOUND) + return false; + if (!create_table(true)) + return false; + + return true; +} + +bool +O2DatDB:: +after_rebuild(void) +{ + if (!MoveFileEx(dbfilename.c_str(), (dbfilename + L".old").c_str(), MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH)) + return false; + if (!MoveFileEx(dbfilename_to_rebuild.c_str(), dbfilename.c_str(), MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH)) + return false; + + return true; +} + + + + +bool +O2DatDB:: +create_table(bool to_rebuild) +{ #if TRACE_SQL_EXEC_TIME stopwatch sw("create table/index and analyze"); #endif sqlite3 *db = NULL; - int err = sqlite3_open16(dbfilename.c_str(), &db); + int err = sqlite3_open16(to_rebuild ? dbfilename_to_rebuild.c_str() : dbfilename.c_str(), &db); if (err != SQLITE_OK) goto error; @@ -959,6 +996,90 @@ +void +O2DatDB:: +insert(O2DatRecList &in, bool to_rebuild) +{ +#if TRACE_SQL_EXEC_TIME + stopwatch sw("insert by reclist"); +#endif + + sqlite3 *db = NULL; + sqlite3_stmt *stmt_insert = NULL; + O2DatRec org; + + int err = sqlite3_open16(to_rebuild ? dbfilename_to_rebuild.c_str() : dbfilename.c_str(), &db); + if (err != SQLITE_OK) + goto error; + sqlite3_busy_timeout(db, 5000); + + sqlite3_exec(db, "pragma synchronous = OFF;", NULL, NULL, NULL); + + wchar_t *sql_insert = + L"insert or replace into dat (" + COLUMNS + L") values (" + L"?,?,?,?,?,?,?,?,?,?,?" + L");"; + err = sqlite3_prepare16_v2(db, sql_insert, wcslen(sql_insert)*2, &stmt_insert, NULL); + if (err != SQLITE_OK) + goto error; + + // + // Loop + // + sqlite3_exec(db, "begin;", NULL, NULL, NULL); + for (O2DatRecListIt it = in.begin(); it != in.end(); it++) { + sqlite3_reset(stmt_insert); + if (!bind(db, stmt_insert, 1, it->hash)) + goto error; + if (!bind(db, stmt_insert, 2, it->domain)) + goto error; + if (!bind(db, stmt_insert, 3, it->bbsname)) + goto error; + if (!bind(db, stmt_insert, 4, it->datname)) + goto error; + if (!bind(db, stmt_insert, 5, it->size)) + goto error; + if (!bind(db, stmt_insert, 6, it->disksize)) + goto error; + if (!bind(db, stmt_insert, 7, it->url)) + goto error; + if (!bind(db, stmt_insert, 8, it->title)) + goto error; + if (!bind(db, stmt_insert, 9, it->res)) + goto error; + if (!bind(db, stmt_insert, 10, time(NULL))) + goto error; + if (!bind(db, stmt_insert, 11, (uint64)0)) + goto error; + + err = sqlite3_step(stmt_insert); + if (err != SQLITE_ROW && err != SQLITE_DONE) + goto error; + Sleep(1); + } + sqlite3_exec(db, "commit;", NULL, NULL, NULL); + + sqlite3_finalize(stmt_insert); + stmt_insert = NULL; + + err = sqlite3_close(db); + if (err != SQLITE_OK) + goto error; + + return; + +error: + log(db); + if (stmt_insert) sqlite3_finalize(stmt_insert); + if (db) sqlite3_close(db); + return; +} + + + + #if 0 bool O2DatDB:: @@ -1368,6 +1489,7 @@ O2DatDB:: StartUpdateThread(void) { + Logger->AddLog(O2LT_INFO, L"UpdateThread", 0, 0, L"??"); if (UpdateThreadHandle) return; @@ -1380,6 +1502,7 @@ O2DatDB:: StopUpdateThread(void) { + Logger->AddLog(O2LT_INFO, L"UpdateThread", 0, 0, L"??"); if (!UpdateThreadHandle) return; UpdateThreadLoop = false; Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h 2008-06-26 11:53:50 UTC (rev 103) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h 2008-07-21 07:24:31 UTC (rev 104) @@ -56,6 +56,7 @@ protected: O2Logger *Logger; wstring dbfilename; + wstring dbfilename_to_rebuild; O2DatRecList UpdateQueue; Mutex UpdateQueueLock; @@ -77,7 +78,12 @@ O2DatDB(O2Logger *lgr, const wchar_t *filename); ~O2DatDB(); - bool create_table(void); + bool check_queue_size(O2DatRecList &reclist); + + bool before_rebuild(void); + bool after_rebuild(void); + + bool create_table(bool to_rebuild); bool reindex(const char *target); bool analyze(void); @@ -94,6 +100,8 @@ uint64 select_totaldisksize(void); uint64 select_publishcount(time_t publish_tt); + void insert(O2DatRecList &in, bool to_rebuild); + // bool update(O2DatRec &in, bool is_origurl); void update(O2DatRecList &in); // bool update_lastpublish(const hashT &hash); Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatIO.cpp =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatIO.cpp 2008-06-26 11:53:50 UTC (rev 103) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatIO.cpp 2008-07-21 07:24:31 UTC (rev 104) @@ -43,7 +43,6 @@ , RebuildDBThreadHandle(NULL) , ReindexThreadHandle(NULL) , LoopRebuildDB(false) - , EnumDatThreadNum(0) , AnalyzeThreadHandle(0) { @@ -878,8 +877,24 @@ O2DatIO *me = (O2DatIO*)data; CoInitialize(NULL); - me->RebuildDBThread(me->Profile->GetCacheRootW(), 0); - me->DatDB->analyze(); + me->DatDB->StopUpdateThread(); + O2DatRecList reclist; + if (me->DatDB->before_rebuild()) { + me->RebuildDBThread(me->Profile->GetCacheRootW(), 0, reclist); + bool manualstop = !me->LoopRebuildDB; + // ????????????????????+ if (!manualstop) { + if (me->DatDB->after_rebuild()) + me->DatDB->analyze(); + else + me->Logger->AddLog(O2LT_ERROR, L"DB???", 0, 0, "?????DB????ク?"); + } + } + else { + me->Logger->AddLog(O2LT_ERROR, L"DB???", 0, 0, "????DB??ク?"); + me->ProgressInfo->Reset(false, false); + } + me->DatDB->StartUpdateThread(); CoUninitialize(); CloseHandle(me->RebuildDBThreadHandle); @@ -891,11 +906,14 @@ void O2DatIO:: -RebuildDBThread(const wchar_t *dir, uint level) +RebuildDBThread(const wchar_t *dir, uint level, O2DatRecList &reclist) { if (level == 0) { ProgressInfo->Reset(true, true); } + if (level == 3) { + ProgressInfo->SetMessage(dir+wcslen(Profile->GetCacheRootW())); + } WIN32_FIND_DATAW wfd; HANDLE handle; @@ -913,18 +931,55 @@ do { if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - if (wfd.cFileName[0] != L'.') - dirs.push_back(wfd.cFileName); + if (wfd.cFileName[0] != L'.') { + if (level == 3) + Logger->AddLog(O2LT_WARNING, L"DB???", 0, 0, + L"?????????????(%s\\%s)", dir, wfd.cFileName); + else + dirs.push_back(wfd.cFileName); + } } else { if (wcscmp(wfd.cFileName, L".index") == 0) { swprintf_s(path, MAX_PATH, L"%s\\%s", dir, wfd.cFileName); DeleteFile(path); + continue; } - else { + else if (level != 3) { Logger->AddLog(O2LT_WARNING, L"DB???", 0, 0, L"??????????(%s\\%s)", dir, wfd.cFileName); + continue; } + + if (level != 3) continue; + + wsplit(dir+wcslen(Profile->GetCacheRootW()), L"\\", paths); + if (!datpath.set(paths[0].c_str(), paths[1].c_str(), wfd.cFileName)) { + Logger->AddLog(O2LT_WARNING, L"DB???", 0, 0, + L"dat?????????(%s\\%s)", dir, wfd.cFileName); + continue; + } + if (wfd.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { + swprintf_s(path, MAX_PATH, L"%s\\%s", dir, wfd.cFileName); + wfd.dwFileAttributes ^= FILE_ATTRIBUTE_READONLY; + SetFileAttributes(path, wfd.dwFileAttributes); + } + + datpath.gethash(rec.hash); + rec.domain = paths[0]; + rec.bbsname = paths[1]; + rec.datname = wfd.cFileName; + rec.size = ((uint64)wfd.nFileSizeHigh << 32) | (uint64)wfd.nFileSizeLow; + rec.disksize = GetDiskFileSize(rec.size); + datpath.geturl(rec.url); + GetTitle(datpath); + datpath.gettitle(rec.title); + rec.res = 0; + reclist.push_back(rec); + if (!DatDB->check_queue_size(reclist)) { + DatDB->insert(reclist, true); + reclist.clear(); + } } } while (LoopRebuildDB && FindNextFileW(handle, &wfd)); FindClose(handle); @@ -983,133 +1038,25 @@ continue; swprintf_s(path, MAX_PATH, L"%s\\%s", dir, s); + RebuildDBThread(path, level+1, reclist); //?? - if (level == 2) { - while (1) { - EnumDatThreadNumLock.Lock(); - if (EnumDatThreadNum < 10) { - EnumDatThreadNum++; - - ThreadData *param = new ThreadData;; - param->me = this; - param->dir = path; - - HANDLE thandle = (HANDLE)_beginthreadex( - NULL, 0, StaticEnumDatThread, (void*)param, 0, NULL); - CloseHandle(thandle); - EnumDatThreadNumLock.Unlock(); - break; - } - EnumDatThreadNumLock.Unlock(); - Sleep(1000); - } - } - else { - RebuildDBThread(path, level+1); //?? - } - if (level == 1) ProgressInfo->AddPos(1); } } if (level == 0) { - while (EnumDatThreadNum) - Sleep(1000); + if (LoopRebuildDB && !reclist.empty()) { + DatDB->insert(reclist, true); + reclist.clear(); + } ProgressInfo->Reset(false, true); CLEAR_WORKSET; } } -uint WINAPI -O2DatIO:: -StaticEnumDatThread(void *data) -{ - ThreadData *param = (ThreadData*)data; - O2DatIO *me = param->me; - wstring dir = param->dir; - delete param; - - CoInitialize(NULL); - me->EnumDatThread(dir.c_str()); - CoUninitialize(); - - me->EnumDatThreadNumLock.Lock(); - me->EnumDatThreadNum--; - me->EnumDatThreadNumLock.Unlock(); - - //_endthreadex(0); - return (0); -} - void O2DatIO:: -EnumDatThread(const wchar_t *dir) -{ - ProgressInfo->SetMessage(dir+wcslen(Profile->GetCacheRootW())); - - wchar_t findpath[MAX_PATH]; - swprintf_s(findpath, MAX_PATH, L"%s\\*.*", dir); - - wstrarray paths; - wsplit(dir+wcslen(Profile->GetCacheRootW()), L"\\", paths); - - O2DatRec rec; - rec.domain = paths[0]; - rec.bbsname = paths[1]; - - O2DatPath datpath; - wchar_t path[MAX_PATH]; - - WIN32_FIND_DATAW wfd; - HANDLE handle = FindFirstFileW(findpath, &wfd); - if (handle == INVALID_HANDLE_VALUE) - return; - - do { - if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - if (wfd.cFileName[0] != L'.') { - Logger->AddLog(O2LT_WARNING, L"DB???", 0, 0, - L"?????????????(%s\\%s)", dir, wfd.cFileName); - } - continue; - } - - if (wcscmp(wfd.cFileName, L".index") == 0) { - swprintf_s(path, MAX_PATH, L"%s\\%s", dir, wfd.cFileName); - DeleteFile(path); - continue; - } - if (!datpath.set(rec.domain.c_str(), rec.bbsname.c_str(), wfd.cFileName)) { - Logger->AddLog(O2LT_WARNING, L"DB???", 0, 0, - L"dat?????????(%s\\%s)", dir, wfd.cFileName); - continue; - } - if (wfd.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { - swprintf_s(path, MAX_PATH, L"%s\\%s", dir, wfd.cFileName); - wfd.dwFileAttributes ^= FILE_ATTRIBUTE_READONLY; - SetFileAttributes(path, wfd.dwFileAttributes); - } - - datpath.gethash(rec.hash); - rec.datname = wfd.cFileName; - rec.size = ((uint64)wfd.nFileSizeHigh << 32) | (uint64)wfd.nFileSizeLow; - rec.disksize = GetDiskFileSize(rec.size); - datpath.geturl(rec.url); - GetTitle(datpath); - datpath.gettitle(rec.title); - rec.res = 0; - - DatDB->AddUpdateQueue(rec); - } while (LoopRebuildDB && FindNextFileW(handle, &wfd)); - FindClose(handle); -} - - - - -void -O2DatIO:: Reindex(void) { if (ReindexThreadHandle) Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatIO.h =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatIO.h 2008-06-26 11:53:50 UTC (rev 103) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatIO.h 2008-07-21 07:24:31 UTC (rev 104) @@ -38,18 +38,9 @@ HANDLE ReindexThreadHandle; HANDLE AnalyzeThreadHandle; bool LoopRebuildDB; - uint EnumDatThreadNum; - Mutex EnumDatThreadNumLock; - struct ThreadData { - O2DatIO *me; - wstring dir; - }; - protected: uint64 GetDiskFileSize(uint64 size); - static uint WINAPI StaticEnumDatThread(void *data); - void EnumDatThread(const wchar_t *dir); public: O2DatIO(O2DatDB *db, O2Logger *lgr, O2Profile *prof, O2ProgressInfo *proginfo); @@ -80,7 +71,7 @@ void RebuildDB(void); void StopRebuildDB(void); static uint WINAPI StaticRebuildDBThread(void *data); - void RebuildDBThread(const wchar_t *dir, uint level); + void RebuildDBThread(const wchar_t *dir, uint level, O2DatRecList &reclist); void Reindex(void); static uint WINAPI StaticReindexThread(void *data); Modified: branches/BRANCH_0043/o2on/src.o2on/main.cpp =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/main.cpp 2008-06-26 11:53:50 UTC (rev 103) +++ branches/BRANCH_0043/o2on/src.o2on/main.cpp 2008-07-21 07:24:31 UTC (rev 104) @@ -379,7 +379,7 @@ wstring dbfilename(Profile->GetDBDirW()); dbfilename += L"\\dat.db"; DatDB = new O2DatDB(Logger, dbfilename.c_str()); - if (!DatDB->create_table()) { + if (!DatDB->create_table(false)) { MessageBox(NULL, L"DB?????ク?????\n????????", NULL, MB_ICONERROR | MB_OK); @@ -1060,6 +1060,10 @@ break; case ID_REBUILDDB: if (!Active && !hwndProgressDlg) { + if (MessageBox(hwnd, + _T("?????????????"), + _T("DB???"), MB_OKCANCEL|MB_ICONINFORMATION) == IDCANCEL) + break; CreateProgressDialog(_T("DB???...")); DatIO->RebuildDB(); } From o2on-svn @ lists.sourceforge.jp Mon Jul 21 16:38:38 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Mon, 21 Jul 2008 16:38:38 +0900 Subject: [o2on-svn] =?utf-8?b?WzEwNV0gRklYOiAgU1FM5paH44Gn5aSJ5pWw44GM44OQ?= =?utf-8?b?44Kk44Oz44OJ44GV44KM44Gm44GE44Gq44GE566H5omA44GM44GC44KL?= Message-ID: <1216625918.288733.6335.nullmailer@users.sourceforge.jp> Revision: 105 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=105 Author: electrolysis Date: 2008-07-21 16:38:38 +0900 (Mon, 21 Jul 2008) Log Message: ----------- FIX: SQL文で変数がバインドされていない箇所がある Modified Paths: -------------- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-07-21 07:24:31 UTC (rev 104) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-07-21 07:38:38 UTC (rev 105) @@ -1286,8 +1286,8 @@ goto error; if (!bind(db, stmt_update, 5, time(NULL))) goto error; -// if (!bind(db, stmt_update, 6, (uint64)0)) -// goto error; + if (!bind(db, stmt_update, 6, it->hash)) + goto error; err = sqlite3_step(stmt_update); if (err != SQLITE_ROW && err != SQLITE_DONE) From o2on-svn @ lists.sourceforge.jp Sat Jul 26 17:07:18 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Sat, 26 Jul 2008 17:07:18 +0900 Subject: [o2on-svn] [106] FIX: typo Message-ID: <1217059638.360480.22081.nullmailer@users.sourceforge.jp> Revision: 106 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=106 Author: k-uehara Date: 2008-07-26 17:07:18 +0900 (Sat, 26 Jul 2008) Log Message: ----------- FIX: typo http://pc11.2ch.net/test/read.cgi/tech/1212302014/435 Modified Paths: -------------- branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h Modified: branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h 2008-07-21 07:38:38 UTC (rev 105) +++ branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h 2008-07-26 08:07:18 UTC (rev 106) @@ -661,7 +661,7 @@ } } else if (act == "deactivate") { - // activate saku + // deactivate query it = hdr->queries.find("hash"); if (it != hdr->queries.end()) { if (it->second.size() >= HASHSIZE*2) { @@ -669,7 +669,7 @@ hash.assign(it->second.c_str(), it->second.size()); if (QueryDB->SetEnable(hash,false)) { msg = L"???????"; - SakuDB->Save(Profile->GetSakuFilePath()); + QueryDB->Save(Profile->GetQueryFilePath()); } } } From o2on-svn @ lists.sourceforge.jp Sat Jul 26 17:17:23 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Sat, 26 Jul 2008 17:17:23 +0900 Subject: [o2on-svn] =?utf-8?b?WzEwN10gIERC44OB44Ol44O844OL44Oz44Kw?= Message-ID: <1217060243.789647.29698.nullmailer@users.sourceforge.jp> Revision: 107 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=107 Author: k-uehara Date: 2008-07-26 17:17:23 +0900 (Sat, 26 Jul 2008) Log Message: ----------- DBチューニング 起動時analyzeをやめた 適宜begin; end;でトランザクションを利用 Modified Paths: -------------- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-07-26 08:07:18 UTC (rev 106) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-07-26 08:17:23 UTC (rev 107) @@ -249,7 +249,7 @@ "create index if not exists idx_dat_domain_bbsname_datname on dat (domain, bbsname, datname);" "create index if not exists idx_dat_lastpublish on dat (lastpublish);" "create index if not exists idx_dat_datname on dat (datname);"; - "analyze;"; +// "analyze;"; err = sqlite3_exec(db, sql, NULL, 0, 0); if (err != SQLITE_OK) goto error; @@ -324,7 +324,7 @@ if (err != SQLITE_OK) goto error; - char sql[] = "analyze; vacuum dat;"; + char sql[] = "begin;analyze;end; vacuum dat;"; err = sqlite3_exec(db, sql, NULL, 0, 0); if (err != SQLITE_OK) @@ -814,7 +814,10 @@ sqlite3_busy_timeout(db, 5000); - wchar_t *sql = L"select count(*) from dat;"; + wchar_t *sql = + L"begin;" + L"select count(*) from dat;" + L"end;"; err = sqlite3_prepare16_v2(db, sql, wcslen(sql)*2, &stmt, NULL); if (err != SQLITE_OK) @@ -915,7 +918,10 @@ goto error; sqlite3_busy_timeout(db, 5000); - wchar_t *sql = L"select sum(disksize) from dat;"; + wchar_t *sql = + L"begin;" + L"select sum(disksize) from dat;" + L"end;"; err = sqlite3_prepare16_v2(db, sql, wcslen(sql)*2, &stmt, NULL); if (err != SQLITE_OK) From o2on-svn @ lists.sourceforge.jp Sat Jul 26 17:29:15 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Sat, 26 Jul 2008 17:29:15 +0900 Subject: [o2on-svn] =?utf-8?b?WzEwOF0gRklYOiAgIzEyOTk1IOeEoeimluOBl+OBpg==?= =?utf-8?b?44GE44KL5p2/44GuZGF044Gu44Oq44Kv44Ko44K544OI44KS6YCB44KJ44Gq?= =?utf-8?b?44GE44KI44GG44Gr44GX44Gf?= Message-ID: <1217060955.823751.4895.nullmailer@users.sourceforge.jp> Revision: 108 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=108 Author: k-uehara Date: 2008-07-26 17:29:15 +0900 (Sat, 26 Jul 2008) Log Message: ----------- FIX: #12995 ?∴????????帥?dat???????鴻???????????????? Ticket Links: :----------- http://sourceforge.jp/projects/o2on/tracker/detail/12995 Modified Paths: -------------- branches/BRANCH_0043/o2on/src.o2on/O2Boards.cpp branches/BRANCH_0043/o2on/src.o2on/O2Boards.h branches/BRANCH_0043/o2on/src.o2on/O2Job_DatCollector.h Modified: branches/BRANCH_0043/o2on/src.o2on/O2Boards.cpp =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2Boards.cpp 2008-07-26 08:17:23 UTC (rev 107) +++ branches/BRANCH_0043/o2on/src.o2on/O2Boards.cpp 2008-07-26 08:29:15 UTC (rev 108) @@ -420,6 +420,27 @@ // --------------------------------------------------------------------------- +// GetExEnList() +// +// --------------------------------------------------------------------------- +size_t +O2Boards:: +GetExEnList(wstrarray &boards) +{ + ExLock.Lock(); + for (O2BoardExMapIt exit = exmap.begin(); exit != exmap.end(); exit++) { + if (exit->second->collectors.count() && exit->second->enable) + boards.push_back(exit->first); + } + ExLock.Unlock(); + + return (boards.size()); +} + + + + +// --------------------------------------------------------------------------- // GetExNodeList() // // --------------------------------------------------------------------------- Modified: branches/BRANCH_0043/o2on/src.o2on/O2Boards.h =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2Boards.h 2008-07-26 08:17:23 UTC (rev 107) +++ branches/BRANCH_0043/o2on/src.o2on/O2Boards.h 2008-07-26 08:29:15 UTC (rev 108) @@ -107,6 +107,7 @@ void ClearEx(void); bool AddEx(const char *url); size_t GetExList(wstrarray &boards); + size_t GetExEnList(wstrarray &boards); size_t GetExNodeList(const wchar_t *board, O2NodeKBucket::NodeListT &nodelist); void RemoveExNode(const wchar_t *board, const O2Node &node); void ImportNodeFromXML(const O2Node &node, const char *in, size_t len); Modified: branches/BRANCH_0043/o2on/src.o2on/O2Job_DatCollector.h =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2Job_DatCollector.h 2008-07-26 08:17:23 UTC (rev 107) +++ branches/BRANCH_0043/o2on/src.o2on/O2Job_DatCollector.h 2008-07-26 08:29:15 UTC (rev 108) @@ -81,7 +81,7 @@ { // ????????? wstrarray boards; - if (Boards->GetExList(boards) == 0) + if (Boards->GetExEnList(boards) == 0) return; CryptoPP::AutoSeededRandomPool rng; wstring &board = boards[rng.GenerateWord32(0, boards.size()-1)]; From o2on-svn @ lists.sourceforge.jp Sat Jul 26 17:46:46 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Sat, 26 Jul 2008 17:46:46 +0900 Subject: [o2on-svn] =?utf-8?b?WzEwOV0gQ0xFQU4gVVA6ICDmnKrkvb/nlKjjg6Hjgr0=?= =?utf-8?b?44OD44OJ44KS5YmK6Zmk?= Message-ID: <1217062006.378040.17305.nullmailer@users.sourceforge.jp> Revision: 109 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=109 Author: k-uehara Date: 2008-07-26 17:46:46 +0900 (Sat, 26 Jul 2008) Log Message: ----------- CLEAN UP: 未使用メソッドを削除 Modified Paths: -------------- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-07-26 08:29:15 UTC (rev 108) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-07-26 08:46:46 UTC (rev 109) @@ -1086,114 +1086,6 @@ -#if 0 -bool -O2DatDB:: -update(O2DatRec &in, bool is_origurl) -{ - sqlite3 *db = NULL; - sqlite3_stmt* stmt; - O2DatRec org; - - int err = sqlite3_open16(dbfilename.c_str(), &db); - if (err != SQLITE_OK) - goto error; - sqlite3_busy_timeout(db, 5000); - - if (select(org, in.hash)) { - wchar_t *sql = - L"update or replace dat" - L" set size = ?" - L" , disksize = ?" - L" , url = ?" - L" , res = ?" - L" , lastupdate = ?" - L" , lastpublish = 0" - L" where hash = ?;"; - - err = sqlite3_prepare16_v2(db, sql, wcslen(sql)*2, &stmt, NULL); - if (err != SQLITE_OK) - goto error; - - if (!is_origurl) - in.url = org.url; - if (!bind(db, stmt, 1, in.size)) - goto error; - if (!bind(db, stmt, 2, in.disksize)) - goto error; - if (!bind(db, stmt, 3, in.url)) - goto error; - if (!bind(db, stmt, 4, in.res)) - goto error; - if (!bind(db, stmt, 5, time(NULL))) - goto error; - if (!bind(db, stmt, 6, in.hash)) - goto error; - - err = sqlite3_step(stmt); - if (err != SQLITE_ROW && err != SQLITE_DONE) - goto error; - sqlite3_finalize(stmt); - stmt = NULL; - } - else { - wchar_t *sql = - L"insert or replace into dat (" - COLUMNS - L") values (" - L"?,?,?,?,?,?,?,?,?,?,?" - L");"; - - err = sqlite3_prepare16_v2(db, sql, wcslen(sql)*2, &stmt, NULL); - if (err != SQLITE_OK) - goto error; - - if (!bind(db, stmt, 1, in.hash)) - goto error; - if (!bind(db, stmt, 2, in.domain)) - goto error; - if (!bind(db, stmt, 3, in.bbsname)) - goto error; - if (!bind(db, stmt, 4, in.datname)) - goto error; - if (!bind(db, stmt, 5, in.size)) - goto error; - if (!bind(db, stmt, 6, in.disksize)) - goto error; - if (!bind(db, stmt, 7, in.url)) - goto error; - if (!bind(db, stmt, 8, in.title)) - goto error; - if (!bind(db, stmt, 9, in.res)) - goto error; - if (!bind(db, stmt, 10, time(NULL))) - goto error; - if (!bind(db, stmt, 11, (uint64)0)) - goto error; - - err = sqlite3_step(stmt); - if (err != SQLITE_ROW && err != SQLITE_DONE) - goto error; - sqlite3_finalize(stmt); - stmt = NULL; - } - - err = sqlite3_close(db); - if (err != SQLITE_OK) - goto error; - - return true; - -error: - log(db); - if (stmt) sqlite3_finalize(stmt); - if (db) sqlite3_close(db); - return false; -} -#endif - - - void O2DatDB:: update(O2DatRecList &in) @@ -1339,56 +1231,6 @@ -#if 0 -bool -O2DatDB:: -update_lastpublish(const hashT &hash) -{ - sqlite3 *db = NULL; - int err = sqlite3_open16(dbfilename.c_str(), &db); - if (err != SQLITE_OK) - goto error; - sqlite3_busy_timeout(db, 5000); - - wchar_t *sql = - L"update or replace dat" - L" set lastpublish = ?" - L" where hash = ?;"; - - sqlite3_stmt *stmt = NULL; - err = sqlite3_prepare16_v2(db, sql, wcslen(sql)*2, &stmt, NULL); - if (err != SQLITE_OK) - goto error; - - if (!bind(db, stmt, 1, time(NULL))) - goto error; - if (!bind(db, stmt, 2, hash)) - goto error; - - err = sqlite3_step(stmt); - if (err != SQLITE_ROW && err != SQLITE_DONE) - goto error; - - sqlite3_finalize(stmt); - stmt = NULL; - - err = sqlite3_close(db); - if (err != SQLITE_OK) - goto error; - - return true; - -error: - log(db); - if (stmt) sqlite3_finalize(stmt); - if (db) sqlite3_close(db); - return false; -} -#endif - - - - void O2DatDB:: divide_update(O2DatRecList &in) Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h 2008-07-26 08:29:15 UTC (rev 108) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h 2008-07-26 08:46:46 UTC (rev 109) @@ -102,9 +102,7 @@ void insert(O2DatRecList &in, bool to_rebuild); -// bool update(O2DatRec &in, bool is_origurl); void update(O2DatRecList &in); -// bool update_lastpublish(const hashT &hash); void divide_update(O2DatRecList &in); bool remove(const hashT &hash); From o2on-svn @ lists.sourceforge.jp Sat Jul 26 19:26:02 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Sat, 26 Jul 2008 19:26:02 +0900 Subject: [o2on-svn] =?utf-8?b?WzExMF0gIOODqeOCpOODluODqeODquOCouODg+ODlw==?= =?utf-8?b?44OH44O844OIIDogU1FMaXRlIDMuNi4w?= Message-ID: <1217067962.616770.21988.nullmailer@users.sourceforge.jp> Revision: 110 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=110 Author: k-uehara Date: 2008-07-26 19:26:02 +0900 (Sat, 26 Jul 2008) Log Message: ----------- ????????????????? SQLite 3.6.0 Modified Paths: -------------- branches/BRANCH_0043/o2on/doc/build.txt branches/BRANCH_0043/o2on/src.o2on/o2on.vcproj Modified: branches/BRANCH_0043/o2on/doc/build.txt =================================================================== --- branches/BRANCH_0043/o2on/doc/build.txt 2008-07-26 08:46:46 UTC (rev 109) +++ branches/BRANCH_0043/o2on/doc/build.txt 2008-07-26 10:26:02 UTC (rev 110) @@ -6,7 +6,7 @@ ?Crypto++ Library 5.5.2 ?Xerces-C++ 2.8.0 ?zlib 1.2.3 -?SQLite 3.5.9 +?SQLite 3.6.0 ???? ?MiniZip Ver0.02c ?UPX 3.03 @@ -119,10 +119,10 @@ ------------------------------------------------------------------------------ - SQLite 3.5.9 + SQLite 3.6.0 ------------------------------------------------------------------------------ http://www.sqlite.org/ -?sqlite-3_5_9.zip ???????????? +?sqlite-amalgamation-3_6_0.zip ???????????? ??????????sqlite?????o2on???????? +-o2on +-cryptopp Modified: branches/BRANCH_0043/o2on/src.o2on/o2on.vcproj =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/o2on.vcproj 2008-07-26 08:46:46 UTC (rev 109) +++ branches/BRANCH_0043/o2on/src.o2on/o2on.vcproj 2008-07-26 10:26:02 UTC (rev 110) @@ -1635,7 +1635,7 @@ Name="sqlite.c" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Revision: 111 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=111 Author: k-uehara Date: 2008-07-26 19:34:38 +0900 (Sat, 26 Jul 2008) Log Message: ----------- trunk待避 FireBird対応はなかったことにする Added Paths: ----------- tags/trunk.080706/ Copied: tags/trunk.080706 (from rev 85, trunk) From o2on-svn @ lists.sourceforge.jp Sat Jul 26 19:38:02 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Sat, 26 Jul 2008 19:38:02 +0900 Subject: [o2on-svn] =?utf-8?b?WzExMl0gIHRydW5r5b6F6YG/?= Message-ID: <1217068682.545388.30144.nullmailer@users.sourceforge.jp> Revision: 112 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=112 Author: k-uehara Date: 2008-07-26 19:38:02 +0900 (Sat, 26 Jul 2008) Log Message: ----------- trunk待避 FireBird対応はなかったことにする FIX: rename Added Paths: ----------- tags/trunk.080726/ Removed Paths: ------------- tags/trunk.080706/ Copied: tags/trunk.080726 (from rev 111, tags/trunk.080706) From o2on-svn @ lists.sourceforge.jp Thu Jul 31 13:24:24 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Thu, 31 Jul 2008 13:24:24 +0900 Subject: [o2on-svn] =?utf-8?b?WzExM10gIGRpdmlkZV91cGRhdGXlu4PmraI=?= Message-ID: <1217478264.446753.19478.nullmailer@users.sourceforge.jp> Revision: 113 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=113 Author: electrolysis Date: 2008-07-31 13:24:24 +0900 (Thu, 31 Jul 2008) Log Message: ----------- divide_update廃止 Modified Paths: -------------- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-07-26 10:38:02 UTC (rev 112) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-07-31 04:24:24 UTC (rev 113) @@ -17,7 +17,7 @@ #include #define UPDATE_THREAD_INTERVAL_S 15 -#define MAX_UPDATE_QUEUE_SIZE 1000 +#define MAX_INSERT_QUEUE_SIZE 1000 #if defined(_DEBUG) #define TRACE_SQL_EXEC_TIME 1 @@ -178,7 +178,7 @@ O2DatDB:: check_queue_size(O2DatRecList &reclist) { - return (reclist.size() < MAX_UPDATE_QUEUE_SIZE ? true : false); + return (reclist.size() < MAX_INSERT_QUEUE_SIZE ? true : false); } @@ -1231,31 +1231,6 @@ -void -O2DatDB:: -divide_update(O2DatRecList &in) -{ - if (in.size() > MAX_UPDATE_QUEUE_SIZE) { - O2DatRecListIt begin = in.begin(); - O2DatRecListIt end = in.begin(); - while (end != in.end()) { - begin = end; - if (std::distance(end, in.end()) < MAX_UPDATE_QUEUE_SIZE) - end = in.end(); - else - std::advance(end, MAX_UPDATE_QUEUE_SIZE); - - O2DatRecList tmp(begin, end); - update(tmp); - } - } - else - update(in); -} - - - - bool O2DatDB:: remove(const hashT &hash) @@ -1361,7 +1336,7 @@ UpdateQueueLock.Lock(); if (!UpdateQueue.empty()) { - divide_update(UpdateQueue); + update(UpdateQueue); UpdateQueue.clear(); } UpdateQueueLock.Unlock(); @@ -1395,7 +1370,7 @@ UpdateQueueLock.Unlock(); if (!reclist.empty()) - divide_update(reclist); + update(reclist); t = time(NULL); CLEAR_WORKSET; //TRACEA("+++++ UPDATE +++++\n"); Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h 2008-07-26 10:38:02 UTC (rev 112) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h 2008-07-31 04:24:24 UTC (rev 113) @@ -103,7 +103,6 @@ void insert(O2DatRecList &in, bool to_rebuild); void update(O2DatRecList &in); - void divide_update(O2DatRecList &in); bool remove(const hashT &hash); From o2on-svn @ lists.sourceforge.jp Sat Aug 2 18:28:47 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Sat, 02 Aug 2008 18:28:47 +0900 Subject: [o2on-svn] =?utf-8?b?WzExNF0gIOOCueODrOODg+ODieaknOe0oueUu+mdog==?= =?utf-8?b?44Gn44CB44OB44Kn44OD44Kv44Oc44OD44Kv44K544KS5L2/44Gj44Gm6KSH?= =?utf-8?b?5pWw44Gu44K544Os44OD44OJ44Gr5a++44GX44Gm5Yem55CG44GZ44KL44Kk?= =?utf-8?b?44Oz44K/44O844OV44Kn44Kk44K544KS6L+95Yqg44CC?= Message-ID: <1217669327.457454.22222.nullmailer@users.sourceforge.jp> Revision: 114 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=114 Author: osa_p Date: 2008-08-02 18:28:47 +0900 (Sat, 02 Aug 2008) Log Message: ----------- ?鴻????罎?刈?脂??с???????????????戎?c?茲???????????絲障???????????潟??若??с??鴻?菴遵???筝??????医???????????c??激?????????????????o2on.js???????????障?????????け????障?????純??????????鐚? Modified Paths: -------------- branches/BRANCH_0043/o2on/admin/o2on.js branches/BRANCH_0043/o2on/admin/query.xsl branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h Modified: branches/BRANCH_0043/o2on/admin/o2on.js =================================================================== --- branches/BRANCH_0043/o2on/admin/o2on.js 2008-07-31 04:24:24 UTC (rev 113) +++ branches/BRANCH_0043/o2on/admin/o2on.js 2008-08-02 09:28:47 UTC (rev 114) @@ -355,22 +355,49 @@ // --------------------------------------------------------------------------- function deleteQuery(hash) { + if (hash == "") hash = getCheckThread(); + if (hash == "") return; document.d.act.value = "delete"; - document.d.hash.value = hash; + document.d.hash.value = hash; document.d.submit(); } function activateQuery(hash) { + if (hash == "") hash = getCheckThread(); + if (hash == "") return; document.d.act.value = "activate"; - document.d.hash.value = hash; + document.d.hash.value = hash; document.d.submit(); } function deactivateQuery(hash) { + if (hash == "") hash = getCheckThread(); + if (hash == "") return; document.d.act.value = "deactivate"; - document.d.hash.value = hash; + document.d.hash.value = hash; document.d.submit(); } +function checkAllThread(flag) +{ + elms = document.getElementsByTagName("input"); + for (i = 0; i < elms.length; i++) { + if (elms[i].type == "checkbox" && elms[i].name == "thread") + elms[i].checked = flag; + } +} +function getCheckThread() +{ + var hash = ""; + elms = document.getElementsByTagName("input"); + for (i = 0; i < elms.length; i++) { + if (elms[i].type == "checkbox" && elms[i].name == "thread" && elms[i].checked == true) { + if (hash != '') hash = hash + ','; + hash = hash + elms[i].value; + } + } + if (hash == "") alert("絲乗院???????????????"); + return hash; +} // --------------------------------------------------------------------------- // ?<??祉??吾??主??∝? Modified: branches/BRANCH_0043/o2on/admin/query.xsl =================================================================== --- branches/BRANCH_0043/o2on/admin/query.xsl 2008-07-31 04:24:24 UTC (rev 113) +++ branches/BRANCH_0043/o2on/admin/query.xsl 2008-08-02 09:28:47 UTC (rev 114) @@ -1,10 +1,10 @@ - - - - -
+ + + + +
?鴻????罎?刈 @@ -21,76 +21,82 @@ -
+
- - -
- - - + + + - -
+ + ?鴻??????+ + + + + + - +
- - - - - - - - - + +
茖???ユ????size?帥???? / ?<?URL / Hash
+ + + + + + + + + -
茖???ユ????size?帥???? / ?<?URL / Hash
+
-
- - - - + + + + + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - -
- - - - - - -
- - - -
+ + + + + + +
+ + + + + + +
+ + + + Modified: branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h 2008-07-31 04:24:24 UTC (rev 113) +++ branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h 2008-08-02 09:28:47 UTC (rev 114) @@ -636,12 +636,18 @@ // remove query it = hdr->queries.find("hash"); if (it != hdr->queries.end()) { - if (it->second.size() >= HASHSIZE*2) { - hashT hash; - hash.assign(it->second.c_str(), it->second.size()); - if (QueryDB->DeleteKey(hash)) { - msg = L"??????; - QueryDB->Save(Profile->GetQueryFilePath()); + strarray hasharray; + // comma separate + if (split(it->second.c_str(), ",", hasharray ) > 0) { + for (uint hashidx = 0; hashidx < hasharray.size(); hashidx++) { + if (hasharray[ hashidx ].size() >= HASHSIZE*2) { + hashT hash; + hash.assign( hasharray[ hashidx ].c_str(), hasharray[ hashidx ].size() ); + if (QueryDB->DeleteKey(hash)) { + msg = L"??????; + QueryDB->Save(Profile->GetQueryFilePath()); + } + } } } } @@ -650,12 +656,18 @@ // activate query it = hdr->queries.find("hash"); if (it != hdr->queries.end()) { - if (it->second.size() >= HASHSIZE*2) { - hashT hash; - hash.assign(it->second.c_str(), it->second.size()); - if (QueryDB->SetEnable(hash,true)) { - msg = L"???????"; - QueryDB->Save(Profile->GetQueryFilePath()); + strarray hasharray; + // comma separate + if (split(it->second.c_str(), ",", hasharray ) > 0) { + for (uint hashidx = 0; hashidx < hasharray.size(); hashidx++) { + if (hasharray[ hashidx ].size() >= HASHSIZE * 2) { + hashT hash; + hash.assign( hasharray[ hashidx ].c_str(), hasharray[ hashidx ].size() ); + if (QueryDB->SetEnable(hash,true)) { + msg = L"???????"; + QueryDB->Save(Profile->GetQueryFilePath()); + } + } } } } @@ -664,12 +676,18 @@ // deactivate query it = hdr->queries.find("hash"); if (it != hdr->queries.end()) { - if (it->second.size() >= HASHSIZE*2) { - hashT hash; - hash.assign(it->second.c_str(), it->second.size()); - if (QueryDB->SetEnable(hash,false)) { - msg = L"???????"; - QueryDB->Save(Profile->GetQueryFilePath()); + strarray hasharray; + // comma separate + if (split(it->second.c_str(), ",", hasharray ) > 0) { + for (uint hashidx = 0; hashidx < hasharray.size(); hashidx++) { + if (hasharray[ hashidx ].size() >= HASHSIZE * 2) { + hashT hash; + hash.assign( hasharray[ hashidx ].c_str(), hasharray[ hashidx ].size() ); + if (QueryDB->SetEnable(hash,false)) { + msg = L"???????"; + QueryDB->Save(Profile->GetQueryFilePath()); + } + } } } } From o2on-svn @ lists.sourceforge.jp Tue Aug 5 22:11:37 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Tue, 05 Aug 2008 22:11:37 +0900 Subject: [o2on-svn] =?utf-8?q?=5B115=5D_REVERT=3A_rev107_begin=3B_end=3B__?= =?utf-8?b?44KS5L2/44GG44Go5q2j5bi444Gr5YCk44GM5Y+W5b6X44Gn44GN44Gq44GE?= =?utf-8?b?54K6?= Message-ID: <1217941897.647150.27520.nullmailer@users.sourceforge.jp> Revision: 115 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=115 Author: k-uehara Date: 2008-08-05 22:11:37 +0900 (Tue, 05 Aug 2008) Log Message: ----------- REVERT: rev107 begin; end; を使うと正常に値が取得できない為 Revision Links: -------------- http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=107 Modified Paths: -------------- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-08-02 09:28:47 UTC (rev 114) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-08-05 13:11:37 UTC (rev 115) @@ -324,7 +324,7 @@ if (err != SQLITE_OK) goto error; - char sql[] = "begin;analyze;end; vacuum dat;"; + char sql[] = "analyze; vacuum dat;"; err = sqlite3_exec(db, sql, NULL, 0, 0); if (err != SQLITE_OK) @@ -814,10 +814,7 @@ sqlite3_busy_timeout(db, 5000); - wchar_t *sql = - L"begin;" - L"select count(*) from dat;" - L"end;"; + wchar_t *sql = L"select count(*) from dat;"; err = sqlite3_prepare16_v2(db, sql, wcslen(sql)*2, &stmt, NULL); if (err != SQLITE_OK) @@ -918,10 +915,7 @@ goto error; sqlite3_busy_timeout(db, 5000); - wchar_t *sql = - L"begin;" - L"select sum(disksize) from dat;" - L"end;"; + wchar_t *sql = L"select sum(disksize) from dat;"; err = sqlite3_prepare16_v2(db, sql, wcslen(sql)*2, &stmt, NULL); if (err != SQLITE_OK) From o2on-svn @ lists.sourceforge.jp Tue Aug 5 22:13:24 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Tue, 05 Aug 2008 22:13:24 +0900 Subject: [o2on-svn] =?utf-8?b?WzExNl0gRklYOiAgZGF044OV44Kh44Kk44Or44Gu5YWI?= =?utf-8?b?6aCt44GrTEbjgYzjgYLjgovjgajokL3jgaHjgos=?= Message-ID: <1217942004.202423.28832.nullmailer@users.sourceforge.jp> Revision: 116 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=116 Author: k-uehara Date: 2008-08-05 22:13:24 +0900 (Tue, 05 Aug 2008) Log Message: ----------- FIX: dat????ゃ???????LF???????純??? Modified Paths: -------------- branches/BRANCH_0043/o2on/src.o2on/O2DatIO.cpp Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatIO.cpp =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatIO.cpp 2008-08-05 13:11:37 UTC (rev 115) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatIO.cpp 2008-08-05 13:13:24 UTC (rev 116) @@ -278,6 +278,14 @@ while (pos_lf < end && p[pos_lf] != '\n') pos_lf++; + if (pos_lf == 0) { + if (Logger) { + Logger->AddLog(O2LT_WARNING, MODULE, 0, 0, + "??????ク?:???LF (%s)", path.c_str()); + } + return false; + } + if (pos_lf == end || p[pos_lf] != '\n') { if (Logger) { Logger->AddLog(O2LT_WARNING, MODULE, 0, 0, From o2on-svn @ lists.sourceforge.jp Sat Aug 9 15:52:21 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Sat, 09 Aug 2008 15:52:21 +0900 Subject: [o2on-svn] =?utf-8?b?WzExN10gIGJ1aWxkIDAwNDUg44Oq44Oq44O844K5?= Message-ID: <1218264741.093430.30349.nullmailer@users.sourceforge.jp> Revision: 117 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=117 Author: k-uehara Date: 2008-08-09 15:52:20 +0900 (Sat, 09 Aug 2008) Log Message: ----------- build 0045 ????若? Modified Paths: -------------- branches/BRANCH_0043/o2on/doc/history.txt branches/BRANCH_0043/o2on/src.o2on/O2Version.h Modified: branches/BRANCH_0043/o2on/doc/history.txt =================================================================== --- branches/BRANCH_0043/o2on/doc/history.txt 2008-08-05 13:13:24 UTC (rev 116) +++ branches/BRANCH_0043/o2on/doc/history.txt 2008-08-09 06:52:20 UTC (rev 117) @@ -1,3 +1,14 @@ +v0.02? (build 0045) 2008/08/09 +??????????????? +?DB????????? +?????dat??????????????? +???????????????? + - Boost 1.35.0 + - SQLite 3.6.0 +* ??????? +?SQL????????? +?DB???????dat????????? + v0.02? (build 0044) 2008/05/31 ?analyze??????????? ?datname?????????? Modified: branches/BRANCH_0043/o2on/src.o2on/O2Version.h =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2Version.h 2008-08-05 13:13:24 UTC (rev 116) +++ branches/BRANCH_0043/o2on/src.o2on/O2Version.h 2008-08-09 06:52:20 UTC (rev 117) @@ -4,7 +4,7 @@ #define APP_NAME "o2on" #define APP_VER_MAJOR 0 #define APP_VER_MINOR 2 -#define APP_BUILDNO 44 +#define APP_BUILDNO 45 #define APP_VER_PREFIX "alpha" #define APP_VER_FORMAT "%s %1d.%02d %s (build %04d)" #define USERAGENT_FORMAT "%s/%.1f (%s/%1d.%02d.%04d; %s)" \ No newline at end of file From o2on-svn @ lists.sourceforge.jp Sat Aug 9 16:02:12 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Sat, 09 Aug 2008 16:02:12 +0900 Subject: [o2on-svn] =?utf-8?b?WzExOF0gIOODu+aknOe0ouOCr+OCqOODquOBruS4gA==?= =?utf-8?b?5ous5aSJ5pu05qmf6IO96L+95Yqg?= Message-ID: <1218265332.056897.5242.nullmailer@users.sourceforge.jp> Revision: 118 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=118 Author: k-uehara Date: 2008-08-09 16:02:11 +0900 (Sat, 09 Aug 2008) Log Message: ----------- ・検索クエリの一括変更機能追加 ・DB再構築プロセス変更 ・無視板のdatリクエストを送らないようにした ・使用ライブラリバージョンアップ - Boost 1.35.0 - SQLite 3.6.0 * バグフィックス ・SQLの変数バインド忘れ ・DB再構築時に破損datで落ちることがある Added Paths: ----------- tags/build0045/ Copied: tags/build0045 (from rev 117, branches/BRANCH_0043) From o2on-svn @ lists.sourceforge.jp Sun Aug 10 13:32:54 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Sun, 10 Aug 2008 13:32:54 +0900 Subject: [o2on-svn] [119] replace trunk Message-ID: <1218342774.953075.8399.nullmailer@users.sourceforge.jp> Revision: 119 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=119 Author: k-uehara Date: 2008-08-10 13:32:54 +0900 (Sun, 10 Aug 2008) Log Message: ----------- replace trunk Removed Paths: ------------- trunk/o2on/ From o2on-svn @ lists.sourceforge.jp Sun Aug 10 13:34:15 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Sun, 10 Aug 2008 13:34:15 +0900 Subject: [o2on-svn] [120] replace trunk Message-ID: <1218342855.640240.9627.nullmailer@users.sourceforge.jp> Revision: 120 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=120 Author: k-uehara Date: 2008-08-10 13:34:15 +0900 (Sun, 10 Aug 2008) Log Message: ----------- replace trunk Added Paths: ----------- trunk/o2on/ Copied: trunk/o2on (from rev 119, branches/BRANCH_0043/o2on) From o2on-svn @ lists.sourceforge.jp Wed Sep 24 20:34:08 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Wed, 24 Sep 2008 20:34:08 +0900 Subject: [o2on-svn] =?utf-8?b?WzEyMV0gRklYOiAgIzEzMzk4IHF1ZXJ5bGltaXTjgYw=?= =?utf-8?b?5Y+N5pig44GV44KM44Gq44GE?= Message-ID: <1222256048.966496.21904.nullmailer@users.sourceforge.jp> Revision: 121 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=121 Author: k-uehara Date: 2008-09-24 20:34:08 +0900 (Wed, 24 Sep 2008) Log Message: ----------- FIX: #13398 querylimitが反映されない Ticket Links: :----------- http://sourceforge.jp/projects/o2on/tracker/detail/13398 Modified Paths: -------------- trunk/o2on/src.o2on/main.cpp Modified: trunk/o2on/src.o2on/main.cpp =================================================================== --- trunk/o2on/src.o2on/main.cpp 2008-08-10 04:34:15 UTC (rev 120) +++ trunk/o2on/src.o2on/main.cpp 2008-09-24 11:34:08 UTC (rev 121) @@ -423,6 +423,7 @@ SakuKeyDB->SetLimit(O2_SAKUKEY_LIMIT); QueryDB = new O2KeyDB(L"QueryDB", true, Logger); QueryDB->Load(Profile->GetQueryFilePath()); + QueryDB->SetLimit(Profile->GetQueryLimit()); SakuDB = new O2KeyDB(L"SakuDB", true, Logger); SakuDB->Load(Profile->GetSakuFilePath()); IMDB = new O2IMDB(Logger); From o2on-svn @ lists.sourceforge.jp Wed Sep 24 23:06:00 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Wed, 24 Sep 2008 23:06:00 +0900 Subject: [o2on-svn] =?utf-8?b?WzEyMl0gRklYOiAgIzEzNDkyIOS6jOmHjei1t+WLlQ==?= =?utf-8?b?44GX44KI44GG44Go44GZ44KL44Go5Yid5pyf44OO44O844OJ44GM5raI44GI?= =?utf-8?b?44KL?= Message-ID: <1222265160.097823.5348.nullmailer@users.sourceforge.jp> Revision: 122 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=122 Author: osa_p Date: 2008-09-24 23:05:59 +0900 (Wed, 24 Sep 2008) Log Message: ----------- FIX: #13492 二重起動しようとすると初期ノードが消える Ticket Links: :----------- http://sourceforge.jp/projects/o2on/tracker/detail/13492 Modified Paths: -------------- trunk/o2on/src.o2on/main.cpp Modified: trunk/o2on/src.o2on/main.cpp =================================================================== --- trunk/o2on/src.o2on/main.cpp 2008-09-24 11:34:08 UTC (rev 121) +++ trunk/o2on/src.o2on/main.cpp 2008-09-24 14:05:59 UTC (rev 122) @@ -254,6 +254,15 @@ //bench(); //return (0); + HANDLE Mutex = NULL; + if (!O2DEBUG) { + Mutex = CreateMutex(NULL, FALSE, _T(CLASS_NAME)); + if (GetLastError() == ERROR_ALREADY_EXISTS) { + if (Mutex) CloseHandle(Mutex); + return (0); + } + } + if (!O2DEBUG && FindWindow(_T(CLASS_NAME), NULL)) return (0); @@ -268,6 +277,9 @@ DispatchMessage(&msg); } } + + if (Mutex) CloseHandle(Mutex); + return ((int)msg.wParam); } From o2on-svn @ lists.sourceforge.jp Sat Sep 27 14:35:24 2008 From: o2on-svn @ lists.sourceforge.jp (o2on svn commit) Date: Sat, 27 Sep 2008 14:35:24 +0900 Subject: [o2on-svn] =?utf-8?b?WzEyM10gRklYOiAgIzEyNjYzIElQ5aSJ5pu05pmC44Gr?= =?utf-8?b?5qSc5Ye644Gn44GN44Gq44GE?= Message-ID: <1222493724.312949.20873.nullmailer@users.sourceforge.jp> Revision: 123 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=123 Author: osa_p Date: 2008-09-27 14:35:23 +0900 (Sat, 27 Sep 2008) Log Message: ----------- FIX: #12663 IP紊?????罎???с???? Ticket Links: :----------- http://sourceforge.jp/projects/o2on/tracker/detail/12663 Modified Paths: -------------- trunk/o2on/src.o2on/main.cpp Modified: trunk/o2on/src.o2on/main.cpp =================================================================== --- trunk/o2on/src.o2on/main.cpp 2008-09-24 14:05:59 UTC (rev 122) +++ trunk/o2on/src.o2on/main.cpp 2008-09-27 05:35:23 UTC (rev 123) @@ -2728,6 +2728,7 @@ ChangeTrayIcon(UINT id) { if (time(NULL) - Server_P2P->GetLastAcceptTime() < (5*60)) { + // ?????????????A???????? O ?????????????? switch (id) { case IDI_A: id = IDI_B; break; case IDI_A_IN: id = IDI_B_IN; break; @@ -2735,7 +2736,25 @@ case IDI_A_INOUT: id = IDI_B_INOUT; break; } } + else { + // Port0?????????????????????AIP???????????????? + // GetGlobalIP???????AP2P????????????P2P????? + // ???????????????????? + static time_t LastRestartP2P = 0; + if ((Profile->IsPort0() == false) && + (Job_GetGlobalIP->IsActive() == false) && + (time(NULL) - LastRestartP2P > (10*60) )) { + LastRestartP2P = time(NULL); + Profile->SetIP(0); + Job_GetGlobalIP->SetActive(true); + + StopP2P(false); + StartP2P(true); + + } + } + HICON icon = (HICON)LoadImage( instance, MAKEINTRESOURCE(id), IMAGE_ICON,