Skip to content

Commit

Permalink
Merge pull request #404 from weibocom/opt/mport_log
Browse files Browse the repository at this point in the history
add mport access log
  • Loading branch information
rayzhang0603 authored Sep 5, 2024
2 parents b63a532 + 88d97eb commit fa31bb4
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 fa31bb4

Please sign in to comment.