Skip to content

RFC 7959: stop Block1 upload after error and validate continuation state #22

Closed

Description

@maikebing

Scope

At baseline 1abe69a, BlockwiseLayer.ReceiveResponse accesses RequestBlockStatus for any response carrying Block1 and does not consistently require 2.31 Continue before sending the next request block. This can cause a null reference for an unsolicited Block1 response and can continue uploading after a 4.xx/5.xx error.

References:

  • RFC 7959 §2.5 (Block1 request payload transfer)
  • RFC 7959 §2.9.1 (2.31 Continue and block acknowledgement)

Acceptance criteria

  • A Block1 response without an active upload state is ignored or reported as a protocol error without crashing or starting an unrelated upload.
  • 4.xx/5.xx responses and final success are delivered to the caller and never trigger another request block.
  • Only a matching 2.31 Continue advances the upload.
  • Duplicate, out-of-order, future, invalid-SZX, and wrong-offset acknowledgements cannot skip or replay data.
  • Valid SZX downshift, final block, single-block/empty payload, Block2, Observe, timeout, and cancellation paths retain their existing contracts.
  • Add baseline-failing tests and fixed regressions; Q-Block/BERT is outside this issue.

Activity

  1. maikebing commented on Nov 12, 2026

    @maikebing
    MemberAuthor

    Acceptance clarification after reviewing RFC 7959 §2.3: a server may enact a non-final request block separately and return a successful 2.xx response with Block1.M=0; the client is still expected to send subsequent blocks. Therefore the initial 'only 2.31 Continue advances' wording is too restrictive. The fix will preserve that legal per-block mode, require 2.31 for the atomic collection mode where Block1.M=1, stop upload on 4.xx/5.xx, and validate acknowledged NUM/SZX/offset before advancing. Regression tests must include both legal continuation modes. This comment corrects the acceptance condition without rewriting the original report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions