fix
This commit is contained in:
parent
cee0dec313
commit
4d428b8e7d
@ -68,17 +68,17 @@ func (this *UDPListener) serverRead() {
|
||||
retcode = 0
|
||||
}
|
||||
case "sub":
|
||||
if obj.Topic != "" && obj.Msg != "" {
|
||||
if obj.Topic != "" && obj.Channel != "" {
|
||||
service.MqManager.SubscribeChannel(obj.Topic, obj.Channel)
|
||||
retcode = 0
|
||||
}
|
||||
case "unsub":
|
||||
if obj.Topic != "" && obj.Msg != "" {
|
||||
if obj.Topic != "" && obj.Channel != "" {
|
||||
service.MqManager.UnsubscribeChannel(obj.Topic, obj.Channel)
|
||||
retcode = 0
|
||||
}
|
||||
case "consume":
|
||||
if obj.Topic != "" && obj.Msg != "" {
|
||||
if obj.Topic != "" && obj.Channel != "" {
|
||||
retcode = 0
|
||||
content = service.MqManager.ConsumeTopic(obj.Topic, obj.Channel)
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ func (this *mqManager) ConsumeTopic(topic, channel string) (msg string) {
|
||||
}
|
||||
}
|
||||
|
||||
if msgidx > 0 {
|
||||
if msgidx > -1 {
|
||||
msg = (*t).msgList[msgidx].content
|
||||
if del {
|
||||
if msgidx+1 < len((*t).msgList) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user