mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-14 12:12:21 +00:00
Add proper declarations for MHD result >=v0.9.71
This commit is contained in:
parent
b9b168eff0
commit
013038c2ff
5 changed files with 28 additions and 6 deletions
2
.github/workflows/ccpp-win64.yml
vendored
2
.github/workflows/ccpp-win64.yml
vendored
|
@ -38,7 +38,7 @@ jobs:
|
|||
|
||||
- name: Install OpenSSL Win64
|
||||
run: |
|
||||
curl -o openssl.msi https://slproweb.com/download/Win64OpenSSL-1_1_1i.msi
|
||||
curl -o openssl.msi https://slproweb.com/download/Win64OpenSSL-1_1_1j.msi
|
||||
msiexec /i openssl.msi /quiet /qn /norestart
|
||||
|
||||
- name: Build ton
|
||||
|
|
10
README.md
Normal file
10
README.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
## "Soft" Pull Request rules
|
||||
|
||||
* Thou shall not merge your own PRs, at least one person should review the PR and merge it (4-eyes rule)
|
||||
* Thou shall make sure that workflows are cleanly completed for your PR before considering merge
|
||||
|
||||
## Workflows responsibility
|
||||
If a CI workflow fails not because of your changes but workflow issues, try to fix it yourself or contact one of the persons listed below via Telegram messenger:
|
||||
|
||||
* **C/C++ CI (ccpp-linux.yml)**: TBD
|
||||
* **C/C++ CI Win64 Compile (ccpp-win64.yml)**: TBD
|
|
@ -260,7 +260,7 @@ class CoreActor : public CoreActorInterface {
|
|||
CoreActor() {
|
||||
}
|
||||
|
||||
static int get_arg_iterate(void* cls, enum MHD_ValueKind kind, const char* key, const char* value) {
|
||||
static MHD_RESULT get_arg_iterate(void* cls, enum MHD_ValueKind kind, const char* key, const char* value) {
|
||||
auto X = static_cast<std::map<std::string, std::string>*>(cls);
|
||||
if (key && value && std::strlen(key) > 0 && std::strlen(value) > 0) {
|
||||
X->emplace(key, urldecode(td::Slice{value}, false));
|
||||
|
@ -277,7 +277,7 @@ class CoreActor : public CoreActorInterface {
|
|||
~HttpRequestExtra() {
|
||||
MHD_destroy_post_processor(postprocessor);
|
||||
}
|
||||
static int iterate_post(void* coninfo_cls, enum MHD_ValueKind kind, const char* key, const char* filename,
|
||||
static MHD_RESULT iterate_post(void* coninfo_cls, enum MHD_ValueKind kind, const char* key, const char* filename,
|
||||
const char* content_type, const char* transfer_encoding, const char* data, uint64_t off,
|
||||
size_t size) {
|
||||
auto ptr = static_cast<HttpRequestExtra*>(coninfo_cls);
|
||||
|
@ -305,10 +305,10 @@ class CoreActor : public CoreActorInterface {
|
|||
}
|
||||
}
|
||||
|
||||
static int process_http_request(void* cls, struct MHD_Connection* connection, const char* url, const char* method,
|
||||
static MHD_RESULT process_http_request(void* cls, struct MHD_Connection* connection, const char* url, const char* method,
|
||||
const char* version, const char* upload_data, size_t* upload_data_size, void** ptr) {
|
||||
struct MHD_Response* response = nullptr;
|
||||
int ret;
|
||||
MHD_RESULT ret;
|
||||
|
||||
bool is_post = false;
|
||||
if (std::strcmp(method, "GET") == 0) {
|
||||
|
|
|
@ -31,9 +31,21 @@
|
|||
#include "td/utils/buffer.h"
|
||||
#include "ton/ton-types.h"
|
||||
#include "td/utils/port/IPAddress.h"
|
||||
#include <microhttpd.h>
|
||||
|
||||
#define MAX_POST_SIZE (64 << 10)
|
||||
|
||||
// Beginning with v0.9.71, libmicrohttpd changed the return type of most
|
||||
// functions from int to enum MHD_Result
|
||||
// https://git.gnunet.org/gnunet.git/tree/src/include/gnunet_mhd_compat.h
|
||||
// proposes to define a constant for the return type so it works well
|
||||
// with all versions of libmicrohttpd
|
||||
#if MHD_VERSION >= 0x00097002
|
||||
#define MHD_RESULT enum MHD_Result
|
||||
#else
|
||||
#define MHD_RESULT int
|
||||
#endif
|
||||
|
||||
extern bool local_scripts_;
|
||||
|
||||
class CoreActorInterface : public td::actor::Actor {
|
||||
|
|
|
@ -960,7 +960,7 @@ void FullNodeShardImpl::got_neighbour_capabilities(adnl::AdnlNodeIdShort adnl_id
|
|||
it->second.query_failed();
|
||||
} else {
|
||||
it->second.update_proto_version(*F.move_as_ok().get());
|
||||
it->second.update_roundtrip(t);
|
||||
it->second.query_success(t);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue