Ignore:
Timestamp:
Mar 13, 2011, 12:18:11 AM (11 years ago)
Author:
jordan
Message:

(trunk libT) #117 "UDP tracker protocol support" -- working implementation; needs testing and valgrinding and review.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r12077 r12141  
    10291029         && !tr_urlParse( url, len, &scheme, NULL, NULL, NULL )
    10301030         && ( scheme != NULL )
    1031          && ( !strcmp(scheme,"http") || !strcmp(scheme,"https") );
     1031         && ( !strcmp(scheme,"http") || !strcmp(scheme,"https") || !strcmp(scheme,"udp") );
    10321032
    10331033    tr_free( scheme );
     
    16521652/***
    16531653****
     1654***/
     1655
     1656uint64_t
     1657tr_ntohll( uint64_t v )
     1658{
     1659#ifdef HAVE_NTOHLL
     1660    return ntohll( v );
     1661#else
     1662    union { unsigned long lv[2]; unsigned long long llv; } u;
     1663    u.lv[0] = ntohl(v >> 32);
     1664    u.lv[1] = ntohl(v & 0xFFFFFFFFULL);
     1665    return u.llv;
     1666#endif
     1667}
     1668
     1669uint64_t
     1670tr_htonll( uint64_t v )
     1671{
     1672#ifdef HAVE_HTONLL
     1673    return htonll( v );
     1674#else
     1675    union { unsigned long lv[2]; unsigned long long llv; } u;
     1676    u.lv[0] = htonl(v >> 32);
     1677    u.lv[1] = htonl(v & 0xFFFFFFFFULL);
     1678    return u.llv;
     1679#endif
     1680}
     1681
     1682/***
     1683****
    16541684****
    16551685****
Note: See TracChangeset for help on using the changeset viewer.