@@ -615,17 +615,18 @@ handle_event(cast, socket_control, {wait_for_socket, Role},
615615handle_event (internal , socket_ready , {hello ,_ }= StateName , # data {ssh_params = Ssh0 } = D ) ->
616616 VsnMsg = ssh_transport :hello_version_msg (string_version (Ssh0 )),
617617 send_bytes (VsnMsg , D ),
618- case inet :getopts (Socket = D # data .socket , [recbuf ]) of
619- {ok , [{recbuf ,Size }]} ->
618+ case inet :getopts (Socket = D # data .socket , [buffer ]) of
619+ {ok , [{buffer ,Size }]} ->
620620 % % Set the socket to the hello text line handling mode:
621621 inet :setopts (Socket , [{packet , line },
622622 {active , once },
623623 % Expecting the version string which might
624624 % be max ?MAX_PROTO_VERSION bytes:
625- {recbuf , ? MAX_PROTO_VERSION },
625+ {buffer , ? MAX_PROTO_VERSION },
626+ {packet_size , ? MAX_PROTO_VERSION },
626627 {nodelay ,true }]),
627628 Time = ? GET_OPT (hello_timeout , Ssh0 # ssh .opts , infinity ),
628- {keep_state , D # data {inet_initial_recbuf_size = Size }, [{state_timeout ,Time ,no_hello_received }] };
629+ {keep_state , D # data {inet_initial_buffer_size = Size }, [{state_timeout ,Time ,no_hello_received }] };
629630
630631 Other ->
631632 ? call_disconnectfun_and_log_cond (" Option return" ,
@@ -654,11 +655,12 @@ handle_event(internal, {version_exchange,Version}, {hello,Role}, D0) ->
654655 case handle_version (NumVsn , StrVsn , D0 # data .ssh_params ) of
655656 {ok , Ssh1 } ->
656657 % % Since the hello part is finished correctly, we set the
657- % % socket to the packet handling mode (including recbuf size):
658+ % % socket to the packet handling mode (including buffer size):
658659 inet :setopts (D0 # data .socket , [{packet ,0 },
659660 {mode ,binary },
660661 {active , once },
661- {recbuf , D0 # data .inet_initial_recbuf_size }]),
662+ {buffer , D0 # data .inet_initial_buffer_size },
663+ {packet_size , 0 }]),
662664 {KeyInitMsg , SshPacket , Ssh } = ssh_transport :key_exchange_init_msg (Ssh1 ),
663665 send_bytes (SshPacket , D0 ),
664666 D = D0 # data {ssh_params = Ssh ,
0 commit comments