Giter Site home page Giter Site logo

libed2k's People

Contributors

a-pavlov avatar isharov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libed2k's Issues

Compilation errors

Hi, i'm trying to compile your library under archlinux and I have got some errors.
I think that those errors are related to newer version of boost library.
First error:

/home/felice/libed2k/include/libed2k/error_code.hpp:174:29: error: ‘get_system_category’ is not a member of ‘boost::system’; did you mean ‘system_category’? 174 | { return boost::system::get_system_category(); } | ^~~~~~~~~~~~~~~~~~~ | system_category /home/felice/libed2k/include/libed2k/error_code.hpp: In function ‘const boost::system::error_category& libed2k::get_posix_category()’: /home/felice/libed2k/include/libed2k/error_code.hpp:181:29: error: ‘get_generic_category’ is not a member of ‘boost::system’; did you mean ‘generic_category’? 181 | { return boost::system::get_generic_category(); } | ^~~~~~~~~~~~~~~~~~~~ | generic_category

I solved these two errors by replacing "get_system_category" with "system_category" and "get_generic_category" with "generic_category".

The compilation goes on but stops again on the following error:

/home/felice/libed2k/src/broadcast_socket.cpp:284:69: error: no matching function for call to ‘boost::asio::basic_datagram_socket<boost::asio::ip::udp>::basic_datagram_socket(libed2k::io_service&)’ 284 | boost::shared_ptr<datagram_socket> s(new datagram_socket(ios)); | ^

Any ideas for this?
Regards.

unrecognized command line option ‘-m64’

I am building this on a arm based ubuntu system.When I use command make , there is an error: c++: error: unrecognized command line option ‘-m64’.Here are all command I have runed:

root@localhost:~# git clone https://github.com/qmule/libed2k.git
Cloning into 'libed2k'...
remote: Enumerating objects: 10339, done.
remote: Total 10339 (delta 0), reused 0 (delta 0), pack-reused 10339
Receiving objects: 100% (10339/10339), 7.56 MiB | 96.00 KiB/s, done.
Resolving deltas: 100% (6512/6512), done.
root@localhost:~# cd libed2k/
root@localhost:~/libed2k# ls
CMakeLists.txt  README.md  SConstruct  cmake  docs  include  libed2k  logging.zip  src  test  unit
root@localhost:~/libed2k# mkdir build
root@localhost:~/libed2k# cd build/
root@localhost:~/libed2k/build# ls
root@localhost:~/libed2k/build# cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 64 bits compiler detected
-- DATA_MODEL is not set. Use platform 64
-- DATA_MODEL      = 64
-- PRODUCTION      = OFF
-- BUILD_TESTS     = ON
-- BUILD_TOOLS     = ON
-- BUILD_SHARED    = OFF
-- DHT  = enabled
-- DHT_VERBOSE  = OFF
-- UPNP_VERBOSE = OFF
-- C++ compiler version: 7.5.0 [/usr/bin/c++]
-- Boost 1.40 found.
-- Found Boost components:
   system;thread;random;date_time;unit_test_framework;unit_test_framework   
 -- Configuring done
-- Generating done   
-- Build files have been written to: /root/libed2k/build                                                        
root@localhost:~/libed2k/build# make
Scanning dependencies of target ed2k                                                                            
[  1%] Building CXX object CMakeFiles/ed2k.dir/src/ConvertUTF.cpp.o
c++: error: unrecognized command line option ‘-m64’                    
CMakeFiles/ed2k.dir/build.make:62: recipe for target' CMakeFiles/ed2k.dir/src/ConvertUTF.cpp.o' failed
make[2]: *** [CMakeFiles/ed2k.dir/src/ConvertUTF.cpp.o] Error 1              
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/ed2k.dir/all' failed        
make[1]: *** [CMakeFiles/ed2k.dir/all] Error 2                         
Makefile:83: recipe for target 'all' failed                                                                     
make: *** [all] Error 2

What can I do to solve this?

Bitset format

Hi, I'm coding an ed2k library on my own, for learning purpose and I'm using libed2k as a reference,
since there is no so much detailed documentation on ed2k protocol.
First of all, congratulations for this great work!

I have a doubt about the format of the part status field which is sent in the peer File Status Answer message.
Initially, I thought that, i-th bit of the bitfield was stored at byte offset i / 8 (and bit offset i % 8), and this is also confirmed by libed2k.
However, when downloading files made of only a single part (while testing my own library), I found that peers holding the entire file send the following single-byte bitfield: 00000001. Naturally, I expected the following bitfield: 10000000 (also according to libed2k).
So I suspect that the format of the bitfield is "reversed", that is to say one should compute the offset of the i-th bit starting from the end of the stream (going from right to left).

I also noticed that, in this case, because of the function "clear_trailing_bits", libed2k would have cleared the last bit set to one,
giving a zero bitfield, but I don't think this is correct (if the peer didn't get the only part the file is made of, he wouldn't send the part status field, setting the field "downloadedParts" to 0, instead of 1).

