File: ProfileImageRequest.cpp

package info (click to toggle)
spectrum2 2.2.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,548 kB
  • sloc: cpp: 32,594; python: 1,751; javascript: 273; makefile: 34; sql: 31; xml: 10
file content (26 lines) | stat: -rw-r--r-- 721 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "ProfileImageRequest.h"
#include "../HTTPRequest.h"
DEFINE_LOGGER(profileImageRequestLogger, "ProfileImageRequest")
void ProfileImageRequest::run()
{
	HTTPRequest req;
	req.init();
	req.setProxy(ip, port, puser, ppasswd);
	success = req.GET(url, callbackdata);
	if(!success) error.assign(req.getCurlError());
}

void ProfileImageRequest::finalize()
{
	Error errResponse;
	if(!success) {
		LOG4CXX_ERROR(profileImageRequestLogger,  user << " - " << error);
		img = "";
		errResponse.setMessage(error);
		callBack(user, buddy, img, reqID, errResponse);
	} else {
		LOG4CXX_INFO(profileImageRequestLogger, user << " - " << callbackdata);
		img = callbackdata;
		callBack(user, buddy, img, reqID, errResponse);
	}
}