mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 03:40:54 +00:00
Rlock for form query
This commit is contained in:
parent
55e6298f29
commit
3e2c795410
@ -334,11 +334,13 @@ func (input *BeegoInput) Query(key string) string {
|
|||||||
}
|
}
|
||||||
if input.Context.Request.Form == nil {
|
if input.Context.Request.Form == nil {
|
||||||
input.dataLock.Lock()
|
input.dataLock.Lock()
|
||||||
defer input.dataLock.Unlock()
|
|
||||||
if input.Context.Request.Form == nil {
|
if input.Context.Request.Form == nil {
|
||||||
input.Context.Request.ParseForm()
|
input.Context.Request.ParseForm()
|
||||||
}
|
}
|
||||||
|
input.dataLock.Unlock()
|
||||||
}
|
}
|
||||||
|
input.dataLock.RLock()
|
||||||
|
defer input.dataLock.RUnlock()
|
||||||
return input.Context.Request.Form.Get(key)
|
return input.Context.Request.Form.Get(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user