Ignore:
Timestamp:
Nov 6, 2007, 4:02:50 PM (15 years ago)
Author:
charles
Message:

use Thomas Bernard's miniupnp library instead of rolling our own.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/metainfo.c

    r3473 r3731  
    3232#include <unistd.h> /* unlink, stat */
    3333
     34#include <miniupnp/miniwget.h> /* parseURL */
     35
    3436#include "transmission.h"
    3537#include "bencode.h"
    3638#include "crypto.h" /* tr_sha1 */
    37 #include "http.h" /* tr_httpParseUrl */
    3839#include "metainfo.h"
    3940#include "platform.h"
    4041#include "utils.h"
     42
     43
     44static int
     45tr_httpParseUrl( const char * url_in, int len,
     46                 char ** setme_host, int * setme_port, char ** setme_path )
     47{
     48    char * url = tr_strndup( url_in, len );
     49    char * path;
     50    char host[4096+1];
     51    unsigned short port;
     52    int success;
     53
     54    success = parseURL( url, host, &port, &path );
     55
     56    if( success ) {
     57        *setme_host = tr_strdup( host );
     58        *setme_port = port;
     59        *setme_path = tr_strdup( path );
     60    }
     61
     62    tr_free( url );
     63
     64    return !success;
     65}
    4166
    4267/***********************************************************************
Note: See TracChangeset for help on using the changeset viewer.