Can you give an explanation to such behaviour?

Build error in arch linux

OS:Arch linux

Build log:

[ed@desktopserver build]$ cmake ..
CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

-- 64 bits compiler detected
-- DATA_MODEL is not set. Use platform 64
-- DATA_MODEL = 64
-- PRODUCTION = OFF
-- BUILD_TESTS = ON
-- BUILD_TOOLS = ON
-- BUILD_SHARED = OFF
-- DHT = enabled
-- DHT_VERBOSE = OFF
-- UPNP_VERBOSE = OFF
-- C++ compiler version: 2.1.0 [/usr/bin/c++]
-- Found Boost: /usr/lib64/cmake/Boost-1.78.0/BoostConfig.cmake (found suitable version "1.78.0", minimum required is "1.40") found components: system thread random date_time unit_test_framework unit_test_framework
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ed/libed2k/build
[ed@desktopserver build]$ sudo make
[ 1%] Building CXX object CMakeFiles/ed2k.dir/src/ConvertUTF.cpp.o
[ 2%] Building CXX object CMakeFiles/ed2k.dir/src/add_transfer_params.cpp.o
在從下述位置 include 的檔案: /home/ed/libed2k/include/libed2k/escape_string.hpp:41,
來自 /home/ed/libed2k/include/libed2k/peer_id.hpp:45,
來自 /home/ed/libed2k/include/libed2k/hasher.hpp:6,
來自 /home/ed/libed2k/include/libed2k/add_transfer_params.hpp:4,
來自 /home/ed/libed2k/src/add_transfer_params.cpp:1:
/home/ed/libed2k/include/libed2k/error_code.hpp: 在函式 「const boost::system::error_category& libed2k::get_system_category()」 中:
/home/ed/libed2k/include/libed2k/error_code.hpp:174:29: 錯誤:「get_system_category」 is not a member of 「boost::system」; did you mean 「system_category」?
174 | { return boost::system::get_system_category(); }
| ^~~~~~~~~~~~~~~~~~~
| system_category
/home/ed/libed2k/include/libed2k/error_code.hpp: 在函式 「const boost::system::error_category& libed2k::get_posix_category()」 中:
/home/ed/libed2k/include/libed2k/error_code.hpp:181:29: 錯誤:「get_generic_category」 is not a member of 「boost::system」; did you mean 「generic_category」?
181 | { return boost::system::get_generic_category(); }
| ^~~~~~~~~~~~~~~~~~~~
| generic_category
在從下述位置 include 的檔案: /home/ed/libed2k/include/boost/logging/detail/tss/tss_impl.hpp:54,
來自 /home/ed/libed2k/include/boost/logging/detail/tss/tss.hpp:30,
來自 /home/ed/libed2k/include/boost/logging/detail/ts/ts_resource.hpp:25,
來自 /home/ed/libed2k/include/boost/logging/detail/fwd.hpp:31,
來自 /home/ed/libed2k/include/boost/logging/logging.hpp:24,
來自 /home/ed/libed2k/include/boost/logging/detail/format_fwd_detail.hpp:24,
來自 /home/ed/libed2k/include/boost/logging/format_fwd.hpp:25,
來自 /home/ed/libed2k/include/libed2k/log.hpp:6,
來自 /home/ed/libed2k/src/add_transfer_params.cpp:2:
/home/ed/libed2k/include/boost/logging/detail/tss/tss_impl_pthread.hpp: 在函式 「boost::logging::detail::tss_libed2k_pods* boost::logging::detail::get_libed2k_pods()」 中:
/home/ed/libed2k/include/boost/logging/detail/tss/tss_impl_pthread.hpp:42:14: 警告:「template class std::auto_ptr」 is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
42 | std::auto_ptr<tss_libed2k_pods> temp( new_object_ensure_delete<tss_libed2k_pods>() );
| ^~~~~~~~
在從下述位置 include 的檔案: /usr/include/c++/12.1.0/memory:76,
來自 /usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:35,
來自 /usr/include/boost/smart_ptr/detail/shared_count.hpp:27,
來自 /usr/include/boost/smart_ptr/shared_ptr.hpp:17,
來自 /usr/include/boost/shared_ptr.hpp:17,
來自 /home/ed/libed2k/include/libed2k/error_code.hpp:6:
/usr/include/c++/12.1.0/bits/unique_ptr.h:64:28: 附註:在此声明
64 | template class auto_ptr;
| ^~~~~~~~
make[2]: *** [CMakeFiles/ed2k.dir/build.make:90:CMakeFiles/ed2k.dir/src/add_transfer_params.cpp.o] 錯誤 1
make[1]: *** [CMakeFiles/Makefile2:91:CMakeFiles/ed2k.dir/all] 錯誤 2
make: *** [Makefile:91:all] 錯誤 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.