forked from forgejo/forgejo
Fix recovery middleware to render gitea style page. (#13857)
* Some changes to fix recovery * Move Recovery to middlewares * Remove trace code * Fix lint * add session middleware and remove dependent on macaron for sso * Fix panic 500 page rendering * Fix bugs * Fix fmt * Fix vendor * recover unnecessary change * Fix lint and addd some comments about the copied codes. * Use util.StatDir instead of com.StatDir Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
126c9331d6
commit
15a475b7db
75 changed files with 5233 additions and 307 deletions
28
vendor/github.com/couchbase/gomemcached/client/mc.go
generated
vendored
28
vendor/github.com/couchbase/gomemcached/client/mc.go
generated
vendored
|
@ -375,6 +375,25 @@ func (c *Client) setCollection(req *gomemcached.MCRequest, context ...*ClientCon
|
|||
return nil
|
||||
}
|
||||
|
||||
// Sets collection info in extras
|
||||
func (c *Client) setExtrasCollection(req *gomemcached.MCRequest, context ...*ClientContext) error {
|
||||
collectionId := uint32(0)
|
||||
if len(context) > 0 {
|
||||
collectionId = context[0].CollId
|
||||
}
|
||||
|
||||
// if the optional collection is specified, it must be default for clients that haven't turned on collections
|
||||
if atomic.LoadUint32(&c.collectionsEnabled) == 0 {
|
||||
if collectionId != 0 {
|
||||
return fmt.Errorf("Client does not use collections but a collection was specified")
|
||||
}
|
||||
} else {
|
||||
req.Extras = make([]byte, 4)
|
||||
binary.BigEndian.PutUint32(req.Extras, collectionId)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Client) setVbSeqnoContext(req *gomemcached.MCRequest, context ...*ClientContext) error {
|
||||
if len(context) == 0 || req == nil {
|
||||
return nil
|
||||
|
@ -516,9 +535,14 @@ func (c *Client) Del(vb uint16, key string, context ...*ClientContext) (*gomemca
|
|||
|
||||
// Get a random document
|
||||
func (c *Client) GetRandomDoc(context ...*ClientContext) (*gomemcached.MCResponse, error) {
|
||||
return c.Send(&gomemcached.MCRequest{
|
||||
req := &gomemcached.MCRequest{
|
||||
Opcode: 0xB6,
|
||||
})
|
||||
}
|
||||
err := c.setExtrasCollection(req, context...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Send(req)
|
||||
}
|
||||
|
||||
// AuthList lists SASL auth mechanisms.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue