ibm5250 0.1.0.dev2__tar.gz → 0.1.0.dev3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: ibm5250
3
- Version: 0.1.0.dev2
3
+ Version: 0.1.0.dev3
4
4
  Summary: IBM 5250 terminal automation library
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.11
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ibm5250"
3
- version = "0.1.0.dev2"
3
+ version = "0.1.0.dev3"
4
4
  description = "IBM 5250 terminal automation library"
5
5
  requires-python = ">=3.11"
6
6
 
@@ -197,6 +197,10 @@ class TN5250Connection:
197
197
  self._ttype_will_sent = False
198
198
  self._negotiated_ttype = "IBM-3477-FG" # screen model reported to IBM i
199
199
 
200
+ # Byte 9 (opcode/var-header length) of the last received TN5250E record.
201
+ # Used to detect header-only Cancel-Invite records (opcode 0x0A).
202
+ self._last_recv_opcode: int = 0x03
203
+
200
204
  # TLS
201
205
  if use_tls and tls_context is None:
202
206
  tls_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
@@ -342,6 +346,7 @@ class TN5250Connection:
342
346
  log.debug("Short TN5250E frame (%d bytes), skipping", len(frame))
343
347
  continue
344
348
  hdr = TN5250EHeader.from_bytes(frame)
349
+ self._last_recv_opcode = frame[9] # byte 9: opcode / var_len
345
350
  payload = bytes(frame[_TN5250E_HEADER_LEN:])
346
351
  log.debug(
347
352
  "← TN5250E type=%02X data_type=%02X payload=%d bytes",
@@ -361,6 +366,7 @@ class TN5250Connection:
361
366
  frame_bytes[:2], "big"
362
367
  ) == len(frame_bytes):
363
368
  hdr = TN5250EHeader.from_bytes(frame_bytes)
369
+ self._last_recv_opcode = frame_bytes[9] # byte 9: opcode
364
370
  var_hdr_len = frame_bytes[
365
371
  9
366
372
  ] # RFC 2877 variable-header length field
@@ -13,7 +13,7 @@ wheels = [
13
13
 
14
14
  [[package]]
15
15
  name = "ibm5250"
16
- version = "0.1.0.dev2"
16
+ version = "0.1.0.dev3"
17
17
  source = { editable = "." }
18
18
 
19
19
  [package.dev-dependencies]
File without changes
File without changes
File without changes