Code Monkey home page Code Monkey logo

libtorrent's Introduction

LibTorrent

Copyright (C) 2005-2014, Jari Sundell

LICENSE

 GNU GPL, see COPYING. "libtorrent/src/utils/sha_fast.{cc,h}" is
originally from the Mozilla NSS and is under a triple license; MPL,
LGPL and GPL. An exception to non-NSS code has been added for linking
to OpenSSL as requested by Debian, though the author considers that
library to be part of the Operative System and thus linking is allowed
according to the GPL.

 Use whatever fits your purpose, the code required to compile with
Mozilla's NSS implementation of SHA1 has been retained and can be
compiled if the user wishes to avoid using OpenSSL.

CONTACT

 Jari Sundell

 Skomakerveien 33
 3185 Skoppum, NORWAY

 Send bug reports, suggestions and patches to
<[email protected]> or to the mailinglist.

libtorrent's People

Contributors

afontenot avatar anthonyryan1 avatar compnerd avatar edwardbetts avatar extravagant avatar ffontaine avatar glebius avatar jesec avatar kannibalox avatar klusark avatar neheb avatar nicholi avatar obi1 avatar pastly avatar paulbalomiri avatar pyroscope avatar rakshasa avatar robertborg avatar ss23 avatar taylorchu avatar vladmovchan avatar winterqt avatar x-cela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

libtorrent's Issues

undefined behaviour in random.h

Binaries built with clang 14 segfault when calling random_char() (and probably random_uniform_char() and random_uint8 too)

According to this uniform_int_distribution is undefined for char and int8, and clang is generating code that segfaults.

This patch seems to work for me, but I'm don't know much C++.

diff --git a/include/torrent/utils/random.h b/include/torrent/utils/random.h
index 76b51e2e..ffd00567 100644
--- a/include/torrent/utils/random.h
+++ b/include/torrent/utils/random.h
@@ -32,7 +32,7 @@ static thread_local auto dist_uint32 = uniform_dist<uint32_t>();

 inline char
 random_char() {
-  return dist_char(mt32);
+  return static_cast<char>(random_uniform_template(0, 255, mt32));
 }

 inline int32_t
@@ -47,7 +47,7 @@ random_int64() {

 inline uint8_t
 random_uint8() {
-  return dist_uint8(mt32);
+  return static_cast<uint8_t>(random_uniform_template(0, 255, mt32));
 }

 inline uint32_t
@@ -56,8 +56,8 @@ random_uint32() {
 }

 inline char
-random_uniform_char(char min, char max) {
-  return random_uniform_template(min, max, mt32);
+random_uniform_char(uint32_t min, uint32_t max) {
+  return static_cast<char>(random_uniform_template(min, max, mt32));
 }

 inline size_t

Add build instructions

On the https://github.com/jesec/rtorrent page it states that building libtorrent is required before building rTorrent where amongst other instructions it says:

# Compile and install libtorrent (matching version required)
# Check README of libtorrent for instructions

Unfortunately the readme file in the libtorrent repo does not contain any building instructions.

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.