Changeset 14070 for trunk/libtransmission/web.c
- Timestamp:
- Apr 13, 2013, 8:25:28 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/web.c
r14024 r14070 27 27 #include "log.h" 28 28 #include "net.h" /* tr_address */ 29 #include "torrent.h" 29 30 #include "platform.h" /* mutex */ 30 31 #include "session.h" … … 63 64 struct tr_web_task 64 65 { 66 int torrentId; 65 67 long code; 66 68 long timeout_secs; … … 235 237 ****/ 236 238 237 struct tr_web_task *238 tr_webRun (tr_session * session,239 const char * url,240 const char * range,241 const char * cookies,242 tr_web_done_func done_func,243 void * done_func_user_data)244 {245 return tr_webRunWithBuffer (session, url, range, cookies,246 done_func, done_func_user_data,247 NULL);248 }249 250 239 static void tr_webThreadFunc (void * vsession); 251 240 252 struct tr_web_task * 253 tr_webRunWithBuffer (tr_session * session, 254 const char * url, 255 const char * range, 256 const char * cookies, 257 tr_web_done_func done_func, 258 void * done_func_user_data, 259 struct evbuffer * buffer) 241 static struct tr_web_task * 242 tr_webRunImpl (tr_session * session, 243 int torrentId, 244 const char * url, 245 const char * range, 246 const char * cookies, 247 tr_web_done_func done_func, 248 void * done_func_user_data, 249 struct evbuffer * buffer) 260 250 { 261 251 struct tr_web_task * task = NULL; … … 273 263 task = tr_new0 (struct tr_web_task, 1); 274 264 task->session = session; 265 task->torrentId = torrentId; 275 266 task->url = tr_strdup (url); 276 267 task->range = tr_strdup (range); … … 288 279 289 280 return task; 281 } 282 283 struct tr_web_task * 284 tr_webRunWithCookies (tr_session * session, 285 const char * url, 286 const char * cookies, 287 tr_web_done_func done_func, 288 void * done_func_user_data) 289 { 290 return tr_webRunImpl (session, -1, url, 291 NULL, cookies, 292 done_func, done_func_user_data, 293 NULL); 294 } 295 296 struct tr_web_task * 297 tr_webRun (tr_session * session, 298 const char * url, 299 tr_web_done_func done_func, 300 void * done_func_user_data) 301 { 302 return tr_webRunWithCookies (session, url, NULL, 303 done_func, done_func_user_data); 304 } 305 306 307 struct tr_web_task * 308 tr_webRunWebseed (tr_torrent * tor, 309 const char * url, 310 const char * range, 311 tr_web_done_func done_func, 312 void * done_func_user_data, 313 struct evbuffer * buffer) 314 { 315 return tr_webRunImpl (tor->session, tr_torrentId (tor), url, 316 range, NULL, 317 done_func, done_func_user_data, 318 buffer); 290 319 } 291 320
Note: See TracChangeset
for help on using the changeset viewer.