Mercurial > hg > orthanc-transfers
comparison Framework/TransferToolbox.h @ 10:c9e28e31262e
new option: MaxHttpRetries
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 04 Mar 2019 15:26:49 +0100 |
parents | 7e207ade2f1a |
children | b06103a50c95 |
comparison
equal
deleted
inserted
replaced
9:7e207ade2f1a | 10:c9e28e31262e |
---|---|
19 | 19 |
20 #pragma once | 20 #pragma once |
21 | 21 |
22 #include <stdint.h> | 22 #include <stdint.h> |
23 #include <string> | 23 #include <string> |
24 #include <json/value.h> | |
24 | 25 |
25 static const unsigned int KB = 1024; | 26 static const unsigned int KB = 1024; |
26 static const unsigned int MB = 1024 * 1024; | 27 static const unsigned int MB = 1024 * 1024; |
27 | 28 |
28 static const char* const JOB_TYPE_PULL = "PullTransfer"; | 29 static const char* const JOB_TYPE_PULL = "PullTransfer"; |
57 static const char* const URI_SEND = "/transfers/send"; | 58 static const char* const URI_SEND = "/transfers/send"; |
58 | 59 |
59 | 60 |
60 namespace OrthancPlugins | 61 namespace OrthancPlugins |
61 { | 62 { |
63 class OrthancPeers; | |
64 | |
62 enum BucketCompression | 65 enum BucketCompression |
63 { | 66 { |
64 BucketCompression_None, | 67 BucketCompression_None, |
65 BucketCompression_Gzip | 68 BucketCompression_Gzip |
66 }; | 69 }; |
70 unsigned int ConvertToKilobytes(uint64_t value); | 73 unsigned int ConvertToKilobytes(uint64_t value); |
71 | 74 |
72 BucketCompression StringToBucketCompression(const std::string& value); | 75 BucketCompression StringToBucketCompression(const std::string& value); |
73 | 76 |
74 const char* EnumerationToString(BucketCompression compression); | 77 const char* EnumerationToString(BucketCompression compression); |
78 | |
79 bool DoPostPeer(Json::Value& answer, | |
80 const OrthancPeers& peers, | |
81 size_t peerIndex, | |
82 const std::string& uri, | |
83 const std::string& body, | |
84 unsigned int maxRetries); | |
85 | |
86 bool DoPostPeer(Json::Value& answer, | |
87 const OrthancPeers& peers, | |
88 const std::string& peerName, | |
89 const std::string& uri, | |
90 const std::string& body, | |
91 unsigned int maxRetries); | |
92 | |
93 bool DoDeletePeer(const OrthancPeers& peers, | |
94 size_t peerIndex, | |
95 const std::string& uri, | |
96 unsigned int maxRetries); | |
75 } | 97 } |