Skip to content

Commit a6a3b31

Browse files
author
Michael O'Brien
committed
DEV: support windows vs 2017
1 parent fe986b4 commit a6a3b31

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2803
-2932
lines changed

dist/ejs.slots.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@
190190
191191
This file is generated by ejsmod
192192
193-
Slot definitions. Version 2.7.2.
193+
Slot definitions. Version 2.7.3.
194194
*/
195195

196196
#ifndef _h_SLOTS_EjsSlots
197197
#define _h_SLOTS_EjsSlots 1
198198

199199
#ifndef EJS_VERSION
200-
#define EJS_VERSION "2.7.2"
200+
#define EJS_VERSION "2.7.3"
201201
#endif
202202

203203
/*

doc/api/ejscript.tags

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

doc/dist/ref/api/http.html

Lines changed: 0 additions & 52 deletions
Large diffs are not rendered by default.

doc/dist/ref/api/mpr.html

Lines changed: 0 additions & 82 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
}
3535
],
3636
"dependencies": {
37-
"http": "~6.2",
38-
"mpr": "~6.2",
37+
"http": "~7",
38+
"mpr": "~7",
3939
"osdep": "~0.9",
4040
"pcre": "~1.0",
4141
"ssl": "~0.9",

paks/http/dist/http.h

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2995,7 +2995,7 @@ typedef struct HttpConn {
29952995
bool suppressTrace: 1; /**< Do not trace this connection */
29962996
bool upgraded: 1; /**< Request protocol upgraded */
29972997
bool worker: 1; /**< Use worker */
2998-
#if DEPRECATED || 1
2998+
#if DEPRECATE
29992999
bool io: 1; /**< In httpIOEvent */
30003000
#endif
30013001

@@ -3915,7 +3915,7 @@ PUBLIC int httpCreateAuthType(cchar *name, HttpAskLogin askLogin, HttpParseAuth
39153915
*/
39163916
PUBLIC void httpSetAuthSession(HttpAuth *auth, bool noSession);
39173917

3918-
#if DEPRECATED || 1
3918+
#if DEPRECATE
39193919
#define httpAddAuthType httpCreateAuthType
39203920
#endif
39213921

@@ -4081,7 +4081,7 @@ PUBLIC bool httpIsAuthenticated(HttpConn *conn);
40814081
*/
40824082
PUBLIC bool httpLogin(HttpConn *conn, cchar *username, cchar *password);
40834083

4084-
#if DEPRECATED || 1
4084+
#if DEPRECATE
40854085
#define httpLoggedIn httpIsAuthenticated
40864086
#endif
40874087

@@ -4472,7 +4472,7 @@ PUBLIC void httpSetStreaming(struct HttpHost *host, cchar *mime, cchar *uri, boo
44724472
#define HTTP_ROUTE_OWN_LISTEN 0x80000 /**< Override listening endpoints */
44734473
#define HTTP_ROUTE_UTILITY 0x100000 /**< Route hosted by a utility */
44744474

4475-
#if DEPRECATED || 1
4475+
#if DEPRECATE
44764476
#define HTTP_ROUTE_SET_DEFINED 0x10000 /**< Route set defined */
44774477
#endif
44784478

@@ -4503,7 +4503,7 @@ typedef struct HttpRoute {
45034503
char *startWith; /**< Starting literal portion of pattern */
45044504
char *optimizedPattern; /**< Processed pattern (excludes prefix) */
45054505
char *prefix; /**< Application scriptName prefix. Set to '' for '/'. Always set */
4506-
#if DEPRECATED || 1
4506+
#if DEPRECATE
45074507
char *serverPrefix; /**< Prefix for the server-side. Does not include prefix. Always set */
45084508
#endif
45094509
char *tplate; /**< URI template for forming links based on this route (includes prefix) */
@@ -5378,7 +5378,7 @@ PUBLIC void httpSetRouteAuth(HttpRoute *route, HttpAuth *auth);
53785378
PUBLIC void httpSetRouteAutoDelete(HttpRoute *route, bool on);
53795379

53805380
/**
5381-
Define whether updating a request may compile from source
5381+
Define whether updating a request may compile from source
53825382
@param route Route to modify
53835383
@param on Set to true to enable
53845384
@ingroup HttpRoute
@@ -5598,7 +5598,7 @@ PUBLIC void httpSetRouteRenameUploads(HttpRoute *route, bool enable);
55985598
*/
55995599
PUBLIC void httpSetRouteScript(HttpRoute *route, cchar *script, cchar *scriptPath);
56005600

5601-
#if DEPRECATED || 1
5601+
#if DEPRECATE
56025602
/**
56035603
Set the route prefix for server-side URIs
56045604
@description The server-side route prefix is appended to the route prefix to create the complete prefix
@@ -5762,7 +5762,6 @@ PUBLIC void httpSetRouteVar(HttpRoute *route, cchar *token, cchar *value);
57625762
*/
57635763
PUBLIC void httpSetRouteUpdate(HttpRoute *route, bool on);
57645764

5765-
#if DEPRECATED || 1
57665765
/**
57675766
Set the default upload directory for file uploads
57685767
@param route Route to modify
@@ -5771,7 +5770,6 @@ PUBLIC void httpSetRouteUpdate(HttpRoute *route, bool on);
57715770
@stability Evolving
57725771
*/
57735772
PUBLIC void httpSetRouteUploadDir(HttpRoute *route, cchar *dir);
5774-
#endif
57755773

57765774
/**
57775775
Define the maximum number of workers for a route
@@ -6977,7 +6975,7 @@ PUBLIC ssize httpFormatResponseBody(HttpConn *conn, cchar *title, cchar *fmt, ..
69776975
Get a tx http header.
69786976
@description Get a http response header value for a given header key.
69796977
@param conn HttpConn connection object created via #httpCreateConn
6980-
@param key Name of the header to retrieve.
6978+
@param key Name of the header to retrieve.
69816979
@return Value associated with the header key or null if the key did not exist in the response.
69826980
@ingroup HttpTx
69836981
@stability Prototype
@@ -7120,7 +7118,7 @@ PUBLIC void httpSetContentType(HttpConn *conn, cchar *mimeType);
71207118
@ingroup HttpTx
71217119
@stability Stable
71227120
*/
7123-
PUBLIC void httpSetCookie(HttpConn *conn, cchar *name, cchar *value, cchar *path, cchar *domain, MprTicks lifespan,
7121+
PUBLIC void httpSetCookie(HttpConn *conn, cchar *name, cchar *value, cchar *path, cchar *domain, MprTicks lifespan,
71247122
int flags);
71257123

71267124
/**

paks/http/dist/httpLib.c

Lines changed: 32 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ PUBLIC void httpInitAuth()
14311431
httpCreateAuthStore("system", httpPamVerifyUser);
14321432
#endif
14331433

1434-
#if DEPRECATED || 1
1434+
#if DEPRECATE
14351435
httpCreateAuthStore("file", configVerifyUser);
14361436
httpCreateAuthStore("internal", configVerifyUser);
14371437
#if ME_COMPILER_HAS_PAM && ME_HTTP_PAM
@@ -3736,7 +3736,7 @@ PUBLIC int httpLoadConfig(HttpRoute *route, cchar *path)
37363736
if ((obj = mprGetJsonObj(config, "include")) != 0) {
37373737
parseInclude(route, config, obj);
37383738
}
3739-
#if DEPRECATED || 1
3739+
#if DEPRECATE
37403740
{
37413741
MprJson *obj;
37423742
if ((obj = mprGetJsonObj(config, "app.http")) != 0) {
@@ -3810,7 +3810,7 @@ PUBLIC void httpParseAll(HttpRoute *route, cchar *key, MprJson *prop)
38103810
}
38113811

38123812

3813-
#if DEPRECATED || 1
3813+
#if DEPRECATE
38143814
static void parseApp(HttpRoute *route, cchar *key, MprJson *prop)
38153815
{
38163816
httpParseAll(route, 0, prop);
@@ -4110,7 +4110,7 @@ static void parseCache(HttpRoute *route, cchar *key, MprJson *prop)
41104110
}
41114111
methods = getList(mprReadJsonObj(child, "methods"));
41124112
urls = getList(mprReadJsonObj(child, "urls"));
4113-
#if DEPRECATED || 1
4113+
#if DEPRECATE
41144114
if (urls == 0) {
41154115
if ((urls = getList(mprReadJsonObj(child, "urls"))) != 0) {
41164116
mprLog("error http config", 0, "Using deprecated property \"uris\", use \"urls\" instead");
@@ -5027,7 +5027,7 @@ static void parseServerModules(HttpRoute *route, cchar *key, MprJson *prop)
50275027
module = mprCreateModule(name, path, entry, HTTP);
50285028

50295029
if (mprLoadModule(module) < 0) {
5030-
#if DEPRECATED || 1
5030+
#if DEPRECATE
50315031
module->entry = sfmt("ma%sInit", stitle(name));
50325032
if (mprLoadModule(module) < 0) {
50335033
httpParseError(route, "Cannot load module: %s", path);
@@ -5065,7 +5065,7 @@ static void parseServerMonitors(HttpRoute *route, cchar *key, MprJson *prop)
50655065
}
50665066

50675067

5068-
#if DEPRECATE || 1
5068+
#if DEPRECATE
50695069
static void parseServerPrefix(HttpRoute *route, cchar *key, MprJson *prop)
50705070
{
50715071
httpSetRouteServerPrefix(route, prop->value);
@@ -5123,6 +5123,7 @@ static void parseSslAuthorityFile(HttpRoute *route, cchar *key, MprJson *prop)
51235123
}
51245124

51255125

5126+
#if DEPRECATE
51265127
static void parseSslAuthorityDirectory(HttpRoute *route, cchar *key, MprJson *prop)
51275128
{
51285129
cchar *path;
@@ -5136,6 +5137,7 @@ static void parseSslAuthorityDirectory(HttpRoute *route, cchar *key, MprJson *pr
51365137
}
51375138
}
51385139
}
5140+
#endif
51395141

51405142

51415143
static void parseSslCertificate(HttpRoute *route, cchar *key, MprJson *prop)
@@ -5562,7 +5564,9 @@ PUBLIC int httpInitParser()
55625564
httpAddConfig("http.ssl", parseSsl);
55635565
httpAddConfig("http.ssl.authority", httpParseAll);
55645566
httpAddConfig("http.ssl.authority.file", parseSslAuthorityFile);
5567+
#if DEPRECATE
55655568
httpAddConfig("http.ssl.authority.directory", parseSslAuthorityDirectory);
5569+
#endif
55665570
httpAddConfig("http.ssl.certificate", parseSslCertificate);
55675571
httpAddConfig("http.ssl.ciphers", parseSslCiphers);
55685572
httpAddConfig("http.ssl.key", parseSslKey);
@@ -5585,7 +5589,7 @@ PUBLIC int httpInitParser()
55855589
httpAddConfig("http.trace", parseTrace);
55865590
httpAddConfig("http.xsrf", parseXsrf);
55875591

5588-
#if DEPRECATED || 1
5592+
#if DEPRECATE
55895593
httpAddConfig("app", parseApp);
55905594
httpAddConfig("http.domain", parseName);
55915595
httpAddConfig("http.handler", parsePipelineHandler);
@@ -6089,7 +6093,7 @@ PUBLIC void httpIO(HttpConn *conn, int eventMask)
60896093
assert(conn->tx);
60906094
assert(conn->rx);
60916095

6092-
#if DEPRECATED || 1
6096+
#if DEPRECATE
60936097
/* Just IO state asserting */
60946098
if (conn->io) {
60956099
assert(!conn->io);
@@ -6140,7 +6144,9 @@ PUBLIC void httpIO(HttpConn *conn, int eventMask)
61406144
} else if (!mprIsSocketEof(conn->sock) && conn->async && !conn->delay) {
61416145
httpEnableConnEvents(conn);
61426146
}
6147+
#if DEPRECATE
61436148
conn->io = 0;
6149+
#endif
61446150
}
61456151

61466152

@@ -12458,10 +12464,9 @@ PUBLIC HttpRoute *httpCreateRoute(HttpHost *host)
1245812464
route->workers = -1;
1245912465
route->prefix = MPR->emptyString;
1246012466
route->trace = http->trace;
12461-
#if DEPRECATED || 1
12467+
#if DEPRECATE
1246212468
route->serverPrefix = MPR->emptyString;
1246312469
#endif
12464-
1246512470
route->headers = mprCreateList(-1, MPR_LIST_STABLE);
1246612471
route->handlers = mprCreateList(-1, MPR_LIST_STABLE);
1246712472
route->indexes = mprCreateList(-1, MPR_LIST_STABLE);
@@ -12490,11 +12495,6 @@ PUBLIC HttpRoute *httpCreateRoute(HttpHost *host)
1249012495
route->limits = mprMemdup(http->serverLimits ? http->serverLimits : http->clientLimits, sizeof(HttpLimits));
1249112496
}
1249212497
route->mimeTypes = MPR->mimeTypes;
12493-
#if UNUSED
12494-
if ((route->mimeTypes = mprCreateMimeTypes("mime.types")) == 0) {
12495-
route->mimeTypes = MPR->mimeTypes;
12496-
}
12497-
#endif
1249812498
definePathVars(route);
1249912499
return route;
1250012500
}
@@ -12574,7 +12574,7 @@ PUBLIC HttpRoute *httpCreateInheritedRoute(HttpRoute *parent)
1257412574
route->updates = parent->updates;
1257512575
route->vars = parent->vars;
1257612576
route->workers = parent->workers;
12577-
#if DEPRECATED || 1
12577+
#if DEPRECATE
1257812578
route->serverPrefix = parent->serverPrefix;
1257912579
#endif
1258012580
return route;
@@ -12639,7 +12639,7 @@ static void manageRoute(HttpRoute *route, int flags)
1263912639
mprMark(route->updates);
1264012640
mprMark(route->vars);
1264112641
mprMark(route->webSocketsProtocol);
12642-
#if DEPRECATED || 1
12642+
#if DEPRECATE
1264312643
mprMark(route->serverPrefix);
1264412644
#endif
1264512645

@@ -13822,7 +13822,7 @@ PUBLIC void httpSetRoutePreserveFrames(HttpRoute *route, bool on)
1382213822
}
1382313823

1382413824

13825-
#if DEPRECATED || 1
13825+
#if DEPRECATE
1382613826
PUBLIC void httpSetRouteServerPrefix(HttpRoute *route, cchar *prefix)
1382713827
{
1382813828
assert(route);
@@ -13955,12 +13955,10 @@ PUBLIC void httpSetRouteTemplate(HttpRoute *route, cchar *tplate)
1395513955
}
1395613956

1395713957

13958-
#if DEPRECATED || 1
1395913958
PUBLIC void httpSetRouteUploadDir(HttpRoute *route, cchar *dir)
1396013959
{
1396113960
httpSetDir(route, "UPLOAD", dir);
1396213961
}
13963-
#endif
1396413962

1396513963

1396613964
PUBLIC void httpSetRouteWorkers(HttpRoute *route, int workers)
@@ -14342,10 +14340,9 @@ PUBLIC char *httpTemplate(HttpConn *conn, cchar *template, MprHash *options)
1434214340
for (cp = template; *cp; cp++) {
1434314341
if (cp == template && *cp == '~') {
1434414342
mprPutStringToBuf(buf, httpGetRouteTop(conn));
14345-
#if DEPRECATED || 1
14343+
#if DEPRECATE
1434614344
} else if (cp == template && *cp == '|') {
1434714345
mprPutStringToBuf(buf, route->prefix);
14348-
// DEPRECATED in version 6
1434914346
mprPutStringToBuf(buf, route->serverPrefix);
1435014347
#endif
1435114348

@@ -14572,7 +14569,7 @@ static int authCondition(HttpConn *conn, HttpRoute *route, HttpRouteOp *op)
1457214569
/* Authentication not required */
1457314570
return HTTP_ROUTE_OK;
1457414571
}
14575-
if (!httpLoggedIn(conn)) {
14572+
if (!httpIsAuthenticated(conn)) {
1457614573
httpGetCredentials(conn, &username, &password);
1457714574
if (!httpLogin(conn, username, password)) {
1457814575
if (!conn->tx->finalized) {
@@ -14610,7 +14607,7 @@ static int unauthorizedCondition(HttpConn *conn, HttpRoute *route, HttpRouteOp *
1461014607
if (!auth || !auth->type) {
1461114608
return HTTP_ROUTE_REJECT;
1461214609
}
14613-
if (httpLoggedIn(conn)) {
14610+
if (httpIsAuthenticated(conn)) {
1461414611
return HTTP_ROUTE_REJECT;
1461514612
}
1461614613
httpGetCredentials(conn, &username, &password);
@@ -14882,16 +14879,12 @@ PUBLIC HttpRoute *httpDefineRoute(HttpRoute *parent, cchar *methods, cchar *patt
1488214879
if ((route = httpCreateInheritedRoute(parent)) == 0) {
1488314880
return 0;
1488414881
}
14885-
#if DEPRECATED || 1
14886-
/* Keep till version 6 */
14887-
/*
14888-
Keep till version 6
14889-
*/
14890-
if (schr(target, '-')) {
14891-
char *controller, *action;
14892-
controller = ssplit(sclone(target), "-", &action);
14893-
target = sjoin(controller, "/", action, NULL);
14894-
}
14882+
#if DEPRECATE
14883+
if (schr(target, '-')) {
14884+
char *controller, *action;
14885+
controller = ssplit(sclone(target), "-", &action);
14886+
target = sjoin(controller, "/", action, NULL);
14887+
}
1489514888
#endif
1489614889
httpSetRoutePattern(route, pattern, 0);
1489714890
if (methods) {
@@ -14910,7 +14903,7 @@ PUBLIC HttpRoute *httpAddRestfulRoute(HttpRoute *parent, cchar *methods, cchar *
1491014903
{
1491114904
cchar *source;
1491214905

14913-
#if DEPRECATED || 1
14906+
#if DEPRECATE
1491414907
if (*resource == '{') {
1491514908
pattern = sfmt("^%s%s/%s%s", parent->prefix, parent->serverPrefix, resource, pattern);
1491614909
} else {
@@ -14993,7 +14986,7 @@ PUBLIC HttpRoute *httpAddWebSocketsRoute(HttpRoute *parent, cchar *action)
1499314986
HttpLimits *limits;
1499414987
cchar *path, *pattern;
1499514988

14996-
#if DEPRECATED || 1
14989+
#if DEPRECATE
1499714990
pattern = sfmt("^%s%s/{controller}/%s", parent->prefix, parent->serverPrefix, action);
1499814991
#else
1499914992
pattern = sfmt("^%s/{controller}/%s", parent->prefix, action);
@@ -15129,7 +15122,7 @@ static void defineHostVars(HttpRoute *route)
1512915122
mprAddKey(route->vars, "DOCUMENTS", route->documents);
1513015123
mprAddKey(route->vars, "HOME", route->home);
1513115124
mprAddKey(route->vars, "HOST", route->host->name);
15132-
#if DEPRECATED || 1
15125+
#if DEPRECATE
1513315126
mprAddKey(route->vars, "SERVER_NAME", route->host->name);
1513415127
#endif
1513515128
}
@@ -21730,7 +21723,7 @@ PUBLIC HttpUri *httpNormalizeUri(HttpUri *uri)
2173021723

2173121724

2173221725
/*
21733-
Normalize a URI path to remove redundant "./", "../" and make separators uniform.
21726+
Normalize a URI path to remove redundant "./", "../" and make separators uniform.
2173421727
This will not permit leading '../' segments.
2173521728
Does not make an abs path, map separators or change case.
2173621729
*/
@@ -22099,8 +22092,7 @@ static cchar *expandRouteName(HttpConn *conn, cchar *routeName)
2209922092
if (sstarts(routeName, "${app}")) {
2210022093
return sjoin(httpGetRouteTop(conn), &routeName[6], NULL);
2210122094
}
22102-
#if DEPRECATED || 1
22103-
// DEPRECATED in version 6
22095+
#if DEPRECATE
2210422096
if (routeName[0] == '|') {
2210522097
assert(routeName[0] != '|');
2210622098
return sjoin(route->prefix, &routeName[1], NULL);

0 commit comments

Comments
 (0)