Commit graph

10 commits

Author SHA1 Message Date
Ashod Nakashian
1920481aca nb: refactor buffer management into BufferingSocket
Now we have plain and ssl sockets based on
the BufferingSocket, each is responsible for
the socket IO only.

The SSL socket is only shell missing implementation.

Change-Id: I51d274a9335cec52c13b6a19927ddd46d98265a0
Reviewed-on: https://gerrit.libreoffice.org/34352
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-10 10:47:37 +01:00
Ashod Nakashian
b5efc65cef nb: ClientSocket -> StreamSocket
StreamSocket has nothing Client-side specific.

Indeed it could be used on the Server-side.

As such, it's data-streaming, rather than client,
hence the new name.

Change-Id: I4e048def968b3a12e11edb49760ed03e3843ae6b
Reviewed-on: https://gerrit.libreoffice.org/34351
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-10 10:47:37 +01:00
Ashod Nakashian
ae14786443 nb: retry on EINTR
Change-Id: Iea972096854308a80f96af056639417be7573a82
Reviewed-on: https://gerrit.libreoffice.org/34350
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-10 10:47:37 +01:00
Michael Meeks
7a225dcbb3 Lean on Poco for request parsing. 2017-03-10 10:47:36 +01:00
Michael Meeks
d254899e74 Initial http header parsing pieces. 2017-03-10 10:47:36 +01:00
Michael Meeks
feb8192ec3 De-templatize and simplify. 2017-03-10 10:47:36 +01:00
Michael Meeks
0263078de7 Handle EOF - ie. zero length reads on sockets.
Close and cleanup sockets nicely.
2017-03-10 10:47:36 +01:00
Michael Meeks
92364f3ebf Implement basic buffering.
The socket now buffers input, and output, updates its poll record too.
We pass a simple message from client to server and back using lamers HTTP.
Sub-classed ClientSocket to provide a simple message handler.
   not very convinced by templatization here, but made it consistent.
   more ideal to have some virtual socket pieces.
2017-03-10 10:47:36 +01:00
Michael Meeks
257a79da89 Cleanup comments, naming related warnings etc.
Avoid using 'poll' as a member function, and a local variable.
Avoid using 'fd' as a member function, and a parameter.
Add assertions around wake pipe.
Always setup sockets for polling, strobing events is expected.
2017-03-10 10:47:36 +01:00
Ashod Nakashian
0a05a34f66 nb: move Socket family into own file
Change-Id: I17802f00a6e9e7d920b175b9721b158ea90a9880
Reviewed-on: https://gerrit.libreoffice.org/34238
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-10 10:47:36 +01:00