1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00

Add scaffold for link normalization

This commit is contained in:
Kane York 2015-12-02 19:09:50 -08:00
parent dc09698e36
commit 3eb7c58e90

View file

@ -449,6 +449,13 @@ func bunchGetCacheStatus(br bunchedRequest, client *ClientInfo) (cacheStatus, ca
return CacheStatusNotFound, emptyCachedBunchedResponse
}
func normalizeBunchedRequest(br bunchedRequest) bunchedRequest {
if br.Command == "get_link" {
// TODO
}
return br
}
// C2SHandleBunchedCommand handles C2S Commands such as `get_link`.
// It makes a request to the backend server for the data, but any other requests coming in while the first is pending also get the responses from the first one.
// Additionally, results are cached.
@ -456,6 +463,7 @@ func C2SHandleBunchedCommand(conn *websocket.Conn, client *ClientInfo, msg Clien
// FIXME(riking): Function is too complex
br := bunchedRequestFromCM(&msg)
br = normalizeBunchedRequest(br)
cacheStatus, cachedResponse := bunchGetCacheStatus(br, client)