You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "evanzhang87 (via GitHub)" <gi...@apache.org> on 2025/04/13 16:13:37 UTC
[PR] read dubbo stream [dubbo-go-hessian2]
evanzhang87 opened a new pull request, #377:
URL: https://github.com/apache/dubbo-go-hessian2/pull/377
<!-- Thanks for sending a pull request!
-->
**What this PR does**:
Read buffer from tcp stream
**Which issue(s) this PR fixes**:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #
**Special notes for your reviewer**:
**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] read dubbo stream [dubbo-go-hessian2]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on PR #377:
URL: https://github.com/apache/dubbo-go-hessian2/pull/377#issuecomment-2800109827
<img width="773" alt="image" src="https://github.com/user-attachments/assets/f2e73dcc-f3ab-4f6e-b96e-10a3d78186a9" />
Please fix the ci error and add some unit tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] read dubbo stream [dubbo-go-hessian2]
Posted by "wongoo (via GitHub)" <gi...@apache.org>.
wongoo closed pull request #377: read dubbo stream
URL: https://github.com/apache/dubbo-go-hessian2/pull/377
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] read dubbo stream [dubbo-go-hessian2]
Posted by "wongoo (via GitHub)" <gi...@apache.org>.
wongoo commented on code in PR #377:
URL: https://github.com/apache/dubbo-go-hessian2/pull/377#discussion_r2047850396
##########
hessian.go:
##########
@@ -110,16 +112,34 @@ func (h *HessianCodec) Write(service Service, header DubboHeader, body interface
func (h *HessianCodec) ReadHeader(header *DubboHeader) error {
var err error
- if h.reader.Size() < HEADER_LENGTH {
- return ErrHeaderNotEnough
- }
- buf, err := h.reader.Peek(HEADER_LENGTH)
- if err != nil { // this is impossible
- return perrors.WithStack(err)
- }
- _, err = h.reader.Discard(HEADER_LENGTH)
- if err != nil { // this is impossible
- return perrors.WithStack(err)
+ var buf []byte
+
+ if !h.isStream {
Review Comment:
consider handle stream mode first for if condition
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] read dubbo stream [dubbo-go-hessian2]
Posted by "wongoo (via GitHub)" <gi...@apache.org>.
wongoo commented on code in PR #377:
URL: https://github.com/apache/dubbo-go-hessian2/pull/377#discussion_r2047848767
##########
hessian.go:
##########
@@ -79,11 +80,12 @@ func NewHessianCodec(reader *bufio.Reader) *HessianCodec {
}
// NewHessianCodecCustom generate a new hessian codec instance.
-func NewHessianCodecCustom(pkgType PackageType, reader *bufio.Reader, bodyLen int) *HessianCodec {
+func NewHessianCodecCustom(pkgType PackageType, reader *bufio.Reader, bodyLen int, isStream bool) *HessianCodec {
Review Comment:
create a new func instead for compatibility
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] read dubbo stream [dubbo-go-hessian2]
Posted by "wongoo (via GitHub)" <gi...@apache.org>.
wongoo commented on code in PR #377:
URL: https://github.com/apache/dubbo-go-hessian2/pull/377#discussion_r2047848185
##########
hessian.go:
##########
@@ -66,9 +66,10 @@ type Service struct {
// HessianCodec defines hessian codec
type HessianCodec struct {
- pkgType PackageType
- reader *bufio.Reader
- bodyLen int
+ pkgType PackageType
+ reader *bufio.Reader
+ bodyLen int
+ isStream bool
Review Comment:
change the name of `isStream` to `stream` or `streaming`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] read dubbo stream [dubbo-go-hessian2]
Posted by "wongoo (via GitHub)" <gi...@apache.org>.
wongoo commented on PR #377:
URL: https://github.com/apache/dubbo-go-hessian2/pull/377#issuecomment-2810953965
CONFLICT TO https://github.com/apache/dubbo-go-hessian2/pull/364
---
NOTE:
The implementation of [dubbo2 rpc protocol](https://dubbo.apache.org/zh/docs/concepts/rpc-protocol/#dubbo2) in dubbo-go-hessian2 project is deprecated for a long time.
The dubbo team has already maintained the [implementation](https://github.com/apache/dubbo-go/tree/master/protocol/dubbo/hessian2) in dubbo-go project instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] read dubbo stream [dubbo-go-hessian2]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #377:
URL: https://github.com/apache/dubbo-go-hessian2/pull/377#discussion_r2043359579
##########
testcases/issue372/issue372_test.go:
##########
@@ -0,0 +1,72 @@
+package issue372
+
+import (
Review Comment:
please format imports as other files
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org