Konishchev Dmitry | 1 May 09:13 2009
Picon

Re: Unexpected file_error_alert

I added abort() call into libtorrent::file_error_alert::file_error_alert
and this is what I got in my debugger (for libtorrent 0.14.3):
> #0  __kernel_vsyscall () at :0
> #1  raise () at :0
> #2  abort () at :0
> #3  file_error_alert (this=0xb632c010, f=, h=, msg_=) at ../include/libtorrent/alert_types.hpp:912
> #4  libtorrent::peer_connection::on_disk_read_complete (this=0xb225cce0, ret=-1, j=, r=) at peer_connection.cpp:3157
> #5  boost::detail::function::void_function_obj_invoker2<boost::_bi::bind_t<void,
boost::_mfi::mf3<void, libtorrent::peer_connection, int, libtorrent::disk_io_job const&,
libtorrent::peer_request>,
boost::_bi::list4<boost::_bi::value<boost::intrusive_ptr<libtorrent::peer_connection> >,
boost::arg<1>, boost::arg<2>, boost::_bi::value<libtorrent::peer_request> > >, void, int,
libtorrent::disk_io_job const&>::invoke (function_obj_ptr=, a0=-1, a1=) at /usr/include/boost/bind/mem_fn_template.hpp:375
> #6  boost::function2<void, int, libtorrent::disk_io_job const&>::operator() (this=0xb632c124,
a0=-1, a1=) at /usr/include/boost/function/function_template.hpp:989
> #7 
boost::asio::detail::handler_queue::handler_wrapper<boost::_bi::bind_t<boost::_bi::unspecified,
boost::function<void ()(int, libtorrent::disk_io_job const&)>,
boost::_bi::list2<boost::_bi::value<int>, boost::_bi::value<libtorrent::disk_io_job> > >
>::do_call (base=0xb213d7d0) at /usr/include/boost/bind.hpp:292
> #8  boost::asio::detail::task_io_service<boost::asio::detail::epoll_reactor<false> >::run
(this=0x9d00330, ec=) at /usr/include/boost/asio/detail/handler_queue.hpp:39
> #9  libtorrent::aux::session_impl::operator() (this=0x9d006f8) at /usr/include/boost/asio/impl/io_service.ipp:65
> #10  boost::detail::thread_data<boost::reference_wrapper<libtorrent::aux::session_impl>
>::run (this=0x9d0ae38) at /usr/include/boost/thread/detail/thread.hpp:81
> #11  thread_proxy () at :0
> #12  start_thread () at :0
> #13  clone () at :0

------------------------------------------------------------------------------
(Continue reading)

Konishchev Dmitry | 2 May 10:53 2009
Picon

Re: Unexpected file_error_alert

I think that this is happen because of the line 546 in the
src/storage.cpp:
> if (exists(old_path)) rename(old_path, new_path);

I changed it to
> if (exists(old_path) && old_path != new_path) rename(old_path, new_path);
and the alert was not generated yet (I will test it more time). But I am
not yet understand, why with
> if (exists(old_path)) rename(old_path, new_path);
the alert is generated after some time after torrent client startup (for
seeding torrents). Or it is normal because of asynchronous work?

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
Konishchev Dmitry | 2 May 16:24 2009
Picon

torrent_handle::move_storage() error reporting

It would be better if torrent_handle::move_storage() would work by the
following scheme:
* After torrent_handle::move_storage() call files would copy from the
  old location to the new location, and current
  torrent_handle::save_path() would not changed.
* If there is any error while files copying, all copied files would
  removed, user would get move_storage_failed_alert and
  torrent_handle::save_path() keep it's old value. 
* If all files has been copied successfully, torrent_handle::save_path()
  would setted to the new value, storage_moved_alert is generated, and all
  old files is deleted.

If user will interrupt program on any of this steps, storage will not be
broken, except of if will be interrupted at the third stage, when
torrent's settings will written to the disk. But programmer can avoid
this by writing to config old and new target path before
torrent_handle::move_storage() call: then at program startup after it's
interrupted work it can analyse both them paths and determine, which of
them is brocken and which is not.

Now torrent_handle::move_storage() is absolutely have no protection from
errors, which is may occur while it's call. For example, when there is
no space left on the target drive, or when such file is already exists.

