结束压缩相关处理
()
| 1247 | |
| 1248 | // 结束压缩相关处理 |
| 1249 | func (this *HTTPWriter) finishCompression() { |
| 1250 | if this.compressionCacheWriter != nil { |
| 1251 | if this.isOk { |
| 1252 | err := this.compressionCacheWriter.Close() |
| 1253 | if err == nil { |
| 1254 | var expiredAt = this.compressionCacheWriter.ExpiredAt() |
| 1255 | this.cacheStorage.AddToList(&caches.Item{ |
| 1256 | Type: this.compressionCacheWriter.ItemType(), |
| 1257 | Key: this.compressionCacheWriter.Key(), |
| 1258 | ExpiresAt: expiredAt, |
| 1259 | StaleAt: expiredAt + int64(this.calculateStaleLife()), |
| 1260 | HeaderSize: this.compressionCacheWriter.HeaderSize(), |
| 1261 | BodySize: this.compressionCacheWriter.BodySize(), |
| 1262 | Host: this.req.ReqHost, |
| 1263 | ServerId: this.req.ReqServer.Id, |
| 1264 | }) |
| 1265 | } |
| 1266 | } else { |
| 1267 | _ = this.compressionCacheWriter.Discard() |
| 1268 | } |
| 1269 | } |
| 1270 | } |
| 1271 | |
| 1272 | // 最终关闭 |
| 1273 | func (this *HTTPWriter) finishRequest() { |
no test coverage detected