1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-31 18:31:06 +00:00

Merge pull request #204 from riking/compile-fix

Remove relative imports, update main for ratelimiting
This commit is contained in:
Mike 2017-09-01 16:11:16 -04:00 committed by GitHub
commit 50f597b769
3 changed files with 8 additions and 7 deletions

View file

@ -6,7 +6,8 @@ import (
"strconv"
"strings"
"../../server"
"github.com/FrankerFaceZ/FrankerFaceZ/socketserver/server"
"github.com/FrankerFaceZ/FrankerFaceZ/socketserver/server/rate"
"github.com/abiosoft/ishell"
"github.com/gorilla/websocket"
)
@ -33,7 +34,7 @@ func commandLineConsole() {
Command: "message",
Arguments: args[0],
}
server.PublishToAll(msg)
server.PublishToAll(msg, rate.Unlimited())
return "Message sent.", nil
})
@ -52,9 +53,9 @@ func commandLineConsole() {
var count int
if target == "_ALL" {
count = server.PublishToAll(msg)
count = server.PublishToAll(msg, rate.Unlimited())
} else {
count = server.PublishToChannel(target, msg)
count = server.PublishToChannel(target, msg, rate.Unlimited())
}
return fmt.Sprintf("Published to %d clients", count), nil
})

View file

@ -1,4 +1,4 @@
package main // import "bitbucket.org/stendec/frankerfacez/socketserver/cmd/ffzsocketserver"
package main // import "github.com/FrankerFaceZ/FrankerFaceZ/socketserver/cmd/ffzsocketserver"
import (
"encoding/json"
@ -9,7 +9,7 @@ import (
"net/http"
"os"
"../../server"
"github.com/FrankerFaceZ/FrankerFaceZ/socketserver/server"
)
import _ "net/http/pprof"

View file

@ -139,7 +139,7 @@ func (backend *backendInfo) SendRemoteCommand(remoteCommand, data string, auth A
if resp.StatusCode == 401 {
return "", ErrAuthorizationNeeded
} else if resp.StatusCode != 200 {
} else if resp.StatusCode < 200 || resp.StatusCode > 299 { // any non-2xx
if resp.Header.Get("Content-Type") == "application/json" {
var err2 ErrForwardedFromBackend
err := json.Unmarshal(respBytes, &err2.JSONError)