mirror of
				https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
				synced 2025-11-03 20:27:45 +00:00 
			
		
		
		
	Compare commits
	
		
			7 Commits
		
	
	
		
			openapi-fi
			...
			v2.5.1
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					acad0cd99f | ||
| 
						 | 
					7f675733df | ||
| 
						 | 
					4f1d05467f | ||
| 
						 | 
					27bffaa734 | ||
| 
						 | 
					b005b57137 | ||
| 
						 | 
					2bae52e67e | ||
| 
						 | 
					7766fe08cd | 
@@ -1,12 +1,12 @@
 | 
			
		||||
dependencies:
 | 
			
		||||
- name: postgresql
 | 
			
		||||
  repository: https://charts.bitnami.com/bitnami
 | 
			
		||||
  repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
 | 
			
		||||
  version: 10.9.2
 | 
			
		||||
- name: mysql
 | 
			
		||||
  repository: https://charts.bitnami.com/bitnami
 | 
			
		||||
  repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
 | 
			
		||||
  version: 8.8.3
 | 
			
		||||
- name: mariadb
 | 
			
		||||
  repository: https://charts.bitnami.com/bitnami
 | 
			
		||||
  repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
 | 
			
		||||
  version: 9.4.2
 | 
			
		||||
digest: sha256:1fdae7cbea906e41dccd8618ff9e2c68d0c684724ae27c79a12bb6089968df5c
 | 
			
		||||
generated: "2021-08-17T12:18:40.341427893+03:00"
 | 
			
		||||
digest: sha256:e9df5a5d8a0a193bfda33ea06060203aace01f0f7df9eda662a84185322c7ab5
 | 
			
		||||
generated: "2022-06-03T15:38:31.063022252+03:00"
 | 
			
		||||
 
 | 
			
		||||
@@ -5,14 +5,14 @@ name: owgw
 | 
			
		||||
version: 0.1.0
 | 
			
		||||
dependencies:
 | 
			
		||||
- name: postgresql
 | 
			
		||||
  repository: https://charts.bitnami.com/bitnami
 | 
			
		||||
  repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
 | 
			
		||||
  version: 10.9.2
 | 
			
		||||
  condition: postgresql.enabled
 | 
			
		||||
- name: mysql
 | 
			
		||||
  repository: https://charts.bitnami.com/bitnami
 | 
			
		||||
  repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
 | 
			
		||||
  version: 8.8.3
 | 
			
		||||
  condition: mysql.enabled
 | 
			
		||||
- name: mariadb
 | 
			
		||||
  repository: https://charts.bitnami.com/bitnami
 | 
			
		||||
  repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
 | 
			
		||||
  version: 9.4.2
 | 
			
		||||
  condition: mariadb.enabled
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ fullnameOverride: ""
 | 
			
		||||
images:
 | 
			
		||||
  owgw:
 | 
			
		||||
    repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owgw
 | 
			
		||||
    tag: master
 | 
			
		||||
    tag: v2.5.1
 | 
			
		||||
    pullPolicy: Always
 | 
			
		||||
#    regcred:
 | 
			
		||||
#      registry: tip-tip-wlan-cloud-ucentral.jfrog.io
 | 
			
		||||
 
 | 
			
		||||
