alksocks 0.3.1

SOCKS5 (RFC 1928) proxy protocol over alkcall channels: targeted-forked fast-socks5 typestate core plus producer/consumer sessions. Producer/consumer protocol crate.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
//! The consumer BIND integration tests — `BindSession` end to end
//! through the harness's consumer-side topology (the producer's real
//! command-dispatch path over channels; the BIND phase model, ADR-007,
//! driven by the wrapper-aware client, POC #5's `read_reply2` shape).
//!
//! Covered: bind → reply#1 (BND.ADDR as the harness accept advertises)
//! → reply#2 (the peer address) → pass-through echo both directions;
//! the command-gate refusal surfaced as a typed error (a
//! `socks5:open`-only identity cannot bind); factory-failure and
//! accept-stage-failure mappings surfaced; quiet-wait garbage from the
//! client side ends the session; the three-command regression guard
//! from the consumer side.

mod harness;

use tokio::io::{AsyncReadExt, AsyncWriteExt};

use alksocks::consumer::{BindDataPlane, BindReply1, BindSession, Socks5ChannelSession};
use alksocks::egress::{BindAcceptError, BindAcceptFactoryError};
use alksocks::error::SocksSessionError;
use alksocks::rfc1928::consts;
use alksocks::rfc1928::util::target_addr::{TargetAddr, ToTargetAddr};
use alksocks::SocksError as SocksErrorKind;

use harness::{
    echo_egress, refusing_accept, refusing_accept_factory, wire_consumer_side_with, ECHO_BIND_PORT,
};

/// Both scopes: the open gate (`socks5:open`) AND the command gate
/// (`socks5:bind`) — a BIND session needs both grants explicitly
/// (ADR-006: never implied).
fn bind_scoped() -> alkcall::core::auth::Identity {
    harness::both_scopes_identity()
}

/// The no-leaked-channels probe (the consumer-connect suite's shape,
/// re-pinned for the BIND sessions): both managers hold only channel
/// 0 — the producer's entry reaps by its open-op wrapper; the probe
/// polls past the reap race.
async fn no_leaked_channels(topo: &harness::ConsumerSideTopology) {
    let deadline = std::time::Duration::from_secs(5);
    let consumer_ids = topo.consumer.manager().channel_ids();
    assert!(
        consumer_ids.iter().all(|&id| id == 0),
        "consumer leaked channel entries: {consumer_ids:?}"
    );
    tokio::time::timeout(deadline, async {
        loop {
            let producer_ids = topo.producer_manager.channel_ids();
            if producer_ids.iter().all(|&id| id == 0) {
                return;
            }
            tokio::time::sleep(std::time::Duration::from_millis(10)).await;
        }
    })
    .await
    .expect("the producer's handler-exit teardown reaps the entry");
}

/// A session error that carries an RFC reply code (the typed
/// reply-code-carrying shape the BIND paths promise).
fn reply_code_of(err: &SocksSessionError) -> Option<u8> {
    match err {
        SocksSessionError::Rfc(SocksErrorKind::ReplyError(code)) => Some(code.as_u8()),
        _ => None,
    }
}

/// The happy path: `bind` → reply#1 carries the harness accept's
/// advertised BND.ADDR (`ECHO_BIND_PORT` — the reply#1 carrier); the
/// app server's out-of-band dial shape is the `BindReply1` handle;
/// `await_inbound` reads reply#2 (the peer address, 10.0.0.7:44444 —
/// the harness's fixed stand-in); the data plane two-pumps raw bytes
/// both directions; `close` reaps the adopted channel.
#[tokio::test]
async fn bind_round_trip_reply1_reply2_then_pass_through() {
    let topo = wire_consumer_side_with(
        harness::echo_dial(),
        None,
        Some(harness::echo_accept()),
        Some(bind_scoped()),
    )
    .await;

    let mut session = BindSession::bind(
        topo.consumer.as_ref(),
        ("bind.test", ECHO_BIND_PORT).to_target_addr().unwrap(),
    )
    .await
    .expect("the session binds");

    // Reply#1: the advertised BND.ADDR (the harness accept's static
    // in-process address).
    let channel_id = session.channel_id();
    assert!(channel_id >= 1, "a producer-allocated id");
    assert!(topo.consumer.manager().has_channel(channel_id));
    let BindReply1 { bind_addr, .. } = session.reply1().expect("reply#1's handle");
    assert_eq!(
        bind_addr,
        TargetAddr::Ip(std::net::SocketAddr::from(([127, 0, 0, 1], ECHO_BIND_PORT))),
        "reply#1 carries the advertised BND.ADDR"
    );

    // Reply#2: the accepted peer (the harness's fixed stand-in), then
    // the raw pass-through data plane.
    let mut plane = session
        .await_inbound()
        .await
        .expect("reply#2 read")
        .expect("the plane exists before reply#2");
    assert_eq!(
        plane.peer,
        TargetAddr::Ip(std::net::SocketAddr::from(([10, 0, 0, 7], 44444))),
        "reply#2 carries the accepted peer"
    );

    // Phase 2: raw pass-through, both directions.
    plane.write_all(b"ping").await.expect("write");
    plane.flush().await.expect("flush");
    let mut buf = [0u8; 4];
    tokio::time::timeout(
        std::time::Duration::from_secs(10),
        plane.read_exact(&mut buf),
    )
    .await
    .expect("echo timed out")
    .expect("read the echo");
    assert_eq!(&buf, b"ping");

    // Graceful teardown: half-close (the EOF sentinel) + reap.
    drop(plane);
    assert!(session.close().await, "the adopted channel entry existed");
    no_leaked_channels(&topo).await;
}

/// The `BindDataPlane` accessors: `into_inner` yields the owned
/// forked client type (read/write rides it directly); the session
/// still owns the teardown — `close` after the plane is drained reaps
/// the entry.
#[tokio::test]
async fn bind_data_plane_accessors_into_inner_and_socket_mut() {
    let topo = wire_consumer_side_with(
        harness::echo_dial(),
        None,
        Some(harness::echo_accept()),
        Some(bind_scoped()),
    )
    .await;

    let mut session = BindSession::bind(
        topo.consumer.as_ref(),
        ("plane.test", ECHO_BIND_PORT).to_target_addr().unwrap(),
    )
    .await
    .expect("the session binds");
    session
        .reply1()
        .expect("reply#1's handle")
        .raw_mut()
        .get_socket_mut()
        .write_all(b"pre")
        .await
        .expect("pre-reply#2 write");
    let mut plane = session
        .await_inbound()
        .await
        .expect("reply#2 read")
        .expect("the plane");
    // `get_socket_mut` is the borrowed socket accessor (the POC
    // shape) — the same stream, reached through the plane.
    plane
        .get_socket_mut()
        .write_all(b"raw")
        .await
        .expect("write");
    let mut inner = plane.into_inner();
    let mut buf = [0u8; 6];
    tokio::time::timeout(
        std::time::Duration::from_secs(10),
        inner.read_exact(&mut buf),
    )
    .await
    .expect("echo timed out")
    .expect("read the echo");
    assert_eq!(&buf, b"preraw", "both write paths rode the same pipe");
    drop(inner);

    assert!(session.close().await, "the entry existed");
    no_leaked_channels(&topo).await;
}

/// The command gate (ADR-006): a `socks5:open`-only identity cannot
/// bind — the refusal surfaces as a typed session error carrying the
/// RFC reply code (`ConnectionNotAllowed` 0x02), and no phantom
/// channel remains on either side.
#[tokio::test]
async fn bind_command_gate_refusal_is_a_typed_reply_code_error() {
    let topo = wire_consumer_side_with(
        harness::echo_dial(),
        None,
        Some(harness::echo_accept()),
        Some(harness::consumer_identity()),
    )
    .await;

    let err = BindSession::bind(
        topo.consumer.as_ref(),
        ("gate.test", ECHO_BIND_PORT).to_target_addr().unwrap(),
    )
    .await
    .expect_err("the gate refuses a socks5:open-only identity");

    assert_eq!(
        reply_code_of(&err),
        Some(consts::SOCKS5_REPLY_CONNECTION_NOT_ALLOWED),
        "the command gate's 0x02 rides the session error: {err:?}"
    );

    // Teardown-at-birth: the adopted channel was reaped before the
    // error returned (no phantom channel, either side).
    no_leaked_channels(&topo).await;
}

/// Factory failure (pre-reply#1) maps to reply#1's code, surfaced
/// through the session type — no session lives past the refusal, no
/// phantom listener.
#[tokio::test]
async fn bind_factory_failure_surfaces_reply1_code() {
    let topo = wire_consumer_side_with(
        harness::echo_dial(),
        None,
        Some(refusing_accept_factory(BindAcceptFactoryError::Refused(
            "port held".into(),
        ))),
        Some(bind_scoped()),
    )
    .await;

    let err = BindSession::bind(
        topo.consumer.as_ref(),
        ("factory.fail", ECHO_BIND_PORT).to_target_addr().unwrap(),
    )
    .await
    .expect_err("the factory refused");

    assert_eq!(
        reply_code_of(&err),
        Some(consts::SOCKS5_REPLY_CONNECTION_REFUSED),
        "the factory refusal maps to reply#1's code: {err:?}"
    );
    no_leaked_channels(&topo).await;
}

/// Accept-stage failure (post-reply#1) maps to reply#2's code —
/// surfaced at `await_inbound`, no data plane; the session's channel
/// is still owned (close/drop reaps it).
#[tokio::test]
async fn bind_accept_stage_failure_surfaces_reply2_code() {
    let topo = wire_consumer_side_with(
        harness::echo_dial(),
        None,
        Some(refusing_accept(BindAcceptError::NotAllowed(
            "policy".into(),
        ))),
        Some(bind_scoped()),
    )
    .await;

    let mut session = BindSession::bind(
        topo.consumer.as_ref(),
        ("accept.fail", ECHO_BIND_PORT).to_target_addr().unwrap(),
    )
    .await
    .expect("reply#1 succeeded — the factory resolved");

    let err = match session.await_inbound().await {
        Err(err) => err,
        Ok(Some(_)) => panic!("the accept-stage refusal must not yield a data plane"),
        Ok(None) => panic!("the plane existed before reply#2"),
    };
    assert_eq!(
        reply_code_of(&err),
        Some(consts::SOCKS5_REPLY_CONNECTION_NOT_ALLOWED),
        "reply#2's mapped code surfaces at await_inbound: {err:?}"
    );

    // The channel entry stays adopted (reply#1 succeeded; the session
    // owns it until the app closes it) — close reaps it.
    assert!(session.close().await, "the entry existed");
    no_leaked_channels(&topo).await;
}

/// Quiet-wait garbage from the client side: a control byte after
/// reply#1 is protocol garbage — the producer ends the session with
/// no data plane, so the consumer's `await_inbound` read EOFs (an I/O
/// error, not a reply#2).
#[tokio::test]
async fn bind_quiet_wait_garbage_from_the_client_ends_the_session() {
    let parked: alksocks::egress::BindAcceptFactory =
        std::sync::Arc::new(move |_target: TargetAddr| {
            Box::pin(async move {
                Ok(alksocks::egress::BindAccept::new(
                    std::net::SocketAddr::from(([127, 0, 0, 1], ECHO_BIND_PORT)),
                    std::future::pending::<
                        Result<alksocks::egress::BindTargetHandle, BindAcceptError>,
                    >(),
                ))
            })
        });
    let topo = wire_consumer_side_with(
        harness::echo_dial(),
        None,
        Some(parked),
        Some(bind_scoped()),
    )
    .await;

    let mut session = BindSession::bind(
        topo.consumer.as_ref(),
        ("quiet.test", ECHO_BIND_PORT).to_target_addr().unwrap(),
    )
    .await
    .expect("reply#1 succeeded");

    // Protocol garbage in the quiet wait (the client's side).
    session
        .reply1()
        .expect("reply#1's handle")
        .raw_mut()
        .get_socket_mut()
        .write_all(&[0x05, 0x02])
        .await
        .expect("garbage written");

    // The session ends: the reply#2 read EOFs (no reply#2, no data
    // plane).
    let err = match session.await_inbound().await {
        Err(err) => err,
        Ok(Some(_)) => panic!("the garbage must not yield a data plane"),
        Ok(None) => panic!("the plane existed before reply#2"),
    };
    assert!(
        matches!(err, SocksSessionError::Io(_)),
        "the quiet-wait garbage surfaces as the EOF'd reply#2 read: {err:?}"
    );

    // The channel is still owned (reply#1 succeeded); close reaps it.
    assert!(session.close().await, "the entry existed");
    no_leaked_channels(&topo).await;
}

/// The three-command regression guard from the consumer side (POC #5
/// test 7's consumer-side mirror): one registration, all three
/// commands served through their consumer sessions — CONNECT
/// (`Socks5ChannelSession`), BIND (`BindSession`), ASSOCIATE rides
/// its task; here CONNECT + BIND coexist on one registration with the
/// both-scopes identity, fresh channel per session.
#[tokio::test]
async fn bind_and_connect_serve_on_the_same_registration() {
    let topo = wire_consumer_side_with(
        harness::echo_dial(),
        Some(echo_egress()),
        Some(harness::echo_accept()),
        Some(bind_scoped()),
    )
    .await;

    // CONNECT serves (the CONNECT session over the same registration).
    let mut connect_session = Socks5ChannelSession::connect(
        topo.consumer.as_ref(),
        ("echo.test", 443u16).to_target_addr().unwrap(),
    )
    .await
    .expect("the connect session");
    connect_session
        .split()
        .expect("pipe")
        .1
        .write_all(b"tcp")
        .await
        .expect("write");
    let (mut read, _) = connect_session.split().expect("pipe");
    let mut buf = [0u8; 3];
    tokio::time::timeout(
        std::time::Duration::from_secs(10),
        read.read_exact(&mut buf),
    )
    .await
    .expect("echo timed out")
    .expect("read the echo");
    assert_eq!(&buf, b"tcp");
    connect_session.close().await;

    // BIND serves the same registration (fresh channel).
    let mut bind_session = BindSession::bind(
        topo.consumer.as_ref(),
        ("bind.test", ECHO_BIND_PORT).to_target_addr().unwrap(),
    )
    .await
    .expect("the bind session");
    let mut plane = bind_session
        .await_inbound()
        .await
        .expect("reply#2")
        .expect("the plane");
    plane.write_all(b"bind").await.expect("write");
    plane.flush().await.expect("flush");
    let mut buf = [0u8; 4];
    tokio::time::timeout(
        std::time::Duration::from_secs(10),
        plane.read_exact(&mut buf),
    )
    .await
    .expect("echo timed out")
    .expect("read the echo");
    assert_eq!(&buf, b"bind");
    drop(plane);
    bind_session.close().await;
    no_leaked_channels(&topo).await;
}

/// Drop teardown: dropping a live BIND session mid-pipe reaps the
/// adopted channel entry (no leak) and the connection stays healthy —
/// a fresh bind succeeds immediately after (the CONNECT session's
/// drop posture, re-pinned for BIND).
#[tokio::test]
async fn bind_drop_teardown_reaps_and_connection_stays_healthy() {
    let topo = wire_consumer_side_with(
        harness::echo_dial(),
        None,
        Some(harness::echo_accept()),
        Some(bind_scoped()),
    )
    .await;

    let mut session = BindSession::bind(
        topo.consumer.as_ref(),
        ("dropped.test", ECHO_BIND_PORT).to_target_addr().unwrap(),
    )
    .await
    .expect("the session binds");
    let BindReply1 { bind_addr, .. } = session.reply1().expect("reply#1's handle");
    assert_eq!(
        bind_addr,
        TargetAddr::Ip(std::net::SocketAddr::from(([127, 0, 0, 1], ECHO_BIND_PORT)))
    );

    // Drop mid-pipe (before reply#2 — the quiet-wait phase).
    drop(session);
    no_leaked_channels(&topo).await;

    // The connection is healthy: a fresh bind round-trips.
    let mut fresh = BindSession::bind(
        topo.consumer.as_ref(),
        ("fresh.test", ECHO_BIND_PORT).to_target_addr().unwrap(),
    )
    .await
    .expect("fresh bind after the drop");
    let mut plane = fresh
        .await_inbound()
        .await
        .expect("reply#2")
        .expect("the plane");
    plane.write_all(b"again").await.expect("write");
    plane.flush().await.expect("flush");
    let mut buf = [0u8; 5];
    tokio::time::timeout(
        std::time::Duration::from_secs(10),
        plane.read_exact(&mut buf),
    )
    .await
    .expect("echo timed out")
    .expect("read the fresh echo");
    assert_eq!(&buf, b"again");
    drop(plane);
    fresh.close().await;
    no_leaked_channels(&topo).await;
}

/// The no-`Clone` posture for the BIND session (the CONNECT session's
/// compile shape, mirrored): the doctest on the type is the
/// compile-assert; this probe pins `Send`.
#[test]
fn bind_session_type_is_send() {
    fn assert_send<T: Send>() {}
    assert_send::<BindSession>();
    assert_send::<BindDataPlane>();
    assert_send::<BindReply1<'static>>();
}

/// The C-1 re-entry guard (review 002): a second `await_inbound` on
/// the same session cannot re-read the data plane — it returns the
/// spent shape (`Ok(None)`), and the data-plane bytes survive
/// untouched (the first plane's echo round-trip is intact after the
/// second call; the pinning test for the silent-corruption path).
#[tokio::test]
async fn double_await_inbound_returns_the_spent_shape_and_bytes_survive() {
    let topo = wire_consumer_side_with(
        harness::echo_dial(),
        None,
        Some(harness::echo_accept()),
        Some(bind_scoped()),
    )
    .await;

    let mut session = BindSession::bind(
        topo.consumer.as_ref(),
        ("reentry.test", ECHO_BIND_PORT).to_target_addr().unwrap(),
    )
    .await
    .expect("the session binds");

    // The first read: the plane exists (and consumes the phase —
    // the plane owns the stream; the session stays the teardown
    // owner).
    let mut plane = session
        .await_inbound()
        .await
        .expect("reply#2 read")
        .expect("the plane exists before reply#2");
    plane.write_all(b"ping").await.expect("write");
    plane.flush().await.expect("flush");
    let mut buf = [0u8; 4];
    tokio::time::timeout(
        std::time::Duration::from_secs(10),
        plane.read_exact(&mut buf),
    )
    .await
    .expect("echo timed out")
    .expect("read the echo");
    assert_eq!(&buf, b"ping", "the first plane's round-trip");
    drop(plane);

    // The second call: the spent shape — `Ok(None)`, never a
    // re-read of the live data plane.
    let second = session
        .await_inbound()
        .await
        .expect("the spent shape is an Ok, not an error");
    assert!(second.is_none(), "the phase was consumed");

    // The data-plane bytes survive: the first plane's echo
    // round-trip was complete and no re-read corrupted the pipe —
    // the channel is closed with the reap (the session owner's
    // `close`), and a fresh bind on the same registration
    // round-trips with its own bytes intact.
    assert!(session.close().await, "the entry existed");
    no_leaked_channels(&topo).await;

    let mut fresh = BindSession::bind(
        topo.consumer.as_ref(),
        ("after.test", ECHO_BIND_PORT).to_target_addr().unwrap(),
    )
    .await
    .expect("fresh bind after the spent call");
    let mut plane = fresh
        .await_inbound()
        .await
        .expect("reply#2")
        .expect("the plane");
    plane.write_all(b"again").await.expect("write");
    plane.flush().await.expect("flush");
    let mut buf = [0u8; 5];
    tokio::time::timeout(
        std::time::Duration::from_secs(10),
        plane.read_exact(&mut buf),
    )
    .await
    .expect("echo timed out")
    .expect("read the fresh echo");
    assert_eq!(&buf, b"again", "the fresh session's bytes are intact");
    drop(plane);
    fresh.close().await;
    no_leaked_channels(&topo).await;
}

/// The `reply1()`-twice re-entry path (C-1's other door, closed by
/// the D-1 one-reader decision): `reply1()` is a view — fresh handles
/// per call, no read phase — so repeated `reply1()` calls carry the
/// same advertised address without consuming anything, and the one
/// normative reader (`await_inbound`) still yields exactly one plane.
#[tokio::test]
async fn reply1_twice_is_a_view_and_the_reader_yields_one_plane() {
    let topo = wire_consumer_side_with(
        harness::echo_dial(),
        None,
        Some(harness::echo_accept()),
        Some(bind_scoped()),
    )
    .await;

    let mut session = BindSession::bind(
        topo.consumer.as_ref(),
        ("view.test", ECHO_BIND_PORT).to_target_addr().unwrap(),
    )
    .await
    .expect("the session binds");

    let expected = TargetAddr::Ip(std::net::SocketAddr::from(([127, 0, 0, 1], ECHO_BIND_PORT)));

    // Repeated views: every handle carries the same advertised
    // address; nothing is consumed.
    let BindReply1 { bind_addr, .. } = session.reply1().expect("reply#1's handle");
    assert_eq!(bind_addr, expected);
    let BindReply1 { bind_addr, .. } = session.reply1().expect("reply#1's handle again");
    assert_eq!(bind_addr, expected, "a view, not a reader");

    // The one normative reader: exactly one plane.
    let mut plane = session
        .await_inbound()
        .await
        .expect("reply#2 read")
        .expect("the plane");
    plane.write_all(b"once").await.expect("write");
    plane.flush().await.expect("flush");
    let mut buf = [0u8; 4];
    tokio::time::timeout(
        std::time::Duration::from_secs(10),
        plane.read_exact(&mut buf),
    )
    .await
    .expect("echo timed out")
    .expect("read the echo");
    assert_eq!(&buf, b"once");
    drop(plane);

    // The re-entry is closed on this door too.
    assert!(
        session
            .await_inbound()
            .await
            .expect("spent shape")
            .is_none(),
        "no second plane after the reader ran"
    );
    session.close().await;
    no_leaked_channels(&topo).await;
}