Skip to content

Commit 51e8c75

Browse files
committed
Add Begin frame to Session
1 parent 2c8f24c commit 51e8c75

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
## [5.3.0] - 2026-01-xx
4+
5+
* Add `Begin` frame to `Session`
6+
37
## [5.2.1] - 2026-01-16
48

59
* Fix link credit handling

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntex-amqp"
3-
version = "5.2.1"
3+
version = "5.3.0"
44
authors = ["ntex contributors <team@ntex.rs>"]
55
description = "AMQP 1.0 Client/Server framework"
66
documentation = "https://docs.rs/ntex-amqp"
@@ -27,7 +27,7 @@ frame-trace = []
2727
[dependencies]
2828
ntex-amqp-codec = "2.0.0"
2929

30-
ntex-bytes = "1.2"
30+
ntex-bytes = "1.4"
3131
ntex-router = "1"
3232
ntex-rt = "3.4"
3333
ntex-io = "3.3"

src/connection.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,7 @@ impl ConnectionInner {
262262
false,
263263
ConnectionRef(cell.clone()),
264264
remote_channel_id,
265-
begin.next_outgoing_id(),
266-
begin.incoming_window(),
267-
begin.outgoing_window(),
265+
begin,
268266
));
269267
entry.insert(SessionState::Established(session));
270268
self.sessions_map.insert(remote_channel_id, local_token);
@@ -312,9 +310,7 @@ impl ConnectionInner {
312310
true,
313311
ConnectionRef(cell.clone()),
314312
remote_channel_id,
315-
begin.next_outgoing_id(),
316-
begin.incoming_window(),
317-
begin.outgoing_window(),
313+
begin,
318314
));
319315
self.sessions_map.insert(remote_channel_id, local_token);
320316

src/session.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ impl Session {
6464
Session { inner }
6565
}
6666

67+
#[inline]
68+
/// Get begin frame reference
69+
pub fn frame(&self) -> &Begin {
70+
&self.inner.get_ref().begin
71+
}
72+
6773
#[inline]
6874
/// Get io tag for current connection
6975
pub fn tag(&self) -> &'static str {
@@ -282,17 +288,12 @@ impl SessionInner {
282288
local: bool,
283289
sink: ConnectionRef,
284290
remote_channel_id: u16,
285-
next_incoming_id: DeliveryNumber,
286-
remote_incoming_window: u32,
287-
remote_outgoing_window: u32,
291+
begin: Begin,
288292
) -> SessionInner {
289293
SessionInner {
290-
id,
291-
sink,
292-
next_incoming_id,
293-
remote_channel_id,
294-
remote_incoming_window,
295-
remote_outgoing_window,
294+
next_incoming_id: begin.next_incoming_id(),
295+
remote_incoming_window: begin.remote_incoming_window(),
296+
remote_outgoing_window: begin.remote_outgoing_window(),
296297
flags: if local { Flags::LOCAL } else { Flags::empty() },
297298
next_outgoing_id: INITIAL_NEXT_OUTGOING_ID,
298299
unsettled_snd_deliveries: HashMap::default(),
@@ -305,6 +306,10 @@ impl SessionInner {
305306
pool_notify: pool::new(),
306307
pool_credit: pool::new(),
307308
closed: condition::Condition::new(),
309+
id,
310+
sink,
311+
begin,
312+
remote_channel_id,
308313
}
309314
}
310315

0 commit comments

Comments
 (0)