Skip to content

Commit

Permalink
add mport access log
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglei28 committed Sep 5, 2024
1 parent b63a532 commit 88d97eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1249,8 +1249,10 @@ func (a *Agent) mhandle(k string, h http.Handler) {
setAgentLock.Unlock()
}
http.HandleFunc(k, func(w http.ResponseWriter, r *http.Request) {
vlog.Infof("mport request: %s, address: %s", r.URL.Path, r.RemoteAddr)
if !PermissionCheck(r) {
w.Write([]byte("need permission!"))
vlog.Warningf("mport request no permission: %s, address: %s", r.URL.Path, r.RemoteAddr)
return
}
defer func() {
Expand Down
2 changes: 1 addition & 1 deletion core/motan.go
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ func GetRuntimeInfo(s interface{}) map[string]interface{} {
return map[string]interface{}{}
}

//-----------CircularRecorder-------------
// -----------CircularRecorder-------------
type circularRecorderItem struct {
timestamp int64
value interface{}
Expand Down

0 comments on commit 88d97eb

Please sign in to comment.