Skip to content

Commit 0b31321

Browse files
author
garenwang
committed
quic重置
1 parent 1615d87 commit 0b31321

File tree

9 files changed

+112
-17
lines changed

9 files changed

+112
-17
lines changed

QCloudQuic.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
1010
s.name = "QCloudQuic"
1111

1212

13-
s.version = "6.3.3"
13+
s.version = "6.3.2"
1414

1515

1616
s.summary = "QCloudQuic 腾讯云iOS-SDK组件"

QCloudQuic/Classes/QCloudBase/QCloudQuicConfig.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,26 @@ NS_ASSUME_NONNULL_BEGIN
4242
@property (nonatomic, assign) NSInteger tcp_port;
4343
// 设置拥塞算法,默认值即为BBR
4444
@property (nonatomic,assign)QCloudCongestionType congestion_type;
45+
46+
// ConnectWithDomain get ipv6 ip if true, false defaultly.
47+
@property (nonatomic,assign) bool support_v6_;
48+
49+
@property (nonatomic,assign) bool isCongetionOptimizationEnabled_;
50+
51+
@property (nonatomic,assign) NSInteger mp_strategy_;
52+
53+
// The max receive window for a whole session.
54+
// unit is bytes, default is 15 MB, max is 24 MB
55+
// The window size of session must be larger than
56+
// a single stream's size. This size affects all
57+
// the streams within this session.
58+
@property (nonatomic,assign) NSUInteger nSessionMaxRecvWindowSize;
59+
60+
// The max receive window for a single stream
61+
// unit is bytes, default is 6 MB, max is 16 MB
62+
@property (nonatomic,assign) NSUInteger nStreamMaxRecvWindowSize;
63+
// 默认:true
64+
@property (nonatomic,assign) bool use_session_reuse_;
4565
@end
4666

4767
NS_ASSUME_NONNULL_END

QCloudQuic/Classes/QCloudBase/QCloudQuicConfig.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ - (instancetype)init
3232
self.race_type = QCloudRaceTypeOnlyQUIC;
3333
self.congestion_type = QCloudCongestionTypeBBR;
3434
self.is_custom = NO;
35+
self.use_session_reuse_ = NO;
3536
return self;
3637
}
3738
@end

QCloudQuic/Classes/QCloudBase/TquicConnection.mm

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,25 @@ -(void)onHandleQuicRequest:(TquicRequest *)quicRequest didConnect:(TquicRequest
265265
}
266266
config.race_type = raceType;
267267
config.total_timeout_millisec_ =[QCloudQuicConfig shareConfig].total_timeout_millisec_;
268+
269+
config.support_v6_ = [QCloudQuicConfig shareConfig].support_v6_;
270+
271+
config.isCongetionOptimizationEnabled_ = [QCloudQuicConfig shareConfig].isCongetionOptimizationEnabled_;
272+
config.mp_strategy_ = [QCloudQuicConfig shareConfig].mp_strategy_;
273+
268274
config.connect_timeout_millisec_ = [QCloudQuicConfig shareConfig].connect_timeout_millisec_;
275+
if ([QCloudQuicConfig shareConfig].nStreamMaxRecvWindowSize > 0) {
276+
config.nStreamMaxRecvWindowSize = [QCloudQuicConfig shareConfig].nStreamMaxRecvWindowSize;
277+
}
278+
279+
if ([QCloudQuicConfig shareConfig].nSessionMaxRecvWindowSize > 0) {
280+
config.nSessionMaxRecvWindowSize = [QCloudQuicConfig shareConfig].nSessionMaxRecvWindowSize;
281+
}
282+
config.use_session_reuse_ = [QCloudQuicConfig shareConfig].use_session_reuse_;
283+
269284
// 设置连接空闲时间,单位为ms,默认值为与服务端协商值,一般为90000ms
270285
config.idle_timeout_millisec_ = [QCloudQuicConfig shareConfig].idle_timeout_millisec_;
271286
config.is_custom_ = [QCloudQuicConfig shareConfig].is_custom;
272-
config.use_session_reuse_ = NO;
273287
request_sp.reset(new TnetQuicRequest(tquic_delegate_sp.get(),config));
274288
tquic_delegate_sp.get()->request_sp = request_sp;
275289
self.quicReqeust = quicRequest;

