@@ -285,7 +285,7 @@ def read_frame(req_sz)
285285 rescue EOFError
286286 raise TransportException . new ( TransportException ::END_OF_FILE , "Unexpected EOF reading frame size" )
287287 end
288- frame_size = first_word . unpack ( "N" ) . first
288+ frame_size = first_word . unpack1 ( "N" )
289289
290290 # Check for unframed binary protocol
291291 if ( frame_size & BINARY_VERSION_MASK ) == BINARY_VERSION_1
@@ -324,15 +324,15 @@ def read_frame(req_sz)
324324 second_word = frame_buf . read ( 4 )
325325 frame_buf . rewind
326326
327- magic = second_word . unpack ( "n" ) . first
327+ magic = second_word . unpack1 ( "n" )
328328
329329 if magic == HEADER_MAGIC
330330 if frame_size < 10
331331 raise TransportException . new ( TransportException ::UNKNOWN , "Header transport frame is too small" )
332332 end
333333 set_client_type ( HeaderClientType ::HEADERS )
334334 @read_buffer = parse_header_format ( frame_buf )
335- elsif ( second_word . unpack ( "N" ) . first & BINARY_VERSION_MASK ) == BINARY_VERSION_1
335+ elsif ( second_word . unpack1 ( "N" ) & BINARY_VERSION_MASK ) == BINARY_VERSION_1
336336 set_client_type ( HeaderClientType ::FRAMED_BINARY )
337337 @protocol_id = HeaderSubprotocolID ::BINARY
338338 @read_buffer = frame_buf
@@ -382,11 +382,11 @@ def parse_header_format(buf)
382382 buf . read ( 2 )
383383
384384 # Read flags and sequence ID
385- @flags = buf . read ( 2 ) . unpack ( "n" ) . first
386- @sequence_id = signed_int32 ( buf . read ( 4 ) . unpack ( "N" ) . first )
385+ @flags = buf . read ( 2 ) . unpack1 ( "n" )
386+ @sequence_id = signed_int32 ( buf . read ( 4 ) . unpack1 ( "N" ) )
387387
388388 # Read header length (in 32-bit words)
389- header_words = buf . read ( 2 ) . unpack ( "n" ) . first
389+ header_words = buf . read ( 2 ) . unpack1 ( "n" )
390390 if header_words >= 16_384
391391 raise TransportException . new ( TransportException ::UNKNOWN , "Header size is unreasonable" )
392392 end
0 commit comments