keep things building in other places for now

This commit is contained in:
Adam D. Ruppe 2023-11-29 13:52:51 -05:00
parent daad84840f
commit b0b0b09d32
4 changed files with 33 additions and 11 deletions

27
cgi.d
View File

@ -623,7 +623,10 @@ version(with_addon_servers)
version=with_addon_servers_connections; version=with_addon_servers_connections;
version(embedded_httpd) { version(embedded_httpd) {
version=embedded_httpd_hybrid; version(OSX)
version = embedded_httpd_threads;
else
version=embedded_httpd_hybrid;
/* /*
version(with_openssl) { version(with_openssl) {
pragma(lib, "crypto"); pragma(lib, "crypto");
@ -8578,16 +8581,23 @@ final class ScheduledJobServerImplementation : ScheduledJobServer, EventIoServer
int epoll_fd() { return epoll_fd_; } int epoll_fd() { return epoll_fd_; }
} }
/// /++
History:
Added January 6, 2019
+/
version(with_addon_servers_connections) version(with_addon_servers_connections)
interface EventSourceServer { interface EventSourceServer {
/++ /++
sends this cgi request to the event server so it will be fed events. You should not do anything else with the cgi object after this. sends this cgi request to the event server so it will be fed events. You should not do anything else with the cgi object after this.
$(WARNING This API is extremely unstable. I might change it or remove it without notice.)
See_Also: See_Also:
[sendEvent] [sendEvent]
Bugs:
Not implemented on Windows!
History:
Officially stabilised on November 23, 2023 (dub v11.4). It actually worked pretty well in its original design.
+/ +/
public static void adoptConnection(Cgi cgi, in char[] eventUrl) { public static void adoptConnection(Cgi cgi, in char[] eventUrl) {
/* /*
@ -8641,16 +8651,17 @@ interface EventSourceServer {
/++ /++
Sends an event to the event server, starting it if necessary. The event server will distribute it to any listening clients, and store it for `lifetime` seconds for any later listening clients to catch up later. Sends an event to the event server, starting it if necessary. The event server will distribute it to any listening clients, and store it for `lifetime` seconds for any later listening clients to catch up later.
$(WARNING This API is extremely unstable. I might change it or remove it without notice.)
Params: Params:
url = A string identifying this event "bucket". Listening clients must also connect to this same string. I called it `url` because I envision it being just passed as the url of the request. url = A string identifying this event "bucket". Listening clients must also connect to this same string. I called it `url` because I envision it being just passed as the url of the request.
event = the event type string, which is used in the Javascript addEventListener API on EventSource event = the event type string, which is used in the Javascript addEventListener API on EventSource
data = the event data. Available in JS as `event.data`. data = the event data. Available in JS as `event.data`.
lifetime = the amount of time to keep this event for replaying on the event server. lifetime = the amount of time to keep this event for replaying on the event server.
See_Also: Bugs:
[sendEventToEventServer] Not implemented on Windows!
History:
Officially stabilised on November 23, 2023 (dub v11.4). It actually worked pretty well in its original design.
+/ +/
public static void sendEvent(string url, string event, string data, int lifetime) { public static void sendEvent(string url, string event, string data, int lifetime) {
auto s = openLocalServerConnection("/tmp/arsd_cgi_event_server", "--event-server"); auto s = openLocalServerConnection("/tmp/arsd_cgi_event_server", "--event-server");

8
core.d
View File

@ -55,6 +55,13 @@ version(HasThread)
import core.time; import core.time;
} }
version(OSX) {
version(ArsdNoCocoa)
enum bool UseCocoa = false;
else
enum bool UseCocoa = true;
}
version(HasErrno) version(HasErrno)
import core.stdc.errno; import core.stdc.errno;
@ -7183,6 +7190,7 @@ If you are not sure if Cocoa thinks your application is multithreaded or not, yo
} }
// helper raii refcount object // helper raii refcount object
static if(UseCocoa)
struct MacString { struct MacString {
union { union {
// must be wrapped cuz of bug in dmd // must be wrapped cuz of bug in dmd

View File

@ -208,8 +208,8 @@ class MySql : Database {
// we want UTF8 for everything // we want UTF8 for everything
query("SET NAMES 'utf8'"); query("SET NAMES 'utf8mb4'");
//query("SET CHARACTER SET utf8"); //query("SET CHARACTER SET utf8mb4");
} }
string dbname; string dbname;

View File

@ -1042,7 +1042,10 @@ struct Terminal {
uint tcaps() const { uint tcaps() const {
if(!tcapsRequested) { if(!tcapsRequested) {
Terminal* mutable = cast(Terminal*) &this; Terminal* mutable = cast(Terminal*) &this;
mutable._tcaps = getTerminalCapabilities(fdIn, fdOut); version(Posix)
mutable._tcaps = getTerminalCapabilities(fdIn, fdOut);
else
{} // FIXME do something for windows too...
mutable.tcapsRequested = true; mutable.tcapsRequested = true;
} }