QCloudQuic/Classes/QCloudQuicVersion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
#ifndef QCloudQuicModuleVersion_h
77
#define QCloudQuicModuleVersion_h
8-
#define QCloudQuicModuleVersionNumber 603003
8+
#define QCloudQuicModuleVersionNumber 603002
99

1010
//dependency
1111

1212
//
1313
FOUNDATION_EXTERN NSString * const QCloudQuicModuleVersion;
1414
FOUNDATION_EXTERN NSString * const QCloudQuicModuleName;
1515

16-
#endif
16+
#endif

QCloudQuic/Classes/QCloudQuicVersion.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#import "QCloudQuicVersion.h"
2-
NSString * const QCloudQuicModuleVersion = @"6.3.3";
2+
NSString * const QCloudQuicModuleVersion = @"6.3.2";
33
NSString * const QCloudQuicModuleName = @"QCloudQuic";
44
@interface QCloudQCloudQuicLoad : NSObject
55
@end
@@ -26,4 +26,4 @@ + (void) load
2626
#pragma clang diagnostic pop
2727
}
2828
}
29-
@end
29+
@end

QCloudQuic/Classes/QuicFramework/Tquic.framework/Headers/tnet_quic_request.h

Lines changed: 71 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#endif
2525

2626
#include <cstdint>
27+
//#include <vector>
28+
//#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
2729

