Mercurial > urweb
view demo/buffer.ur @ 2071:739172204214
Introduce recv timeout controlled by '-T' option in http.c
This should prevent a DDoS attack where attacker and keeps the connection open
but send no data.
author | Sergey Mironov <grrwlf@gmail.com> |
---|---|
date | Tue, 02 Sep 2014 17:42:10 +0000 |
parents | 755a71c99be5 |
children |
line wrap: on
line source
datatype lines = End | Line of string * source lines type t = { Head : source lines, Tail : source (source lines) } val create = head <- source End; tail <- source head; return {Head = head, Tail = tail} fun renderL lines = case lines of End => <xml/> | Line (line, linesS) => <xml>{[line]}<br/><dyn signal={renderS linesS}/></xml> and renderS linesS = lines <- signal linesS; return (renderL lines) fun render t = renderS t.Head fun write t s = oldTail <- get t.Tail; newTail <- source End; set oldTail (Line (s, newTail)); set t.Tail newTail