Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
pistache
Commits
40872f02
Unverified
Commit
40872f02
authored
Sep 24, 2018
by
Dennis Jenkins
Committed by
GitHub
Sep 24, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #300 from knowledge4igor/code_improvements_2
Tiny code improvements
parents
e4c43797
0d305e36
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
14 deletions
+6
-14
include/pistache/http.h
include/pistache/http.h
+1
-10
src/client/client.cc
src/client/client.cc
+1
-2
src/common/http.cc
src/common/http.cc
+1
-2
src/common/stream.cc
src/common/stream.cc
+3
-0
No files found.
include/pistache/http.h
View file @
40872f02
...
...
@@ -693,16 +693,7 @@ namespace Private {
ParserBase
()
:
cursor
(
&
buffer
)
,
currentStep
(
0
)
{
}
ParserBase
(
const
char
*
data
,
size_t
len
)
:
cursor
(
&
buffer
)
,
currentStep
(
0
)
{
UNUSED
(
data
)
UNUSED
(
len
)
}
{
}
ParserBase
(
const
ParserBase
&
other
)
=
delete
;
ParserBase
(
ParserBase
&&
other
)
=
default
;
...
...
src/client/client.cc
View file @
40872f02
...
...
@@ -579,8 +579,7 @@ Connection::performImpl(
transport_
->
asyncSendRequest
(
shared_from_this
(),
timer
,
buffer
).
then
(
[
=
](
ssize_t
bytes
)
mutable
{
UNUSED
(
bytes
)
[
=
](
ssize_t
)
mutable
{
inflightRequests
.
push_back
(
RequestEntry
(
std
::
move
(
resolveMover
),
std
::
move
(
rejectMover
),
std
::
move
(
timer
),
std
::
move
(
onDone
)));
},
[
=
](
std
::
exception_ptr
e
)
{
rejectCloneMover
.
val
(
e
);
});
...
...
src/common/http.cc
View file @
40872f02
...
...
@@ -740,8 +740,7 @@ serveFile(ResponseWriter& response, const char* fileName, const Mime::MediaType&
auto
sockFd
=
peer
->
fd
();
auto
buffer
=
buf
->
buffer
();
return
transport
->
asyncWrite
(
sockFd
,
buffer
,
MSG_MORE
).
then
([
=
](
ssize_t
bytes
)
{
UNUSED
(
bytes
)
return
transport
->
asyncWrite
(
sockFd
,
buffer
,
MSG_MORE
).
then
([
=
](
ssize_t
)
{
return
transport
->
asyncWrite
(
sockFd
,
FileBuffer
(
fileName
));
},
Async
::
Throw
);
...
...
src/common/stream.cc
View file @
40872f02
...
...
@@ -30,6 +30,9 @@ FileBuffer::FileBuffer(const std::string& fileName)
void
FileBuffer
::
init
(
const
char
*
fileName
)
{
if
(
!
fileName
)
{
throw
std
::
runtime_error
(
"Missing fileName"
);
}
int
fd
=
open
(
fileName
,
O_RDONLY
);
if
(
fd
==
-
1
)
{
throw
std
::
runtime_error
(
"Could not open file"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment