Skip to content

Commit

Permalink
fix: wrong header sent on server/client.go
Browse files Browse the repository at this point in the history
  • Loading branch information
worg committed Mar 23, 2022
1 parent b48ba3c commit aae3b21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Binary file removed examples/client_test/client_test
Binary file not shown.
8 changes: 4 additions & 4 deletions server/client/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ func (c *Conn) allocateMessageId(f *frame.Frame, sub *Subscription) {
// if there is any requirement by the client to acknowledge, set
// the ack header as per STOMP 1.2
if sub == nil || sub.ack == frame.AckAuto {
f.Header.Del(frame.Id)
f.Header.Del(frame.Ack)
} else {
f.Header.Set(frame.Id, messageId)
f.Header.Set(frame.Ack, messageId)
}
}
}
Expand Down Expand Up @@ -659,7 +659,7 @@ func (c *Conn) handleAck(f *frame.Frame) error {
var err error
var msgId string

if ack, ok := f.Header.Contains(frame.Id); ok {
if ack, ok := f.Header.Contains(frame.Ack); ok {
msgId = ack
} else if msgId, ok = f.Header.Contains(frame.MessageId); !ok {
return missingHeader(frame.MessageId)
Expand Down Expand Up @@ -702,7 +702,7 @@ func (c *Conn) handleNack(f *frame.Frame) error {
var err error
var msgId string

if ack, ok := f.Header.Contains(frame.Id); ok {
if ack, ok := f.Header.Contains(frame.Ack); ok {
msgId = ack
} else if msgId, ok = f.Header.Contains(frame.MessageId); !ok {
return missingHeader(frame.MessageId)
Expand Down

0 comments on commit aae3b21

Please sign in to comment.