formatting
This commit is contained in:
parent
102fca266a
commit
a50985ff8d
|
@ -1,7 +1,7 @@
|
|||
import httpclient, zippy, strformat
|
||||
import httpclient, strformat, zippy
|
||||
|
||||
let client = newHttpClient()
|
||||
client.headers = newHttpHeaders({ "Accept-Encoding": "gzip" })
|
||||
client.headers = newHttpHeaders({"Accept-Encoding": "gzip"})
|
||||
|
||||
let
|
||||
response = client.request("http://www.google.com")
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import asynchttpserver, asyncdispatch, zippy
|
||||
import asyncdispatch, asynchttpserver, zippy
|
||||
|
||||
let server = newAsyncHttpServer()
|
||||
|
||||
proc cb(req: Request) {.async.} =
|
||||
if req.headers["Accept-Encoding"].contains("gzip"):
|
||||
# This client supports gzip, send compressed response
|
||||
let headers = newHttpHeaders([("Content-Encoding","gzip")])
|
||||
let headers = newHttpHeaders([("Content-Encoding", "gzip")])
|
||||
await req.respond(
|
||||
Http200,
|
||||
compress("gzip'ed response body", dfGzip),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import strformat, strutils, fidget/opengl/perf
|
||||
import fidget/opengl/perf, strformat, strutils
|
||||
|
||||
const
|
||||
minMatchLen = 3
|
||||
|
@ -82,12 +82,11 @@ proc lz77Encode2(src: seq[uint8]): seq[uint16] =
|
|||
break
|
||||
inc chainLen
|
||||
|
||||
let offset = (
|
||||
var offset: int
|
||||
if hashPos <= windowPos:
|
||||
windowPos - hashPos
|
||||
offset = (windowPos - hashPos).int
|
||||
else:
|
||||
windowPos - hashPos + windowSize
|
||||
).int
|
||||
offset = (windowPos - hashPos + windowSize).int
|
||||
|
||||
if offset <= 0 or offset < prevOffset:
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue