| ... | ... | @@ -583,15 +583,16 @@ pub fn init(stream: net.Stream, ca_bundle: Certificate.Bundle, host: []const u8) |
| 583 | 583 | }); |
| 584 | 584 | }, |
| 585 | 585 | }; |
| 586 | | std.debug.print("remaining bytes: {d}\n", .{len - end}); |
| 587 | | return .{ |
| 586 | var client: Client = .{ |
| 588 | 587 | .application_cipher = app_cipher, |
| 589 | 588 | .read_seq = 0, |
| 590 | 589 | .write_seq = 0, |
| 591 | 590 | .partially_read_buffer = undefined, |
| 592 | | .partially_read_len = 0, |
| 591 | .partially_read_len = @intCast(u15, len - end), |
| 593 | 592 | .eof = false, |
| 594 | 593 | }; |
| 594 | mem.copy(u8, &client.partially_read_buffer, handshake_buf[len..end]); |
| 595 | return client; |
| 595 | 596 | }, |
| 596 | 597 | else => { |
| 597 | 598 | return error.TlsUnexpectedMessage; |