Jelajahi Sumber

Merge pull request #88 from rod-hynes/master

Fix: last_connected timestamp was not properly deserialized
Rod Hynes 11 tahun lalu
induk
melakukan
eb58e8f000
2 mengubah file dengan 6 tambahan dan 4 penghapusan
  1. 2 2
      README.md
  2. 4 2
      psiphon/serverApi.go

+ 2 - 2
README.md

@@ -29,8 +29,8 @@ Setup
     {
         "PropagationChannelId" : "<placeholder>",
         "SponsorId" : "<placeholder>",
-        "RemoteServerListUrl" : "<placeholder>",
-        "RemoteServerListSignaturePublicKey" : "<placeholder>",
+        "RemoteServerListUrl" : "",
+        "RemoteServerListSignaturePublicKey" : "",
         "DataStoreDirectory" : "",
         "DataStoreTempDirectory" : "",
         "LogFilename" : "",

+ 4 - 2
psiphon/serverApi.go

@@ -109,14 +109,16 @@ func (session *Session) DoConnectedRequest() error {
 	if err != nil {
 		return ContextError(err)
 	}
+
 	var response struct {
-		connectedTimestamp string `json:connected_timestamp`
+		ConnectedTimestamp string `json:"connected_timestamp"`
 	}
 	err = json.Unmarshal(responseBody, &response)
 	if err != nil {
 		return ContextError(err)
 	}
-	err = SetKeyValue(DATA_STORE_LAST_CONNECTED_KEY, response.connectedTimestamp)
+
+	err = SetKeyValue(DATA_STORE_LAST_CONNECTED_KEY, response.ConnectedTimestamp)
 	if err != nil {
 		return ContextError(err)
 	}