source: trunk/libtransmission/web.h @ 11512

Last change on this file since 11512 was 11512, checked in by charles, 11 years ago

(trunk) #3817 "use the OS' proxy support" -- implemented for libtransmission, transmission-gtk

  • Property svn:keywords set to Date Rev Author Id
File size: 1.9 KB
Line 
1/*
2 * This file Copyright (C) 2008-2010 Mnemosyne LLC
3 *
4 * This file is licensed by the GPL version 2.  Works owned by the
5 * Transmission project are granted a special exemption to clause 2(b)
6 * so that the bulk of its code can remain under the MIT license.
7 * This exemption does not extend to derived works not owned by
8 * the Transmission project.
9 *
10 * $Id: web.h 11512 2010-12-10 18:51:05Z charles $
11 */
12
13#ifndef TR_HTTP_H
14#define TR_HTTP_H
15
16struct tr_address;
17
18void tr_webInit( tr_session * session );
19
20typedef enum
21{
22    TR_WEB_CLOSE_WHEN_IDLE,
23    TR_WEB_CLOSE_NOW
24}
25tr_web_close_mode;
26
27/**
28 * This is a mechanism for adjusting your CURL* object to match
29 * the host OS's platform-dependent settings.
30 *
31 * A use case for this function is to call curl_easy_setopt() on curl_pointer.
32 *
33 * Examples of curl_easy_setopt() can be found at
34 * http://curl.haxx.se/libcurl/c/curl_easy_setopt.html()
35 */
36void tr_sessionSetWebConfigFunc( tr_session * session, void (*config)(tr_session * session, void * curl_pointer, const char * url ) );
37
38
39void tr_webClose( tr_session * session, tr_web_close_mode close_mode );
40
41typedef void ( tr_web_done_func )( tr_session       * session,
42                                   long               response_code,
43                                   const void       * response,
44                                   size_t             response_byte_count,
45                                   void             * user_data );
46
47const char * tr_webGetResponseStr( long response_code );
48
49void         tr_webRun( tr_session        * session,
50                        const char        * url,
51                        const char        * range,
52                        tr_web_done_func    done_func,
53                        void              * done_func_user_data );
54
55struct evbuffer;
56
57void tr_http_escape( struct evbuffer *out, const char *str, int len, tr_bool escape_slashes );
58
59char* tr_http_unescape( const char * str, int len );
60
61#endif
Note: See TracBrowser for help on using the repository browser.