mirror of https://github.com/adamdruppe/arsd.git
maybe unbalanced parens
This commit is contained in:
parent
18a7988efc
commit
1da9f87b22
4
cgi.d
4
cgi.d
|
@ -148,7 +148,7 @@ void main() {
|
|||
|
||||
Concepts:
|
||||
Input: [Cgi.get], [Cgi.post], [Cgi.request], [Cgi.files], [Cgi.cookies], [Cgi.pathInfo], [Cgi.requestMethod],
|
||||
and HTTP headers ([Cgi.headers], [Cgi.userAgent], [Cgi.referrer], [Cgi.accept], [Cgi.authorization], [Cgi.lastEventId]
|
||||
and HTTP headers ([Cgi.headers], [Cgi.userAgent], [Cgi.referrer], [Cgi.accept], [Cgi.authorization], [Cgi.lastEventId])
|
||||
|
||||
Output: [Cgi.write], [Cgi.header], [Cgi.setResponseStatus], [Cgi.setResponseContentType], [Cgi.gzipResponse]
|
||||
|
||||
|
@ -2232,7 +2232,7 @@ class Cgi {
|
|||
immutable(char[]) scriptName; /// The full base path of your program, as seen by the user. If your program is located at site.com/programs/apps, scriptName == "/programs/apps".
|
||||
immutable(char[]) scriptFileName; /// The physical filename of your script
|
||||
immutable(char[]) authorization; /// The full authorization string from the header, undigested. Useful for implementing auth schemes such as OAuth 1.0. Note that some web servers do not forward this to the app without taking extra steps. See requireBasicAuth's comment for more info.
|
||||
immutable(char[]) accept; /// The HTTP accept header is the user agent telling what content types it is willing to accept. This is often */*; they accept everything, so it's not terribly useful. (The similar sounding Accept-Encoding header is handled automatically for chunking and gzipping. Simply set gzipResponse = true and cgi.d handles the details, zipping if the user's browser is willing to accept it.
|
||||
immutable(char[]) accept; /// The HTTP accept header is the user agent telling what content types it is willing to accept. This is often */*; they accept everything, so it's not terribly useful. (The similar sounding Accept-Encoding header is handled automatically for chunking and gzipping. Simply set gzipResponse = true and cgi.d handles the details, zipping if the user's browser is willing to accept it.)
|
||||
immutable(char[]) lastEventId; /// The HTML 5 draft includes an EventSource() object that connects to the server, and remains open to take a stream of events. My arsd.rtud module can help with the server side part of that. The Last-Event-Id http header is defined in the draft to help handle loss of connection. When the browser reconnects to you, it sets this header to the last event id it saw, so you can catch it up. This member has the contents of that header.
|
||||
|
||||
immutable(RequestMethod) requestMethod; /// The HTTP request verb: GET, POST, etc. It is represented as an enum in cgi.d (which, like many enums, you can convert back to string with std.conv.to()). A HTTP GET is supposed to, according to the spec, not have side effects; a user can GET something over and over again and always have the same result. On all requests, the get[] and getArray[] members may be filled in. The post[] and postArray[] members are only filled in on POST methods.
|
||||
|
|
10
minigui.d
10
minigui.d
|
@ -4998,6 +4998,16 @@ class MouseActivatedWidget : Widget {
|
|||
}
|
||||
else static assert(false);
|
||||
|
||||
/*
|
||||
/++
|
||||
Like the tablet thing, it would have a label, a description, and a switch slider thingy.
|
||||
|
||||
Basically the same as a checkbox.
|
||||
+/
|
||||
class OnOffSwitch : MouseActivatedWidget {
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
///
|
||||
class Checkbox : MouseActivatedWidget {
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
// FIXME: if the taskbar dies, a notification icon is undocked... but never detects a new taskbar spawning
|
||||
// https://dpaste.dzfl.pl/7a77355acaec
|
||||
|
||||
/*
|
||||
Event Loop would be nices:
|
||||
|
||||
* add on idle - runs when nothing else happens
|
||||
* send messages without a recipient window
|
||||
* setTimeout
|
||||
* setInterval
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
Text layout needs a lot of work. Plain drawText is useful but too
|
||||
limited. It will need some kind of text context thing which it will
|
||||
|
@ -2629,6 +2639,21 @@ struct EventLoop {
|
|||
static EventLoopImpl* impl;
|
||||
}
|
||||
|
||||
version(linux)
|
||||
void delegate(int, int) globalHupHandler;
|
||||
|
||||
version(linux)
|
||||
void makeNonBlocking(int fd) {
|
||||
import fcntl = core.sys.posix.fcntl;
|
||||
auto flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0);
|
||||
if(flags == -1)
|
||||
throw new Exception("fcntl get");
|
||||
flags |= fcntl.O_NONBLOCK;
|
||||
auto s = fcntl.fcntl(fd, fcntl.F_SETFL, flags);
|
||||
if(s == -1)
|
||||
throw new Exception("fcntl set");
|
||||
}
|
||||
|
||||
struct EventLoopImpl {
|
||||
int refcount;
|
||||
|
||||
|
@ -2898,6 +2923,12 @@ struct EventLoopImpl {
|
|||
// (if you want other fds, use arsd.eventloop and compile with -version=with_eventloop), it offers a fuller api for arbitrary stuff.
|
||||
}
|
||||
}
|
||||
if(flags & ep.EPOLLHUP) {
|
||||
if(PosixFdReader* pfr = fd in PosixFdReader.mapping)
|
||||
(*pfr).hup(flags);
|
||||
if(globalHupHandler)
|
||||
globalHupHandler(fd, flags);
|
||||
}
|
||||
/+
|
||||
} else {
|
||||
// not interested in OUT, we are just reading here.
|
||||
|
@ -4165,6 +4196,13 @@ class PosixFdReader {
|
|||
onReady(fd, (flags & ep.EPOLLIN) ? true : false, (flags & ep.EPOLLOUT) ? true : false);
|
||||
}
|
||||
|
||||
void hup(uint flags) {
|
||||
if(onHup)
|
||||
onHup();
|
||||
}
|
||||
|
||||
void delegate() onHup;
|
||||
|
||||
int fd = -1;
|
||||
__gshared PosixFdReader[int] mapping;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue