Skip to content

Commit 9411cdd

Browse files
committed
Fix fuzz builds
1 parent 88b15f3 commit 9411cdd

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/App.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct TemplatedApp {
116116
}
117117

118118
us_socket_context_remove_server_name(SSL, (struct us_socket_context_t *) httpContext, hostname_pattern.c_str());
119-
return std::move(*this);
119+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
120120
}
121121

122122
BuilderPatternReturnType &&missingServerName(MoveOnlyFunction<void(const char *hostname)> handler) {
@@ -132,7 +132,7 @@ struct TemplatedApp {
132132
});
133133
}
134134

135-
return std::move(*this);
135+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
136136
}
137137

138138
/* Returns the SSL_CTX of this app, or nullptr. */
@@ -144,7 +144,7 @@ struct TemplatedApp {
144144
BuilderPatternReturnType &&filter(MoveOnlyFunction<void(HttpResponse<SSL> *, int)> &&filterHandler) {
145145
httpContext->filter(std::move(filterHandler));
146146

147-
return std::move(*this);
147+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
148148
}
149149

150150
/* Publishes a message to all websocket contexts - conceptually as if publishing to the one single
@@ -265,7 +265,7 @@ struct TemplatedApp {
265265
us_socket_context_close(SSL, (struct us_socket_context_t *) webSocketContext);
266266
}
267267

268-
return std::move(*this);
268+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
269269
}
270270

271271
template <typename UserData>
@@ -475,49 +475,49 @@ struct TemplatedApp {
475475
if (httpContext) {
476476
httpContext->onHttp("OPTIONS", pattern, std::move(handler));
477477
}
478-
return std::move(*this);
478+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
479479
}
480480

481481
BuilderPatternReturnType &&del(std::string pattern, MoveOnlyFunction<void(HttpResponse<SSL> *, HttpRequest *)> &&handler) {
482482
if (httpContext) {
483483
httpContext->onHttp("DELETE", pattern, std::move(handler));
484484
}
485-
return std::move(*this);
485+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
486486
}
487487

488488
BuilderPatternReturnType &&patch(std::string pattern, MoveOnlyFunction<void(HttpResponse<SSL> *, HttpRequest *)> &&handler) {
489489
if (httpContext) {
490490
httpContext->onHttp("PATCH", pattern, std::move(handler));
491491
}
492-
return std::move(*this);
492+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
493493
}
494494

495495
BuilderPatternReturnType &&put(std::string pattern, MoveOnlyFunction<void(HttpResponse<SSL> *, HttpRequest *)> &&handler) {
496496
if (httpContext) {
497497
httpContext->onHttp("PUT", pattern, std::move(handler));
498498
}
499-
return std::move(*this);
499+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
500500
}
501501

502502
BuilderPatternReturnType &&head(std::string pattern, MoveOnlyFunction<void(HttpResponse<SSL> *, HttpRequest *)> &&handler) {
503503
if (httpContext) {
504504
httpContext->onHttp("HEAD", pattern, std::move(handler));
505505
}
506-
return std::move(*this);
506+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
507507
}
508508

509509
BuilderPatternReturnType &&connect(std::string pattern, MoveOnlyFunction<void(HttpResponse<SSL> *, HttpRequest *)> &&handler) {
510510
if (httpContext) {
511511
httpContext->onHttp("CONNECT", pattern, std::move(handler));
512512
}
513-
return std::move(*this);
513+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
514514
}
515515

516516
BuilderPatternReturnType &&trace(std::string pattern, MoveOnlyFunction<void(HttpResponse<SSL> *, HttpRequest *)> &&handler) {
517517
if (httpContext) {
518518
httpContext->onHttp("TRACE", pattern, std::move(handler));
519519
}
520-
return std::move(*this);
520+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
521521
}
522522

523523
/* This one catches any method */
@@ -534,7 +534,7 @@ struct TemplatedApp {
534534
return listen(port, std::move(handler));
535535
}
536536
handler(httpContext ? httpContext->listen(host.c_str(), port, 0) : nullptr);
537-
return std::move(*this);
537+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
538538
}
539539

540540
/* Host, port, options, callback */
@@ -543,7 +543,7 @@ struct TemplatedApp {
543543
return listen(port, options, std::move(handler));
544544
}
545545
handler(httpContext ? httpContext->listen(host.c_str(), port, options) : nullptr);
546-
return std::move(*this);
546+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
547547
}
548548

549549
/* Port, callback */
@@ -555,19 +555,19 @@ struct TemplatedApp {
555555
/* Port, options, callback */
556556
BuilderPatternReturnType &&listen(int port, int options, MoveOnlyFunction<void(us_listen_socket_t *)> &&handler) {
557557
handler(httpContext ? httpContext->listen(nullptr, port, options) : nullptr);
558-
return std::move(*this);
558+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
559559
}
560560

561561
/* options, callback, path to unix domain socket */
562562
BuilderPatternReturnType &&listen(int options, MoveOnlyFunction<void(us_listen_socket_t *)> &&handler, std::string path) {
563563
handler(httpContext ? httpContext->listen(path.c_str(), options) : nullptr);
564-
return std::move(*this);
564+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
565565
}
566566

567567
/* callback, path to unix domain socket */
568568
BuilderPatternReturnType &&listen(MoveOnlyFunction<void(us_listen_socket_t *)> &&handler, std::string path) {
569569
handler(httpContext ? httpContext->listen(path.c_str(), 0) : nullptr);
570-
return std::move(*this);
570+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
571571
}
572572

573573
/* Register event handler for accepted FD. Can be used together with adoptSocket. */

0 commit comments

Comments
 (0)