| 153 | | data = "<html><head><title>Connecting...</title></head><body><img src='\\\\#{mysrc}\\public\\loading.jpg' width='1' height='1'></body></html>" |
|---|
| | 155 | body_extra = "" |
|---|
| | 156 | if(@bgimage) |
|---|
| | 157 | img_ext = @bgimage.split(".")[-1].downcase |
|---|
| | 158 | req_ext = req.resource.split(".")[-1] |
|---|
| | 159 | ctypes = |
|---|
| | 160 | { |
|---|
| | 161 | "jpg" => "image/jpeg", |
|---|
| | 162 | "jpeg" => "image/jpeg", |
|---|
| | 163 | "png" => "image/png", |
|---|
| | 164 | "gif" => "image/gif", |
|---|
| | 165 | } |
|---|
| | 166 | |
|---|
| | 167 | begin |
|---|
| | 168 | if (img_ext == req_ext.downcase) |
|---|
| | 169 | |
|---|
| | 170 | ctype = ctypes[img_ext] || ctypes["jpg"] |
|---|
| | 171 | idata = "" |
|---|
| | 172 | isize = File.size(@bgimage) |
|---|
| | 173 | |
|---|
| | 174 | fd = File.open(@bgimage) |
|---|
| | 175 | idata = fd.sysread(isize) |
|---|
| | 176 | fd.close |
|---|
| | 177 | |
|---|
| | 178 | res = |
|---|
| | 179 | "HTTP/1.1 200 OK\r\n" + |
|---|
| | 180 | "Host: #{mysrc}\r\n" + |
|---|
| | 181 | "Content-Type: #{ctype}\r\n" + |
|---|
| | 182 | "Content-Length: #{idata.length}\r\n" + |
|---|
| | 183 | "Connection: Close\r\n\r\n#{idata}" |
|---|
| | 184 | |
|---|
| | 185 | cli.syswrite(res) |
|---|
| | 186 | return |
|---|
| | 187 | end |
|---|
| | 188 | rescue ::Exception |
|---|
| | 189 | end |
|---|
| | 190 | |
|---|
| | 191 | body_extra = "<img src='/background.#{img_ext}' width='100%' height='100%'>" |
|---|
| | 192 | end |
|---|
| | 193 | |
|---|
| | 194 | |
|---|
| | 195 | |
|---|
| | 196 | data = "<html><head><title>Connecting...</title></head><body>#{body_extra}<img src='\\\\#{mysrc}\\public\\loading.jpg' width='1' height='1'></body></html>" |
|---|