@@ -60,6 +60,8 public: | |||
|
60 | 60 | QVariant status_code = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); |
|
61 | 61 | Response resp = Response(reply->readAll(), status_code.toInt()); |
|
62 | 62 | delete reply; |
|
63 | if(user!="" and passwd!="") | |
|
64 | auth.remove(url); | |
|
63 | 65 | return resp; |
|
64 | 66 | } |
|
65 | 67 | |
@@ -68,7 +70,7 public: | |||
|
68 | 70 | auto uuid = QUuid::createUuid(); |
|
69 | 71 | QNetworkRequest request = buildRequest(url, user, passwd); |
|
70 | 72 | QNetworkReply *reply = manager.get(request); |
|
71 | auto callback_wrapper = [uuid, callback, this](){ | |
|
73 | auto callback_wrapper = [url, uuid, callback, this](){ | |
|
72 | 74 | QNetworkReply* reply; |
|
73 | 75 | { |
|
74 | 76 | QWriteLocker locker(&pending_requests_lock); |
@@ -76,6 +78,7 public: | |||
|
76 | 78 | } |
|
77 | 79 | QVariant status_code = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); |
|
78 | 80 | Response resp = Response(reply->readAll(), status_code.toInt()); |
|
81 | auth.remove(url); | |
|
79 | 82 | delete reply; |
|
80 | 83 | callback(uuid, resp); |
|
81 | 84 | }; |
General Comments 0
You need to be logged in to leave comments.
Login now