Changeset 4568
- Timestamp:
- 02/10/07 01:46:47 (2 years ago)
- Files:
-
- wired/trunk/wired/commands.c (modified) (2 diffs)
- wired/trunk/wired/files.c (modified) (5 diffs)
- wired/trunk/wired/main.c (modified) (3 diffs)
- wired/trunk/wired/server.c (modified) (4 diffs)
- wired/trunk/wired/transfers.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wired/trunk/wired/commands.c
r4508 r4568 231 231 232 232 while(client->state <= WD_CLIENT_STATE_LOGGED_IN) { 233 if(!pool)234 pool = wi_pool_init(wi_pool_alloc());235 236 233 do { 237 234 state = wi_socket_wait(client->socket, 0.1); … … 268 265 wd_parse_command(string); 269 266 270 if(++i % 10 == 0) { 271 wi_release(pool); 272 pool = NULL; 273 } 267 if(++i % 10 == 0) 268 wi_pool_drain(pool); 274 269 } 275 270 wired/trunk/wired/files.c
r4508 r4568 675 675 static void wd_files_search_index(wi_string_t *query) { 676 676 wd_client_t *client = wd_client(); 677 wi_pool_t *pool = NULL;677 wi_pool_t *pool; 678 678 wi_file_t *file; 679 679 wi_string_t *string; … … 699 699 range.location = 0; 700 700 701 pool = wi_pool_init(wi_pool_alloc()); 702 701 703 while(true) { 702 if(!pool)703 pool = wi_pool_init(wi_pool_alloc());704 705 704 string = wi_file_read_line(file); 706 705 … … 720 719 } 721 720 722 if(++i % 100 == 0) { 723 wi_release(pool); 724 pool = NULL; 725 } 721 if(++i % 100 == 0) 722 wi_pool_drain(pool); 726 723 } 727 724 … … 884 881 885 882 while((p = wi_fts_read(fts))) { 886 if(!pool)887 pool = wi_pool_init(wi_pool_alloc());888 889 883 /* skip item? */ 890 884 action = wd_files_fts_action(p, &error); … … 995 989 996 990 next: 997 if(++i % 100 == 0) { 998 wi_release(pool); 999 pool = NULL; 1000 } 991 if(++i % 100 == 0) 992 wi_pool_drain(pool); 1001 993 } 1002 994 wired/trunk/wired/main.c
r4509 r4568 253 253 wd_trackers_register(true); 254 254 255 wi_release(pool);256 pool = wi_pool_init(wi_pool_alloc());255 /* clean up pool after startup */ 256 wi_pool_drain(pool); 257 257 258 258 /* enter the signal handling thread in the main thread */ … … 425 425 426 426 while(wd_running) { 427 if(!pool)428 pool = wi_pool_init(wi_pool_alloc());429 430 427 signal = wd_wait_signals(); 431 428 … … 475 472 } 476 473 477 if(++i % 10 == 0) { 478 wi_release(pool); 479 pool = NULL; 480 } 474 if(++i % 10 == 0) 475 wi_pool_drain(pool); 481 476 } 482 477 wired/trunk/wired/server.c
r4558 r4568 278 278 279 279 while(wd_running) { 280 if(!pool)281 pool = wi_pool_init(wi_pool_alloc());282 283 280 /* accept new client */ 284 281 socket = wi_socket_accept_multiple(wd_control_sockets, wd_control_socket_context, 30.0, &address); … … 309 306 310 307 next: 311 if(++i % 10 == 0) { 312 wi_release(pool); 313 pool = NULL; 314 } 308 if(++i % 10 == 0) 309 wi_pool_drain(pool); 315 310 } 316 311 … … 332 327 333 328 while(wd_running) { 334 if(!pool)335 pool = wi_pool_init(wi_pool_alloc());336 337 329 /* accept new connection */ 338 330 socket = wi_socket_accept_multiple(wd_transfer_sockets, wd_transfer_socket_context, 30.0, &address); … … 382 374 383 375 next: 384 if(++i % 10 == 0) { 385 wi_release(pool); 386 pool = NULL; 387 } 376 if(++i % 10 == 0) 377 wi_pool_drain(pool); 388 378 } 389 379 wired/trunk/wired/transfers.c
r4508 r4568 628 628 629 629 while(transfer->state == WD_TRANSFER_RUNNING) { 630 if(!pool)631 pool = wi_pool_init(wi_pool_alloc());632 633 630 /* read data */ 634 631 bytes = read(fd, buffer, sizeof(buffer)); … … 691 688 } 692 689 693 if(++i % 100 == 0) { 694 wi_release(pool); 695 pool = NULL; 696 } 690 if(++i % 100 == 0) 691 wi_pool_drain(pool); 697 692 } 698 693 … … 769 764 770 765 while(transfer->state == WD_TRANSFER_RUNNING) { 771 if(!pool)772 pool = wi_pool_init(wi_pool_alloc());773 774 766 /* wait for timeout */ 775 767 do { … … 832 824 } 833 825 834 if(++i % 100 == 0) { 835 wi_release(pool); 836 pool = NULL; 837 } 826 if(++i % 100 == 0) 827 wi_pool_drain(pool); 838 828 } 839 829
