vikhrakula | 2 Jun 2008 16:25
Favicon

python-bindings problem


The following is how bindings was build
-----------------------------------------------------------------------------
vikhr <at> localhost:~/libtorrent/bindings/python$ bjam dht-support=on  
boost=source release link=static
BOOST_ROOT = /home/vikhr/boost
OS = LINUX
warning: Graph library does not contain optional GraphML reader.
note: to enable GraphML support, set EXPAT_INCLUDE and EXPAT_LIBPATH to the
note: directories containing the Expat headers and libraries, respectively.
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
Building Boost.Regex with the optional Unicode/ICU support disabled.
Please refer to the Boost.Regex documentation for more information
(don't panic: this is a strictly optional feature).
...patience...
...patience...
...found 5390 targets...
--------------------------------------------------------------------------------
Then I copied the example file 'simple_client.py' to the place where all the
modules reside..

________________________________________________________________________________
vikhr <at> localhost:~/libtorrent/bindings/python/bin/gcc-4.2.3/release/boost-source$ python  
simple_client.py
Traceback (most recent call last):
  File "simple_client.py", line 3, in <module>
    import libtorrent as lt
(Continue reading)

Per Hermansson | 2 Jun 2008 19:36

RC_0_13 wpath build error

Hi,
I'm unable to build libtorrent on Windows XP using mingw32 with the 
following command:

    bjam boost=source openssl=pe zlib=system character-set=unicode release

which results in the following output:

[...]
...failed updating 1 target...
...skipped 2 targets...
...updated 54 targets...

scrolling up I find the following output:

[...]
gcc.compile.c++ 
bin\gcc-mingw-3.4.5\release\boost-source\character-set-unicode\link-static\threading-multi\zlib-system\storage.o
src\storage.cpp: In function 
`std::vector<std::pair<libtorrent::size_type, time_t>, 
std::allocator<std::pair<libtorrent::size_type, time_t> > > 
libtorrent::get_filesizes(const 
libtorrent::torrent_info&,boost::filesystem::path)':
src\storage.cpp:269: error: `wpath' is not a member of `libtorrent::fs'
src\storage.cpp:269: error: expected `;' before "f"
src\storage.cpp:270: error: `f' was not declared in this scope
src\storage.cpp:270: error: `file_size' was not declared in this scope
[...]

I'm using libtorrent from svn using the RC_0_13 branch, zlib-1.2.3, 
(Continue reading)

Peter McNulty | 2 Jun 2008 20:16
Picon
Favicon

Build static client_test?

Hey,

Is it possible to build a static version of client_test so that I can move
the client_test application to another server and test it, without having to
install and rebuild boost and libtorrent - with logging enabled?

Using autotools, if I move the client_test application, it looks for
littorrent-0.13.so but can't find it obviously. Placing it in the same
directory doesn't help obviously because it's looking for it in /src/.libs/
directory (I believe).

Regards,
Peter

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
doclist | 3 Jun 2008 02:17
Picon

Mangle packets on_receive using plug-in

Is it possible to use the plug-in interface to mangle packets as they
are sent and received similar to the encryption functionality? It
would seem a hook into 'on_receive' would be necessary but the plug-in
interface does not appear to provide it.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
arvid | 3 Jun 2008 06:39
Picon
Picon
Favicon

Re: python-bindings problem

Quoting vikhrakula <at> asianetindia.com:
>
vikhr <at> localhost:~/libtorrent/bindings/python/bin/gcc-4.2.3/release/boost-source$
> python  
> simple_client.py
> Traceback (most recent call last):
>   File "simple_client.py", line 3, in <module>
>     import libtorrent as lt
>   IMPORTERROR: LIBBOOST_PYTHON-GCC42-1_35.SO.1.35.0: CANNOT OPEN  
> SHARED OBJECT FILE: NO SUCH FILE OR DIRECTORY
>
vikhr <at> localhost:~/libtorrent/bindings/python/bin/gcc-4.2.3/release/boost-source$

It sounds like you don't have boost.python installed. And the python binding was
built linking dynamically against it. Try either installing boost.python or
copying all the required boost libraries into that same directory as well.

I haven't really tried linking statically against the boost libraries when
building the python bindings. It is definitely possible though.

--

-- 
Arvid Norberg

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
arvid | 3 Jun 2008 06:41
Picon
Picon
Favicon

Re: RC_0_13 wpath build error

Quoting Per Hermansson <hermansson.per <at> bredband.net>:
> Hi,
> I'm unable to build libtorrent on Windows XP using mingw32 with the 
> following command:
> 
>     bjam boost=source openssl=pe zlib=system character-set=unicode release
> 
> which results in the following output:
> 
> [...]
> ...failed updating 1 target...
> ...skipped 2 targets...
> ...updated 54 targets...
> 
> scrolling up I find the following output:
> 
> [...]
> gcc.compile.c++ 
>
bin\gcc-mingw-3.4.5\release\boost-source\character-set-unicode\link-static\threading-multi\zlib-system\storage.o
> src\storage.cpp: In function 
> `std::vector<std::pair<libtorrent::size_type, time_t>, 
> std::allocator<std::pair<libtorrent::size_type, time_t> > > 
> libtorrent::get_filesizes(const 
> libtorrent::torrent_info&,boost::filesystem::path)':
> src\storage.cpp:269: error: `wpath' is not a member of `libtorrent::fs'
> src\storage.cpp:269: error: expected `;' before "f"
> src\storage.cpp:270: error: `f' was not declared in this scope
> src\storage.cpp:270: error: `file_size' was not declared in this scope
> [...]
(Continue reading)

arvid | 3 Jun 2008 06:43
Picon
Picon
Favicon

Re: Build static client_test?

Quoting Peter McNulty <petermcnulty <at> hotmail.com>:

> Hey,
> 
> Is it possible to build a static version of client_test so that I can move
> the client_test application to another server and test it, without having to
> install and rebuild boost and libtorrent - with logging enabled?
> 
> 
> Using autotools, if I move the client_test application, it looks for
> littorrent-0.13.so but can't find it obviously. Placing it in the same
> directory doesn't help obviously because it's looking for it in /src/.libs/
> directory (I believe).

I'm not too familiar with how to do things in autotools. If you build with
boost-build you do:

  bjam link=static

--

-- 
Arvid Norberg

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
arvid | 3 Jun 2008 06:52
Picon
Picon
Favicon

Re: Mangle packets on_receive using plug-in

Quoting doclist <dclist <at> gmail.com>:
> Is it possible to use the plug-in interface to mangle packets as they
> are sent and received similar to the encryption functionality?

Yes. The hook is called on_piece. It is called every time a piece packet is
received.

> It would seem a hook into 'on_receive' would be necessary but the plug-in
> interface does not appear to provide it.

You would (obviously) also have to make the pieces being sent in that mangled
format. That is probably a little bit tricker. You would have to implement
on_request and write a piece message to the send buffer. You would have to
return true from it as well, to signal to libtorrent that you handled the
message, so that libtorrent won't handle it. The tricky part here is to access
libtorrents internals and submit a disk io job, and write it to the send buffer
once the completion handler is called.

An alternative would be to introduce a new message to replace the piece message.
The availability for this new message would be negotiated as part of the
handshake.

If you're about to write a plugin, I would suggest to use trunk, because there
are some changes in there compared yo 0.13, that might prevent your code from
breaking once 0.14 is released.

--

-- 
Arvid Norberg

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

shidong chen | 4 Jun 2008 17:56
Picon

write fast_resume in session destructor

Hello everyone,

I try to write fast_resume for all torrents in destructor of session class
~session(). It works as expected on linux build, no hanging-on or crash
during shutdown. But my windows xp build cannot shut down normally. The
simple_client.exe will hang-on when shut down. Need ctrl-c to terminate it.
Sometime this even causes windows xp to make a crash report.

I could expect it work problem-free if it is done in main thread (such as in
main() of simple_client). But it is not convenient to get shutdown notice
from frontend in my target environment. So the best solution possible for me
is to write fastresume in destructor of session class or somewhere similar
automatically.

Any idea? Thanks in advance.

Shidong
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
arvid | 5 Jun 2008 17:52
Picon
Picon
Favicon

Re: write fast_resume in session destructor

Quoting shidong chen <shidongchen <at> gmail.com>:
> Hello everyone,
> 
> [...]
> I could expect it work problem-free if it is done in main thread (such as in
> main() of simple_client). But it is not convenient to get shutdown notice
> from frontend in my target environment. So the best solution possible for me
> is to write fastresume in destructor of session class or somewhere similar
> automatically.

So, you do get a shutdown-notice from the client somehow, because the session is
destructed. You need to be very careful when doing these things in the session
destructor. Could you post the modified session destructor source?

You need to make sure that you save the resume data before any of the
destruction happens. And you need to synchronize with the disk IO thread.

--

-- 
Arvid Norberg

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

Gmane