Show
Ignore:
Timestamp:
04/09/09 15:01:07 (4 years ago)
Author:
Cyrus
Message:

Freufunk: I CAN HAZ ZEROES PLZKTHX

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/branches/luci-0.8/modules/freifunk/luasrc/controller/freifunk/freifunk.lua

    r4152 r4416  
    4242    page.title  = "Kontakt" 
    4343 
    44  
    45     local page  = node("freifunk", "status") 
     44    entry({"freifunk", "status"}, alias("freifunk", "status", "status"), "Status", 20) 
     45 
     46    local page  = node("freifunk", "status", "status") 
    4647    page.target = form("freifunk/public_status") 
    47     page.title  = "Status" 
     48    page.title  = i18n("overview") 
    4849    page.order  = 20 
    4950    page.i18n   = "admin-core" 
     
    5253 
    5354    entry({"freifunk", "status.json"}, call("jsonstatus")) 
     55    entry({"freifunk", "status", "zeroes"}, call("zeroes"), "Testdownload")  
    5456 
    5557    assign({"freifunk", "olsr"}, {"admin", "status", "olsr"}, "OLSR", 30) 
     
    119121 
    120122    return data 
     123end 
     124 
     125function zeroes() 
     126    local string = require "string" 
     127    local http = require "luci.http" 
     128    local zeroes = string.rep(string.char(0), 8192) 
     129    local cnt = 0 
     130    local lim = 1024 * 1024 * 1024 
     131     
     132    http.prepare_content("application/x-many-zeroes") 
     133 
     134    while cnt < lim do 
     135        http.write(zeroes) 
     136        cnt = cnt + #zeroes 
     137    end 
    121138end 
    122139