@@ -33,7 +33,6 @@ Response::Response(Client* client, uint8_t * writeBuffer, int writeBufferLength)
33
33
m_sendingStatus(false ),
34
34
m_sendingHeaders(false ),
35
35
m_headersCount(0 ),
36
- m_mime(NULL ),
37
36
m_bytesSent(0 ),
38
37
m_ended(false ),
39
38
m_buffer(writeBuffer),
@@ -1283,67 +1282,67 @@ Router::~Router() {
1283
1282
m_head = NULL ;
1284
1283
}
1285
1284
1286
- void Router::del (const char *path, Middleware * middleware) {
1285
+ void Router::del (const char *path, MIDDLEWARE_PARAM middleware) {
1287
1286
m_addMiddleware (Request::DELETE, path, middleware);
1288
1287
}
1289
1288
1290
- void Router::del (Middleware * middleware) {
1289
+ void Router::del (MIDDLEWARE_PARAM middleware) {
1291
1290
del (NULL , middleware);
1292
1291
}
1293
1292
1294
- void Router::get (const char *path, Middleware * middleware) {
1293
+ void Router::get (const char *path, MIDDLEWARE_PARAM middleware) {
1295
1294
m_addMiddleware (Request::GET, path, middleware);
1296
1295
}
1297
1296
1298
- void Router::get (Middleware * middleware) {
1297
+ void Router::get (MIDDLEWARE_PARAM middleware) {
1299
1298
get (NULL , middleware);
1300
1299
}
1301
1300
1302
- void Router::head (const char *path, Middleware * middleware) {
1301
+ void Router::head (const char *path, MIDDLEWARE_PARAM middleware) {
1303
1302
m_addMiddleware (Request::HEAD, path, middleware);
1304
1303
}
1305
1304
1306
- void Router::head (Middleware * middleware) {
1305
+ void Router::head (MIDDLEWARE_PARAM middleware) {
1307
1306
head (NULL , middleware);
1308
1307
}
1309
1308
1310
- void Router::options (const char *path, Middleware * middleware) {
1309
+ void Router::options (const char *path, MIDDLEWARE_PARAM middleware) {
1311
1310
m_addMiddleware (Request::OPTIONS, path, middleware);
1312
1311
}
1313
1312
1314
- void Router::options (Middleware * middleware) {
1313
+ void Router::options (MIDDLEWARE_PARAM middleware) {
1315
1314
options (NULL , middleware);
1316
1315
}
1317
1316
1318
- void Router::post (const char *path, Middleware * middleware) {
1317
+ void Router::post (const char *path, MIDDLEWARE_PARAM middleware) {
1319
1318
m_addMiddleware (Request::POST, path, middleware);
1320
1319
}
1321
1320
1322
- void Router::post (Middleware * middleware) {
1321
+ void Router::post (MIDDLEWARE_PARAM middleware) {
1323
1322
post (NULL , middleware);
1324
1323
}
1325
1324
1326
- void Router::put (const char *path, Middleware * middleware) {
1325
+ void Router::put (const char *path, MIDDLEWARE_PARAM middleware) {
1327
1326
m_addMiddleware (Request::PUT, path, middleware);
1328
1327
}
1329
1328
1330
- void Router::put (Middleware * middleware) {
1329
+ void Router::put (MIDDLEWARE_PARAM middleware) {
1331
1330
put (NULL , middleware);
1332
1331
}
1333
1332
1334
- void Router::patch (const char *path, Middleware * middleware) {
1333
+ void Router::patch (const char *path, MIDDLEWARE_PARAM middleware) {
1335
1334
m_addMiddleware (Request::PATCH, path, middleware);
1336
1335
}
1337
1336
1338
- void Router::patch (Middleware * middleware) {
1337
+ void Router::patch (MIDDLEWARE_PARAM middleware) {
1339
1338
patch (NULL , middleware);
1340
1339
}
1341
1340
1342
- void Router::use (const char *path, Middleware * middleware) {
1341
+ void Router::use (const char *path, MIDDLEWARE_PARAM middleware) {
1343
1342
m_addMiddleware (Request::ALL, path, middleware);
1344
1343
}
1345
1344
1346
- void Router::use (Middleware * middleware) {
1345
+ void Router::use (MIDDLEWARE_PARAM middleware) {
1347
1346
use (NULL , middleware);
1348
1347
}
1349
1348
@@ -1361,7 +1360,7 @@ void Router::use(Router *router) {
1361
1360
}
1362
1361
1363
1362
void Router::m_addMiddleware (Request::MethodType type, const char *path,
1364
- Middleware * middleware) {
1363
+ MIDDLEWARE_PARAM middleware) {
1365
1364
MiddlewareNode *tail = new MiddlewareNode ();
1366
1365
tail->path = path;
1367
1366
tail->middleware = middleware;
@@ -1507,67 +1506,67 @@ Application::~Application() {
1507
1506
m_headerTail = NULL ;
1508
1507
}
1509
1508
1510
- void Application::del (const char *path, Router::Middleware * middleware) {
1509
+ void Application::del (const char *path, Router::MIDDLEWARE_PARAM middleware) {
1511
1510
m_defaultRouter.m_addMiddleware (Request::DELETE, path, middleware);
1512
1511
}
1513
1512
1514
- void Application::del (Router::Middleware * middleware) {
1513
+ void Application::del (Router::MIDDLEWARE_PARAM middleware) {
1515
1514
del (NULL , middleware);
1516
1515
}
1517
1516
1518
- void Application::finally (Router::Middleware * final ) {
1517
+ void Application::finally (Router::MIDDLEWARE_PARAM final ) {
1519
1518
m_final = final ;
1520
1519
}
1521
1520
1522
- void Application::get (const char *path, Router::Middleware * middleware) {
1521
+ void Application::get (const char *path, Router::MIDDLEWARE_PARAM middleware) {
1523
1522
m_defaultRouter.m_addMiddleware (Request::GET, path, middleware);
1524
1523
}
1525
1524
1526
- void Application::get (Router::Middleware * middleware) {
1525
+ void Application::get (Router::MIDDLEWARE_PARAM middleware) {
1527
1526
get (NULL , middleware);
1528
1527
}
1529
1528
1530
- void Application::head (const char *path, Router::Middleware * middleware) {
1529
+ void Application::head (const char *path, Router::MIDDLEWARE_PARAM middleware) {
1531
1530
m_defaultRouter.m_addMiddleware (Request::HEAD, path, middleware);
1532
1531
}
1533
1532
1534
- void Application::head (Router::Middleware * middleware) {
1533
+ void Application::head (Router::MIDDLEWARE_PARAM middleware) {
1535
1534
head (NULL , middleware);
1536
1535
}
1537
1536
1538
- void Application::notFound (Router::Middleware * notFound) {
1537
+ void Application::notFound (Router::MIDDLEWARE_PARAM notFound) {
1539
1538
m_notFound = notFound;
1540
1539
}
1541
1540
1542
- void Application::options (const char *path, Router::Middleware * middleware) {
1541
+ void Application::options (const char *path, Router::MIDDLEWARE_PARAM middleware) {
1543
1542
m_defaultRouter.m_addMiddleware (Request::OPTIONS, path, middleware);
1544
1543
}
1545
1544
1546
- void Application::options (Router::Middleware * middleware) {
1545
+ void Application::options (Router::MIDDLEWARE_PARAM middleware) {
1547
1546
options (NULL , middleware);
1548
1547
}
1549
1548
1550
- void Application::patch (const char *path, Router::Middleware * middleware) {
1549
+ void Application::patch (const char *path, Router::MIDDLEWARE_PARAM middleware) {
1551
1550
m_defaultRouter.m_addMiddleware (Request::PATCH, path, middleware);
1552
1551
}
1553
1552
1554
- void Application::patch (Router::Middleware * middleware) {
1553
+ void Application::patch (Router::MIDDLEWARE_PARAM middleware) {
1555
1554
patch (NULL , middleware);
1556
1555
}
1557
1556
1558
- void Application::post (const char *path, Router::Middleware * middleware) {
1557
+ void Application::post (const char *path, Router::MIDDLEWARE_PARAM middleware) {
1559
1558
m_defaultRouter.m_addMiddleware (Request::POST, path, middleware);
1560
1559
}
1561
1560
1562
- void Application::post (Router::Middleware * middleware) {
1561
+ void Application::post (Router::MIDDLEWARE_PARAM middleware) {
1563
1562
post (NULL , middleware);
1564
1563
}
1565
1564
1566
- void Application::put (const char *path, Router::Middleware * middleware) {
1565
+ void Application::put (const char *path, Router::MIDDLEWARE_PARAM middleware) {
1567
1566
m_defaultRouter.m_addMiddleware (Request::PUT, path, middleware);
1568
1567
}
1569
1568
1570
- void Application::put (Router::Middleware * middleware) {
1569
+ void Application::put (Router::MIDDLEWARE_PARAM middleware) {
1571
1570
put (NULL , middleware);
1572
1571
}
1573
1572
@@ -1641,11 +1640,11 @@ void Application::process(Stream *stream, char *urlBuffer, int urlBufferLength,
1641
1640
process (&client, urlBuffer, urlBufferLength, writeBuffer, writeBufferLength, context);
1642
1641
}
1643
1642
1644
- void Application::use (const char *path, Router::Middleware * middleware) {
1643
+ void Application::use (const char *path, Router::MIDDLEWARE_PARAM middleware) {
1645
1644
m_defaultRouter.m_addMiddleware (Request::ALL, path, middleware);
1646
1645
}
1647
1646
1648
- void Application::use (Router::Middleware * middleware) {
1647
+ void Application::use (Router::MIDDLEWARE_PARAM middleware) {
1649
1648
use (NULL , middleware);
1650
1649
}
1651
1650
0 commit comments