Is this is hard to realize?

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
(Continue reading)

Chandika Bhandari | 4 May 09:28 2009
Picon

building a c++/cli project out of libtorrent

Wondering if anyone of you tried to create a C++/CLI wrapper around
libtorrent? I got it working except (so I thought) that it crashes at
shutdown. My executable is a simple .NET console application that references
managed types exposed by C++/CLI assembly which in essence wraps the
libtorrent dll. I don't think it's the libtorrrent's fault - it's how the
C++/CLI binds with the runtime -  atexit handler registered is a managed
method which is invalid at this time because CLR is about to shutdown.

There are some hacky workarounds for managed c++ (pre C++/CLI), not sure if
I understand them fully to take the plunge.

Note: I tried BOOST_ALL_DYN_LINK.

0017f77c 71396509 KERNEL32!RaiseException+0x58
0017f798 71325a97 mscorwks!COMPlusThrowBoot+0x4a
0017f7ac 71171a8a mscorwks!StubRareDisableTHROWWorker+0x26
0017f80c 5550af7c mscorwks!StubRareDisableTHROW+0x9
0017f848 5550b190 Libtorrent_managed2!_CRT_INIT+0x26c
[f:\dd\vctools\crt_bld\self_x86\crt\src\crtdll.c  <at>  446]
0017f88c 5550b051 Libtorrent_managed2!__DllMainCRTStartup+0x130
[f:\dd\vctools\crt_bld\self_x86\crt\src\crtdll.c  <at>  557]
0017f8a0 71ca7f1f Libtorrent_managed2!_DllMainCRTStartup+0x21
[f:\dd\vctools\crt_bld\self_x86\crt\src\crtdll.c  <at>  507]
0017f8dc 7700a604 mscoree!_CorDllMain+0xd3
0017f8fc 76fda303 ntdll!LdrpCallInitRoutine+0x14
0017f99c 76fda38e ntdll!LdrShutdownProcess+0x182
0017f9a4 76add862 ntdll!RtlExitUserProcess+0x64
0017f9b8 712dc3a4 KERNEL32!ExitProcess+0x12
0017fbe0 711f04a0 mscorwks!SafeExitProcess+0x157
0017fc30 71c97c24 mscorwks!DisableRuntime+0xdc
(Continue reading)

Hua Su | 4 May 17:57 2009
Picon

Can't set the global download rate limit

Hi,
I set the global download rate limit to 20KB/s using
session::set_download_rate_limit(20480), but the total download rate still
can reach up to several mega bytes per seconds (such as 4~5MB/s) when there
are several other peers in my local network. Anyone else running into this
problem? Or it is not a bug but a feature that the global download rate
doesn't apply to peers in the same local network?

- Hua
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
lesion | 4 May 18:39 2009

Re: Can't set the global download rate limit

On 05/04/2009 05:57 PM, Hua Su wrote:
> Hi,
> I set the global download rate limit to 20KB/s using
> session::set_download_rate_limit(20480), but the total download rate still
> can reach up to several mega bytes per seconds (such as 4~5MB/s) when there
> are several other peers in my local network. Anyone else running into this
> problem? Or it is not a bug but a feature that the global download rate
> doesn't apply to peers in the same local network?

from
http://www.rasterbar.com/products/libtorrent/manual.html#set-upload-rate-limit-set-download-rate-limit-upload-rate-limit-download-rate-limit

Upload and download rate limits are not applied to peers on the local
network by default. To change that, see
session_settings::ignore_limits_on_local_network.

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
Hua Su | 5 May 04:42 2009
Picon

Re: Can't set the global download rate limit

On Tue, May 5, 2009 at 12:39 AM, <lesion <at> fluido-app.org> wrote:

> On 05/04/2009 05:57 PM, Hua Su wrote:
> > Hi,
> > I set the global download rate limit to 20KB/s using
> > session::set_download_rate_limit(20480), but the total download rate
> still
> > can reach up to several mega bytes per seconds (such as 4~5MB/s) when
> there
> > are several other peers in my local network. Anyone else running into
> this
> > problem? Or it is not a bug but a feature that the global download rate
> > doesn't apply to peers in the same local network?
>
> from
>
> http://www.rasterbar.com/products/libtorrent/manual.html#set-upload-rate-limit-set-download-rate-limit-upload-rate-limit-download-rate-limit
>

Oops, I read the doc extracted from libtorrent-rasterbar-0.14.3.tar.gz. It
seems that the doc in this package is a little out of date. Maybe I should
always read the online version. Thanks.

>
> Upload and download rate limits are not applied to peers on the local
> network by default. To change that, see
> session_settings::ignore_limits_on_local_network.

Is there any way to set separate download/upload limits for peers on local
network? Typically I have more bandwith on local network (10Mbps~100Mbps)
(Continue reading)

arvid | 5 May 09:00 2009
Picon
Picon

Re: building a c++/cli project out of libtorrent

Quoting Chandika Bhandari <chanbhan <at> gmail.com>:

> Wondering if anyone of you tried to create a C++/CLI wrapper around
> libtorrent?

At least one person I know of has built a .net wrapper. He never got around to
show it to me or release it though.

Would you be interested in contributing this wrapper the the project? it would
live under /bindings/.net/ (or something like that).

> I got it working except (so I thought) that it crashes at
> shutdown. My executable is a simple .NET console application that references
> managed types exposed by C++/CLI assembly which in essence wraps the
> libtorrent dll. I don't think it's the libtorrrent's fault - it's how the
> C++/CLI binds with the runtime -  atexit handler registered is a managed
> method which is invalid at this time because CLR is about to shutdown.

The only thing I can think of off-hand that uses atexit() would be boost.thread,
to clean up TLS objects. libtorrent doesn't use TLSes though, so it might be
possible to exclude those files from the build to see if it works then.

> There are some hacky workarounds for managed c++ (pre C++/CLI), not sure if
> I understand them fully to take the plunge.
> 
> Note: I tried BOOST_ALL_DYN_LINK.
> 
> 0017f77c 71396509 KERNEL32!RaiseException+0x58
> 0017f798 71325a97 mscorwks!COMPlusThrowBoot+0x4a
> 0017f7ac 71171a8a mscorwks!StubRareDisableTHROWWorker+0x26
(Continue reading)

arvid | 5 May 09:08 2009
Picon
Picon

Re: Can't set the global download rate limit

Quoting Hua Su <huas.su <at> gmail.com>:
> Is there any way to set separate download/upload limits for peers on local
> network? Typically I have more bandwith on local network (10Mbps~100Mbps)
> than on internet (1Mbps~4Mbps). If global limits apply to peers on local
> network, we can't utilize the the large bandwith to obtain faster download
> speed. On the other side, if global limits are totally ignored on local
> network, it might get so fast to download files from peers on local network
> that the disk io bandwidth is consumed completely and OS is non-responsive
> until the download is finished. So, maybe it's better to set limits for
> local network and internet separately.

That seems like a reasonable feature. I'll put that down in my todo-list. I just
so happens to have made some changes to the rate limiter recently that makes
this quite simple. Only in trunk though, so it would be a feature for 0.15.

--

-- 
Arvid Norberg

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
Hua Su | 5 May 09:44 2009
Picon

Re: Can't set the global download rate limit

On Tue, May 5, 2009 at 3:08 PM, <arvid <at> cs.umu.se> wrote:

> Quoting Hua Su <huas.su <at> gmail.com>:
> > Is there any way to set separate download/upload limits for peers on
> local
> > network? Typically I have more bandwith on local network (10Mbps~100Mbps)
> > than on internet (1Mbps~4Mbps). If global limits apply to peers on local
> > network, we can't utilize the the large bandwith to obtain faster
> download
> > speed. On the other side, if global limits are totally ignored on local
> > network, it might get so fast to download files from peers on local
> network
> > that the disk io bandwidth is consumed completely and OS is
> non-responsive
> > until the download is finished. So, maybe it's better to set limits for
> > local network and internet separately.
>
> That seems like a reasonable feature. I'll put that down in my todo-list. I
> just
> so happens to have made some changes to the rate limiter recently that
> makes
> this quite simple. Only in trunk though, so it would be a feature for 0.15.
>

Good news! Is there any plan to release 0.15?

>
> --
> Arvid Norberg
>
(Continue reading)


Gmane