Ignore:
Timestamp:
Dec 24, 2010, 8:58:41 AM (11 years ago)
Author:
charles
Message:

(trunk libT) #3836 "libevent2 support" -- finish moving to the libevent2 API mode. don't include the backwards-compatable API headers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpc-server.c

    r11548 r11588  
    2525#endif
    2626
    27 #include <event.h>
    28 #include <evhttp.h>
     27#include <event2/buffer.h>
     28#include <event2/event.h>
     29#include <event2/http.h>
     30#include <event2/http_struct.h> /* TODO: eventually remove this */
    2931
    3032#include "transmission.h"
     
    3840#include "rpcimpl.h"
    3941#include "rpc-server.h"
     42#include "session.h"
    4043#include "trevent.h"
    4144#include "utils.h"
     
    161164{
    162165    const char * content_type = evhttp_find_header( headers, "Content-Type" );
    163     const char * in = (const char*) EVBUFFER_DATA( body );
     166    const char * in = (const char*) evbuffer_pullup( body, -1 );
    164167    size_t inlen = evbuffer_get_length( body );
    165168
     
    278281                tr_bencToBuf( &top, TR_FMT_JSON, json );
    279282                tr_rpc_request_exec_json( server->session,
    280                                           EVBUFFER_DATA( json ),
     283                                          evbuffer_pullup( json, -1 ),
    281284                                          evbuffer_get_length( json ),
    282285                                          NULL, NULL );
     
    551554    {
    552555        tr_rpc_request_exec_json( server->session,
    553                                   EVBUFFER_DATA( req->input_buffer ),
     556                                  evbuffer_pullup( req->input_buffer, -1 ),
    554557                                  evbuffer_get_length( req->input_buffer ),
    555558                                  rpc_response_func, data );
     
    687690        addr.type = TR_AF_INET;
    688691        addr.addr.addr4 = server->bindAddress;
    689         server->httpd = evhttp_new( tr_eventGetBase( server->session ) );
    690         evhttp_bind_socket( server->httpd, tr_ntop_non_ts( &addr ),
    691                             server->port );
     692        server->httpd = evhttp_new( server->session->event_base );
     693        evhttp_bind_socket( server->httpd, tr_ntop_non_ts( &addr ), server->port );
    692694        evhttp_set_gencb( server->httpd, handle_request, server );
    693695
Note: See TracChangeset for help on using the changeset viewer.