@@ -258,21 +258,35 @@ namespace OpenWifi {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	bool WSConnection::ExtractBase64CompressedData(const std::string &CompressedData,
 | 
			
		||||
												   std::string &UnCompressedData) {
 | 
			
		||||
												   std::string &UnCompressedData, uint64_t compress_sz) {
 | 
			
		||||
		std::istringstream ifs(CompressedData);
 | 
			
		||||
		Poco::Base64Decoder b64in(ifs);
 | 
			
		||||
		std::ostringstream ofs;
 | 
			
		||||
		Poco::StreamCopier::copyStream(b64in, ofs);
 | 
			
		||||
 | 
			
		||||
		unsigned long MaxSize = ofs.str().size() * 10;
 | 
			
		||||
		int factor = 20;
 | 
			
		||||
		unsigned long MaxSize = compress_sz ? (unsigned long) (compress_sz + 5000) : (unsigned long) (ofs.str().size() * factor);
 | 
			
		||||
		while(true) {
 | 
			
		||||
			std::vector<uint8_t> UncompressedBuffer(MaxSize);
 | 
			
		||||
			unsigned long FinalSize = MaxSize;
 | 
			
		||||
		if (uncompress((uint8_t *)&UncompressedBuffer[0], &FinalSize, (uint8_t *)ofs.str().c_str(),
 | 
			
		||||
					   ofs.str().size()) == Z_OK) {
 | 
			
		||||
			auto status = uncompress((uint8_t *)&UncompressedBuffer[0], &FinalSize,
 | 
			
		||||
									 (uint8_t *)ofs.str().c_str(), ofs.str().size());
 | 
			
		||||
			if(status==Z_OK) {
 | 
			
		||||
				UncompressedBuffer[FinalSize] = 0;
 | 
			
		||||
				UnCompressedData = (char *)&UncompressedBuffer[0];
 | 
			
		||||
				return true;
 | 
			
		||||
			}
 | 
			
		||||
			if(status==Z_BUF_ERROR) {
 | 
			
		||||
				if(factor<300) {
 | 
			
		||||
					factor+=10;
 | 
			
		||||
					MaxSize = ofs.str().size() * factor;
 | 
			
		||||
					continue;
 | 
			
		||||
				} else {
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -300,9 +314,13 @@ namespace OpenWifi {
 | 
			
		||||
		auto ParamsObj = Doc->get(uCentralProtocol::PARAMS).extract<Poco::JSON::Object::Ptr>();
 | 
			
		||||
		if (ParamsObj->has(uCentralProtocol::COMPRESS_64)) {
 | 
			
		||||
			std::string UncompressedData;
 | 
			
		||||
			uint64_t compress_sz = 0 ;
 | 
			
		||||
			if(ParamsObj->has("compress_sz")) {
 | 
			
		||||
				compress_sz = ParamsObj->get("compress_sz");
 | 
			
		||||
			}
 | 
			
		||||
			try {
 | 
			
		||||
				if (ExtractBase64CompressedData(
 | 
			
		||||
						ParamsObj->get(uCentralProtocol::COMPRESS_64).toString(), UncompressedData)) {
 | 
			
		||||
						ParamsObj->get(uCentralProtocol::COMPRESS_64).toString(), UncompressedData, compress_sz)) {
 | 
			
		||||
					poco_trace(Logger(),Poco::format("EVENT(%s): Found compressed payload expanded to '%s'.",
 | 
			
		||||
													  CId_, UncompressedData));
 | 
			
		||||
					Poco::JSON::Parser Parser;
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,8 @@ namespace OpenWifi {
 | 
			
		||||
		void OnSocketShutdown(const Poco::AutoPtr<Poco::Net::ShutdownNotification>& pNf);
 | 
			
		||||
		void OnSocketError(const Poco::AutoPtr<Poco::Net::ErrorNotification>& pNf);
 | 
			
		||||
		bool LookForUpgrade(uint64_t UUID);
 | 
			
		||||
		static bool ExtractBase64CompressedData(const std::string & CompressedData, std::string & UnCompressedData);
 | 
			
		||||
		static bool ExtractBase64CompressedData(const std::string &CompressedData,
 | 
			
		||||
												std::string &UnCompressedData, uint64_t compress_sz);
 | 
			
		||||
		void LogException(const Poco::Exception &E);
 | 
			
		||||
		inline Poco::Logger & Logger() { return Logger_; }
 | 
			
		||||
		bool SetWebSocketTelemetryReporting(uint64_t interval, uint64_t TelemetryWebSocketTimer);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user