From 538aa357e72350ee023c6c486456666235784d20 Mon Sep 17 00:00:00 2001 From: matsuoky Date: Sun, 17 Jul 2016 15:38:38 +0900 Subject: [PATCH] accept appengine users --- gcm.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcm.go b/gcm.go index 4508f48..613a9ad 100644 --- a/gcm.go +++ b/gcm.go @@ -65,6 +65,7 @@ var ( }{ m: make(map[string]*xmppGcmClient), } + Client *http.Client ) // Prints debug info if DebugMode is set. @@ -463,7 +464,10 @@ func (eb exponentialBackoff) wait() { // Send a message using the HTTP GCM connection server. func SendHttp(apiKey string, m HttpMessage) (*HttpResponse, error) { - c := &httpGcmClient{httpAddress, &http.Client{}, "0"} + if Client == nil { + Client = &http.Client{} + } + c := &httpGcmClient{httpAddress, Client, "0"} b := newExponentialBackoff() return sendHttp(apiKey, m, c, b) }