Compare commits
	
		
			7 Commits
		
	
	
		
			v3.1.0
			...
			feature/ht
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					a788b31080 | ||
| 
						 | 
					03a2f1443b | ||
| 
						 | 
					6e0463c981 | ||
| 
						 | 
					e9399a0734 | ||
| 
						 | 
					7b2ddb5e7c | ||
| 
						 | 
					c7cb743a69 | ||
| 
						 | 
					3257ad1363 | 
@@ -1 +1 @@
 | 
				
			|||||||
docker/Dockerfile.alpine
 | 
					docker/Dockerfile.ubuntu_artful
 | 
				
			||||||
@@ -169,15 +169,18 @@ namespace ix
 | 
				
			|||||||
    std::pair<HttpResponsePtr, std::string> SentryClient::send(const Json::Value& msg,
 | 
					    std::pair<HttpResponsePtr, std::string> SentryClient::send(const Json::Value& msg,
 | 
				
			||||||
                                                               bool verbose)
 | 
					                                                               bool verbose)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        std::string log;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        auto args = _httpClient.createRequest();
 | 
					        auto args = _httpClient.createRequest();
 | 
				
			||||||
        args->extraHeaders["X-Sentry-Auth"] = SentryClient::computeAuthHeader();
 | 
					        args->extraHeaders["X-Sentry-Auth"] = SentryClient::computeAuthHeader();
 | 
				
			||||||
        args->connectTimeout = 60;
 | 
					        args->connectTimeout = 60;
 | 
				
			||||||
        args->transferTimeout = 5 * 60;
 | 
					        args->transferTimeout = 5 * 60;
 | 
				
			||||||
        args->followRedirects = true;
 | 
					        args->followRedirects = true;
 | 
				
			||||||
        args->verbose = verbose;
 | 
					        args->verbose = verbose;
 | 
				
			||||||
        args->logger = [](const std::string& msg)
 | 
					        args->logger = [&log](const std::string& msg)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            spdlog::info("request logger: {}", msg);
 | 
					            log += msg;
 | 
				
			||||||
 | 
					            std::cout << msg;
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        std::string body = computePayload(msg);
 | 
					        std::string body = computePayload(msg);
 | 
				
			||||||
@@ -193,7 +196,7 @@ namespace ix
 | 
				
			|||||||
            spdlog::info("Upload size: {}", response->uploadSize);
 | 
					            spdlog::info("Upload size: {}", response->uploadSize);
 | 
				
			||||||
            spdlog::info("Download size: {}", response->downloadSize);
 | 
					            spdlog::info("Download size: {}", response->downloadSize);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            spdlog::info("Status: {}", response->statusCode);
 | 
					            std::cerr << "Status: " << response->statusCode << std::endl;
 | 
				
			||||||
            if (response->errorCode != HttpErrorCode::Ok)
 | 
					            if (response->errorCode != HttpErrorCode::Ok)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                spdlog::info("error message: {}", response->errorMsg);
 | 
					                spdlog::info("error message: {}", response->errorMsg);
 | 
				
			||||||
@@ -205,6 +208,6 @@ namespace ix
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return std::make_pair(response, body);
 | 
					        return std::make_pair(response, log);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
} // namespace ix
 | 
					} // namespace ix
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,6 +10,7 @@
 | 
				
			|||||||
#if defined(IXWEBSOCKET_USE_MBED_TLS)
 | 
					#if defined(IXWEBSOCKET_USE_MBED_TLS)
 | 
				
			||||||
# include <mbedtls/md.h>
 | 
					# include <mbedtls/md.h>
 | 
				
			||||||
#elif defined(__APPLE__)
 | 
					#elif defined(__APPLE__)
 | 
				
			||||||
 | 
					#  include <ixwebsocket/IXSocketMbedTLS.h>
 | 
				
			||||||
# include <CommonCrypto/CommonHMAC.h>
 | 
					# include <CommonCrypto/CommonHMAC.h>
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
# include <openssl/hmac.h>
 | 
					# include <openssl/hmac.h>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -47,12 +47,12 @@ namespace ix
 | 
				
			|||||||
        std::condition_variable progressCondition;
 | 
					        std::condition_variable progressCondition;
 | 
				
			||||||
        std::queue<Json::Value> queue;
 | 
					        std::queue<Json::Value> queue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        auto sentrySender = [&condition, &progressCondition, &conditionVariableMutex,
 | 
					 | 
				
			||||||
                             &queue, verbose, &errorSending, &sentCount,
 | 
					 | 
				
			||||||
                             &stop, &dsn]
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
        SentryClient sentryClient(dsn);
 | 
					        SentryClient sentryClient(dsn);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        auto sentrySender = [&condition, &progressCondition, &conditionVariableMutex,
 | 
				
			||||||
 | 
					                             &queue, verbose, &errorSending, &sentCount,
 | 
				
			||||||
 | 
					                             &stop, &sentryClient]
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
            while (true)
 | 
					            while (true)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Json::Value msg;
 | 
					                Json::Value msg;
 | 
				
			||||||
@@ -70,8 +70,8 @@ namespace ix
 | 
				
			|||||||
                if (response->statusCode != 200)
 | 
					                if (response->statusCode != 200)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    spdlog::error("Error sending data to sentry: {}", response->statusCode);
 | 
					                    spdlog::error("Error sending data to sentry: {}", response->statusCode);
 | 
				
			||||||
                    spdlog::error("Body: {}", ret.second);
 | 
					 | 
				
			||||||
                    spdlog::error("Response: {}", response->payload);
 | 
					                    spdlog::error("Response: {}", response->payload);
 | 
				
			||||||
 | 
					                    spdlog::error("Log: {}", ret.second);
 | 
				
			||||||
                    errorSending = true;
 | 
					                    errorSending = true;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
@@ -192,6 +192,6 @@ namespace ix
 | 
				
			|||||||
            pool[i].join();
 | 
					            pool[i].join();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return (strict && errorSending) ? 1 : 0;
 | 
					        return 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user