source: trunk/libtransmission/web.h @ 12168

Last change on this file since 12168 was 12168, checked in by jordan, 11 years ago

(trunk) #4081 "Add 'cookieString' argument 'torrent-add' method in RPC" -- done.

  • Property svn:keywords set to Date Rev Author Id
File size: 2.5 KB
Line 
1/*
2 * This file Copyright (C) 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 12168 2011-03-15 04:22:47Z jordan $
11 */
12
13#ifndef TR_HTTP_H
14#define TR_HTTP_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20struct tr_address;
21
22void tr_webInit( tr_session * session );
23
24typedef enum
25{
26    TR_WEB_CLOSE_WHEN_IDLE,
27    TR_WEB_CLOSE_NOW
28}
29tr_web_close_mode;
30
31/**
32 * This is a mechanism for adjusting your CURL* object to match
33 * the host OS's platform-dependent settings.
34 *
35 * A use case for this function is to call curl_easy_setopt() on curl_pointer.
36 *
37 * Examples of curl_easy_setopt() can be found at
38 * http://curl.haxx.se/libcurl/c/curl_easy_setopt.html()
39 */
40void tr_sessionSetWebConfigFunc( tr_session * session, void (*config)(tr_session * session, void * curl_pointer, const char * url ) );
41
42
43void tr_webClose( tr_session * session, tr_web_close_mode close_mode );
44
45typedef void ( tr_web_done_func )( tr_session       * session,
46                                   tr_bool            timeout_flag,
47                                   tr_bool            did_connect_flag,
48                                   long               response_code,
49                                   const void       * response,
50                                   size_t             response_byte_count,
51                                   void             * user_data );
52
53const char * tr_webGetResponseStr( long response_code );
54
55void tr_webRun( tr_session        * session,
56                const char        * url,
57                const char        * range,
58                const char        * cookies,
59                tr_web_done_func    done_func,
60                void              * done_func_user_data );
61
62struct evbuffer;
63
64void tr_webRunWithBuffer( tr_session         * session,
65                          const char         * url,
66                          const char         * range,
67                          const char         * cookies,
68                          tr_web_done_func     done_func,
69                          void               * done_func_user_data,
70                          struct evbuffer    * buffer );
71
72void tr_http_escape( struct evbuffer *out, const char *str, int len, tr_bool escape_slashes );
73
74void tr_http_escape_sha1( char * out, const uint8_t * sha1_digest );
75
76char* tr_http_unescape( const char * str, int len );
77
78#ifdef __cplusplus
79}
80#endif
81
82#endif
Note: See TracBrowser for help on using the repository browser.