[PR #341] [MERGED] feat: add length-prefixed HTTP chunking functionality #456

Closed
opened 2026-02-16 01:16:01 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-daemon/pull/341
Author: @Yeuoly
Created: 6/11/2025
Status: Merged
Merged: 6/11/2025
Merged by: @Yeuoly

Base: mainHead: feat/length-prefixed-chunking


📝 Commits (1)

  • 697a3b3 feat: add length-prefixed HTTP chunking functionality

📊 Changes

4 files changed (+472 additions, -44 deletions)

View changed files

📝 internal/utils/http_requests/http_options.go (+49 -11)
📝 internal/utils/http_requests/http_warpper.go (+48 -33)
internal/utils/parser/chunking.go (+107 -0)
internal/utils/parser/chunking_test.go (+268 -0)

📄 Description

Currently, daemon uses standard SSE to decode chunks while receiving streaming messages, it leads a memory performance issue like duplicated memory allocation, while length-prefixed chunking could solve this.

  • Introduced new constants for HTTP option types to improve code readability and maintainability.
  • Updated existing HTTP option functions to utilize the new constants.
  • Implemented line-based and length-prefixed chunking methods for improved data processing in HTTP requests.
  • Added comprehensive tests for chunking functionality to ensure reliability and correctness.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugin-daemon/pull/341 **Author:** [@Yeuoly](https://github.com/Yeuoly) **Created:** 6/11/2025 **Status:** ✅ Merged **Merged:** 6/11/2025 **Merged by:** [@Yeuoly](https://github.com/Yeuoly) **Base:** `main` ← **Head:** `feat/length-prefixed-chunking` --- ### 📝 Commits (1) - [`697a3b3`](https://github.com/langgenius/dify-plugin-daemon/commit/697a3b350e859e6ba6e3908cbdf87edda5a80c0c) feat: add length-prefixed HTTP chunking functionality ### 📊 Changes **4 files changed** (+472 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `internal/utils/http_requests/http_options.go` (+49 -11) 📝 `internal/utils/http_requests/http_warpper.go` (+48 -33) ➕ `internal/utils/parser/chunking.go` (+107 -0) ➕ `internal/utils/parser/chunking_test.go` (+268 -0) </details> ### 📄 Description Currently, daemon uses standard SSE to decode chunks while receiving streaming messages, it leads a memory performance issue like duplicated memory allocation, while length-prefixed chunking could solve this. - Introduced new constants for HTTP option types to improve code readability and maintainability. - Updated existing HTTP option functions to utilize the new constants. - Implemented line-based and length-prefixed chunking methods for improved data processing in HTTP requests. - Added comprehensive tests for chunking functionality to ensure reliability and correctness. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 01:16:01 -05:00
yindo closed this issue 2026-02-16 01:16:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#456