18 Commits

Author SHA1 Message Date
Fred Nicolson
c0d103da14 Improved network encoding conversion functions
Now uses optimised/inbuilt functions if available.
2018-03-26 17:34:00 +01:00
Fred Nicolson
4207468ef0 Added the ability to add iterator ranges to packets
So, fr::Packet::add_range(std::begin(container), std::end(container));
2018-03-06 14:31:47 +00:00
Fred Nicolson
103e0faaae Bug fixes. HTTP parsing improvements. More tests.
Fixed TcpSocket::set_descriptor(nullptr) causing an invalid read from address 0x0.

Improved HTTP response/request parsing so that they report a parse failure if the first few bytes of the HTTP request don't match the expected format rather than continuing to look for an end of header.

Fixed broken fr::Http::url_encode() implementation.

Optimised fr::Http::url_decode() implementation.

Added fr::Http unit tests.
2018-03-01 15:51:57 +00:00
Fred Nicolson
ff25d11089 Removed socket mutexes. Added more tests. Improved examples.
Socket mutexes are no longer really required, and so have been removed.

Added more tests for network encoding functions, and the URL parser.

The URL parser now returns a path preceeded with a '/' instead of cutting it out. Added get_uri() to URL, for getting the whole URI, so users don't have to concat it themselves from the more specialised functions.

Fixed default socket connect timeout checking for the wrong value.

Fixed request_type_strings not containing all of the possible request types.

Fixed README using old socket close syntax.

Cleaned up the examples a bit.
2018-02-01 11:56:34 +00:00
Fred Nicolson
ad847f0052 HTTP parsing bug fixes, added tests
Fixed HTTP request parse failing if the URI was too short. 

Fixed HTTP parser not converting POST/GET data to lowercase before storing it, making post and get data which contained capitals impossible to access.
2018-01-26 13:18:45 +00:00
Fred Nicolson
30354f15bc Added support for connect timeouts.
Both fr::TcpSocket and fr::SSLSocket can have timeouts specified when connecting. This works by putting the socket into non-blocking mode, making a connect, and then selecting on the socket for the requested timeout. If the select times out then we've failed to connect, if it didn't time out then we've connected.
2018-01-10 17:08:16 +00:00
Fred Nicolson
c8e03f2df8 Added more tests. Tweaks.
Receiving an http request/response will now return errors like HttpHeaderTooBig, instead of the type being set to that.

Added fr::Socket::status_to_string for converting status values into English strings.
2017-09-25 16:19:47 +01:00
Fred Nicolson
f1db713069 Made POST/GET/HEADER members case insensitive again
It broke things. Bad.
2017-08-22 13:57:08 +01:00
Fred Nicolson
0bd41ec6bd get_remote_address() now works on SSL sockets accepted through SSLListener
Post/get/... data is no longer case insensitive.
2017-08-02 17:32:16 +01:00
Fred Nicolson
84382cad0b Made some changes recommended by Clang-Tidy. 2017-07-20 15:02:43 +01:00
Fred Nicolson
a0ca16c891 Work on fr::HttpRequest unit tests. Some tweaking.
GET variables are now actually added to the request when constructing them, instead of being ignored.
2017-07-20 10:42:18 +01:00
Fred Nicolson
f2cebd0847 Work on tests. Bug fixes and tweaks.
Started work on tests for fr::HttpRequest.

Fixed the final POST data variable containing header data it shouldn't (\r\n\r\n).

Fixed fr::Http::header_exists, and family, not converting things to lowercase first.
2017-07-19 17:30:43 +01:00
Unknown
028677b01a Added tests. Improved error checking. Bug fixes.
Added fr::TcpListener tests.
2017-06-05 20:13:50 +01:00
Fred Nicolson
bbcf185202 Improved build system
Examples and tests now build on Windows
2017-05-31 16:23:35 +01:00
Unknown
adc891fc84 Tweaked build system 2017-05-30 19:58:40 +01:00
Fred Nicolson
df2425a94d Added fr::Packet tests and Travis CI file. 2017-05-30 17:07:41 +01:00
Fred Nicolson
dd4d45d183 Improved tests
Fixed tests not being linked properly with frnetlib.

Added tests for the URL parser.
2017-05-30 15:32:45 +01:00
Unknown
6c0762bbf2 Integrated googletest into the project
The plan is to add unit tests, to completely test library functionality, alongside continuous integration on GitHub.
2017-05-29 22:55:17 +01:00