aboutsummaryrefslogtreecommitdiff
path: root/backends/networking/curl/curlrequest.h
AgeCommit message (Collapse)Author
2019-11-05NETWORKING: Enter SessionAlexander Tkachev
Session allows to reuse SessionRequests to the same host by making them keeping alive connection. Turns out, though, that libcurl already does that for us, and we didn't gain any speedup we thought we'd get. Usage: ``` Networking::Session s; Networking::SessionRequest *request = s.get(url); request->startAndWait(); warning("HTTP GET: %s", request->text()); s.close(); ``` You can still use SessionRequest without Session (but you can't put them on stack!): ``` Networking::SessionRequest *request = new Networking::SessionRequest(url); request->startAndWait(); warning("HTTP GET: %s", request->text()); request->close(); ```
2019-11-05NETWORKING: Add CurlRequest::wait()Alexander Tkachev
2016-09-03JANITORIAL: Make GPL headers uniformEugene Sandulenko
2016-08-24CLOUD: Update NetworkReadStream and CurlRequestAlexander Tkachev
Now those support POST multipart/form upload.
2016-08-24CLOUD: Add Request::date()Alexander Tkachev
Used in SavesSyncRequest to update Storage's last sync date.
2016-08-24CLOUD: Add GoogleDriveUploadRequestAlexander Tkachev
Includes NetworkReadStream PATCH method and Headers remembering feature.
2016-08-24CLOUD: Add OneDriveUploadRequestAlexander Tkachev
Doesn't support server's requested ranges yet. Commit also adds some PUT-related code in NetworkReadStream and CurlRequest.
2016-08-24CLOUD: Refactor RequestAlexander Tkachev
Added ErrorResponse and ErrorCallback. Each Request now has an ErrorCallback, which should be called instead of usual callback in case of failure.
2016-08-24CLOUD: Add DropboxUploadRequestAlexander Tkachev
2016-08-24Fix comment formattingPeter Bozsó
2016-08-24CLOUD: Add access to CurlRequest's StreamAlexander Tkachev
One can access CurlRequest's NetworkReadStream in order to find out HTTP response code or some other Stream-related data. OneDriveTokenRefresher uses it to print some info on that 404 error I'm trying to troubleshoot.
2016-08-24CLOUD: Refactor ConnectionManager/Requests systemAlexander Tkachev
ConnectionManager now storages Request * (not generates ids for it), Requests have control on their RequestState, RequestIdPair is now called Response and storages Request * with some response together. All related classes are changed to use it in more clean and understandable way. Request, RequestState and Response are carefully commented/documented.
2016-08-24CLOUD: Make OneDriveStorage::download() work fineAlexander Tkachev
Well, it takes two API calls instead of one now, but there are no problems with expired token because of it. This commit changes Storage::streamFile() to pass NetworkReadStream * through callback.
2016-08-24CLOUD: Add OneDriveTokenRefresherAlexander Tkachev
OneDriveTokenRefresher is a CurlJsonRequest replacement for OneDriveStorage methods. It behaves very similarly, but checks received JSON before passing it to user. If it contains "error" key, it attempts to refresh the token through OneDriveStorage, and then restarts the original request, so user won't notice that there ever was an error.
2016-08-24CLOUD: Change Request::handle()Alexander Tkachev
With new ConnectionManager upgrade Requests indicate that they are finished with RequestInfo.state. No need to use handle() return value anymore.
2016-08-24CLOUD: Add RequestIdPair structAlexander Tkachev
Can be used with Callback<T> (means it's still type safe). It's used to pass not only Request id to user's callback, but also a value user wanted. void *data field is removed from RequestInfo.
2016-08-24CLOUD: Add RequestInfo structAlexander Tkachev
ConnectionManager upgrade: it now contains a special struct for each request, so you can access request status and data by request id.
2016-08-24CLOUD: Add DownloadRequest stubAlexander Tkachev
It reads the passed NetworkReadStream and prints its contents onto console (for now). It would be writing contents into file. To simplify work with raw NetworkReadStream there is a new CurlRequest. It basically does nothing, but as ConnMan handles transfers only if there is an active Request, you need some Request to get NetworkReadStream working. Thus, there is a CurlRequest, which is active until NetworkReadStream is completely read. CurlRequest also has useful addHeader() and addPostField() methods in order to customize the request easily. Use execute() method to get its NetworkReadStream. DropboxStorage implements streamFile() and download() API methods. As DownloadRequest is incomplete, it is not actually downloading a file, though.