2830
namespace stgw {
2931
class TnetRequestFront;
@@ -34,6 +36,7 @@ struct TnetStats {
3436
bool is_quic; // if it is quic, else it is tcp.
3537
bool is_0rtt; // Only valid if it is quic.
3638
bool is_conn_reuse; // if reuse an exist quic connection.
39+
bool is_multipath_;
3740
std::uint64_t connect_ms; // connect cost in millionseconds.
3841
std::uint64_t ttfb_ms; // first byte cost from send request in millionseconds.
3942

@@ -48,21 +51,35 @@ struct TnetStats {
4851
std::uint64_t packets_lost; // Number of packets be lost when sent data.
4952
std::uint64_t packets_received; // Total packets received
5053
std::uint64_t bytes_received; // Total bytes received including packet format.
51-
std::uint64_t stream_bytes_received; // Total bytes received including duplicated data.
54+
std::uint64_t stream_bytes_sent; // Non-retransmitted bytes sent in a stream frame.
55+
std::uint64_t stream_bytes_received; // Bytes received in a stream frame.
5256
std::uint64_t dns_ms;
53-
std::uint64_t cancel_duration_ms;
54-
std::uint64_t shlo_duration_ms;
55-
std::uint64_t preprocess_duration_ms;
57+
std::uint32_t cancel_duration_ms;
58+
std::uint32_t shlo_duration_ms;
59+
std::uint32_t preprocess_duration_ms;
60+
std::uint32_t mp_nego_ms;
61+
std::uint32_t mp_succ_ms;
62+
std::uint32_t ma_st_rcv;
63+
std::uint32_t mp_st_rcv;
64+
std::uint32_t pre_strcv1;
65+
std::uint32_t pre_strcv2;
66+
std::int32_t mp_ft_offset;
67+
std::int32_t mp_tot_ms;
68+
int stream_error;
5669
int dns_code;
70+
int error_code;
5771
bool is_default_ip;
5872
char remote_ip[64];
59-
char conn_id[32];
73+
char conn_id[64];
6074
int engine_type; // only used if ConnectAndSend
6175
int sock_bind_type; // only used if ConnectAndSend
6276
int migration_count;
6377
int sock_avail_type;
6478
int multi_request_type;
6579
int avail_request_type;
80+
int detect_result;
81+
int persist_result;
82+
char detect_str[16];
6683
};
6784

6885
enum CongestionType {
@@ -83,6 +100,7 @@ class TNET_EXPORT TnetConfig {
83100
public:
84101
TnetConfig();
85102
TnetConfig(const TnetConfig& c);
103+
~TnetConfig();
86104
// The max receive window for a whole session.
87105
// unit is bytes, default is 15 MB, max is 24 MB
88106
// The window size of session must be larger than
@@ -122,7 +140,7 @@ class TNET_EXPORT TnetConfig {
122140
// 4000 milliseconds defaultly before handshake complete.
123141
// 600 seconds defaultly after handshake.
124142
int idle_timeout_millisec_;
125-
// Specify quic version, only support quic 39-46, it is 43 defaultly.
143+
// Specify quic version, only support quic 43-80, it is 43 defaultly.
126144
int quic_version_;
127145

128146
// default is false.
@@ -131,15 +149,31 @@ class TNET_EXPORT TnetConfig {
131149
// default is false.
132150
bool force_zero_rtt_;
133151

152+
// ConnectWithDomain get ipv6 ip if true, false defaultly.
153+
bool support_v6_;
154+
155+
bool isCongetionOptimizationEnabled_;
156+
134157
bool debug_use_1rtt_;
158+
int mp_strategy_;
159+
// The following parameters with debug_* is used for testing.
160+
// number of active connection id provided by client. if not set, default is 8.
161+
int debug_active_connection_id_num_;
162+
// number of path when multipath is enable. if not set, dafault is 2.
163+
int debug_multipath_num_;
164+
// Client IP address bind to each path, when multipath is enable.
165+
//std::vector<quic::QuicSocketAddress> debug_client_addresses_;
135166
};
136167

168+
137169
class TNET_EXPORT TnetRequestDelegate {
138170
public:
139171
TnetRequestDelegate() {}
140172
virtual ~TnetRequestDelegate() {}
141173
// Called when the handshake with server compeleted.
142174
virtual void OnConnect(int error_code) = 0;
175+
// Represents that network is linkable.
176+
virtual void OnNetworkLinked() {}
143177
// Called when data is available.
144178
virtual void OnDataRecv(const char* buf,
145179
const int buf_len) = 0;
@@ -176,10 +210,17 @@ class TNET_EXPORT TnetQuicRequest {
176210
// only for quic.
177211
void ConnectWithDomain(const char* host,
178212
const int port);
179-
213+
214+
void ConnAndReq(const char* host,
215+
const int port,
216+
const char* direct_ip,
217+
const char* body,
218+
const int body_len);
219+
180220
// only for quic, is fin directly
181221
void ConnectAndSend(const char* host,
182222
const int port,
223+
const char* default_ip,
183224
const char* body,
184225
const int body_len,
185226
bool fin);
@@ -192,7 +233,8 @@ class TNET_EXPORT TnetQuicRequest {
192233
Other headers can set as usual format.
193234
*/
194235
void AddHeaders(const char* key,
195-
const char* value);
236+
const char* value,
237+
const bool is_covered = true);
196238
// Return true if the handshake with server is compeleted.
197239
bool IsConnected();
198240

@@ -211,6 +253,8 @@ class TNET_EXPORT TnetQuicRequest {
211253
// Get statistics for the last request.
212254
TnetStats GetTnetStates();
213255

256+
void SetAlpn(const char* alpn_);
257+
214258
private:
215259
TnetQuicRequest();
216260
stgw::TnetRequestFront* front_;
@@ -225,20 +269,36 @@ extern "C" {
225269
// and create a new file.
226270
// if delete_old_file = false, log would be append to exist file,
227271
// if file not exist, then create a new file.
272+
// log_level value:
273+
// * verbose : -1
274+
// * info: 0
275+
// * warning: 1
276+
// * error: 2
277+
// * fatal: 3
228278
#if defined(WIN32)
229-
TNET_EXPORT void SetTquicLog(const wchar_t* filepath, bool delete_old_file);
279+
TNET_EXPORT void SetTquicLog(const wchar_t* filepath,
280+
bool delete_old_file,
281+
int log_level = 1);
230282
#else
231-
TNET_EXPORT void SetTquicLog(const char* filepath, bool delete_old_file);
283+
TNET_EXPORT void SetTquicLog(const char* filepath,
284+
bool delete_old_file,
285+
int log_level = 1);
232286
#endif
233287

234-
// Get tquic-sdk version, should be 1.3.9.0
288+
// Get tquic-sdk version, should be 1.4.48
235289
TNET_EXPORT const char* GetTquicVersion();
236290

237291
// only for quic
238292
TNET_EXPORT void TquicPreconnect(const char* domain,
239293
const char* default_ip,
240294
const int port);
241295

296+
TNET_EXPORT void TquicCleanDns();
297+
298+
299+
// For splash ad experiment
300+
TNET_EXPORT void set_tquic_expid(int exp_id);
301+
242302
#ifdef __cplusplus
243303
}
244304
#endif
5 Bytes
Binary file not shown.
1.6 MB
Binary file not shown.

0 commit comments

Comments
 (0)