6da0cdb9 by JessonChan Committed by astaxie

no need lock here

1 parent 9f070c62
......@@ -47,26 +47,20 @@ import (
"net/url"
"os"
"strings"
"sync"
"time"
)
var defaultSetting = BeegoHttpSettings{UserAgent: "beegoServer", ConnectTimeout: 60 * time.Second, ReadWriteTimeout: 60 * time.Second, Gzip: true}
var defaultCookieJar http.CookieJar
var settingMutex sync.Mutex
// createDefaultCookie creates a global cookiejar to store cookies.
func createDefaultCookie() {
settingMutex.Lock()
defaultCookieJar, _ = cookiejar.New(nil)
settingMutex.Unlock()
}
// Overwrite default settings
func SetDefaultSetting(setting BeegoHttpSettings) {
settingMutex.Lock()
defaultSetting = setting
settingMutex.Unlock()
}
// return *BeegoHttpRequest with specific method
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!