]> git.tdb.fi Git - libs/net.git/log
libs/net.git
5 years agoPrevent serializing packets without an ID
Mikko Rasa [Sat, 21 Sep 2019 15:23:01 +0000 (18:23 +0300)]
Prevent serializing packets without an ID

An attempt at such may arise from sending a structure intended to be used
as part of other packets, but not a packet on its own.

5 years agoFix the polarity of O_CLOEXEC for Socket
Mikko Rasa [Sat, 21 Sep 2019 15:06:36 +0000 (18:06 +0300)]
Fix the polarity of O_CLOEXEC for Socket

5 years agoProvide more information about exceptions in Http::Server
Mikko Rasa [Sat, 21 Sep 2019 14:53:29 +0000 (17:53 +0300)]
Provide more information about exceptions in Http::Server

5 years agoRemove name from an unused variable
Mikko Rasa [Sat, 21 Sep 2019 14:52:34 +0000 (17:52 +0300)]
Remove name from an unused variable

5 years agoUpdate a deprecated header
Mikko Rasa [Sat, 21 Sep 2019 14:52:14 +0000 (17:52 +0300)]
Update a deprecated header

5 years agoAdd method to query bound status of a socket
Mikko Rasa [Thu, 24 Jan 2019 01:21:23 +0000 (03:21 +0200)]
Add method to query bound status of a socket

6 years agoImplement the required virtual functions in Socket
Mikko Rasa [Tue, 5 Dec 2017 06:40:46 +0000 (08:40 +0200)]
Implement the required virtual functions in Socket

6 years agoFix a flag handling bug in Socket::Private::set_block
Mikko Rasa [Tue, 5 Dec 2017 06:39:14 +0000 (08:39 +0200)]
Fix a flag handling bug in Socket::Private::set_block

8 years agoMove the definition of PacketTypeDef<T>::class_id to a separate header
Mikko Rasa [Tue, 1 Nov 2016 22:00:55 +0000 (00:00 +0200)]
Move the definition of PacketTypeDef<T>::class_id to a separate header

Defining it in protocol.h may cause multiple definitions to appear across
the program and there are cases where they don't get collapsed to one.
DLLs on Windows are one such case.  The _impl header is to be included in
files that add packet definitions to a protocol and nowhere else.

8 years agoIncrease Communicator buffer size to 64k
Mikko Rasa [Wed, 12 Oct 2016 09:59:00 +0000 (12:59 +0300)]
Increase Communicator buffer size to 64k

This is the current maximum size for a packet, and there isn't really
any need to use a smaller buffer.

8 years agoSome largely cosmetic touch-up
Mikko Rasa [Sun, 9 Oct 2016 17:34:33 +0000 (20:34 +0300)]
Some largely cosmetic touch-up

8 years agoSupport compound types in network packets
Mikko Rasa [Sun, 9 Oct 2016 17:30:03 +0000 (20:30 +0300)]
Support compound types in network packets

8 years agoFill in a missing parameter for check_sys_error
Mikko Rasa [Sun, 9 Oct 2016 15:08:38 +0000 (18:08 +0300)]
Fill in a missing parameter for check_sys_error

This was supposed to be in b069cfc but somehow didn't make it into the
commit.

8 years agoAcutally implement Protocol::get_hash
Mikko Rasa [Sun, 9 Oct 2016 15:03:24 +0000 (18:03 +0300)]
Acutally implement Protocol::get_hash

Also trigger an error in Communicator if the hashes don't match

8 years agoRefactor most of Communicator::send to be in the .cpp file
Mikko Rasa [Sun, 9 Oct 2016 13:56:40 +0000 (16:56 +0300)]
Refactor most of Communicator::send to be in the .cpp file

8 years agoMassive overhaul of the Protocol class
Mikko Rasa [Sun, 9 Oct 2016 13:53:23 +0000 (16:53 +0300)]
Massive overhaul of the Protocol class

Makes the serialization machinery more flexible and reduces the number of
virtual function calls when de/serializing packets.

8 years agoAdd error check to accept
Mikko Rasa [Sun, 25 Sep 2016 22:35:31 +0000 (01:35 +0300)]
Add error check to accept

8 years agoMove most platform-specific code into overlay directories
Mikko Rasa [Sun, 25 Sep 2016 22:28:16 +0000 (01:28 +0300)]
Move most platform-specific code into overlay directories

Unix socket addresses can now be constructed on Windows, but can't be
actually used with sockets.

8 years agoMinor cleanup
Mikko Rasa [Wed, 14 Sep 2016 11:27:15 +0000 (14:27 +0300)]
Minor cleanup

8 years agoUse the correct #ifdef for Windows
Mikko Rasa [Wed, 14 Sep 2016 11:26:50 +0000 (14:26 +0300)]
Use the correct #ifdef for Windows

8 years agoSupport asynchronous name resolution in Http::Client
Mikko Rasa [Wed, 14 Sep 2016 10:51:56 +0000 (13:51 +0300)]
Support asynchronous name resolution in Http::Client

8 years agoImplement an asynchronous name resolver class
Mikko Rasa [Wed, 14 Sep 2016 10:50:29 +0000 (13:50 +0300)]
Implement an asynchronous name resolver class

8 years agoFix header name normalization logic
Mikko Rasa [Mon, 16 May 2016 15:15:29 +0000 (18:15 +0300)]
Fix header name normalization logic

If the name begins with a hyphen, the following letter shall be
uppercased.

8 years agoUse string::size_type to store string offsets
Mikko Rasa [Mon, 16 May 2016 15:15:10 +0000 (18:15 +0300)]
Use string::size_type to store string offsets

8 years agoAdd a class for parsing submitted form data
Mikko Rasa [Mon, 16 May 2016 15:13:38 +0000 (18:13 +0300)]
Add a class for parsing submitted form data

parse_query in utils.h already did it for query strings, but not for
POST requests.

8 years agoAdd a utility struct for parsing complex header values
Mikko Rasa [Mon, 16 May 2016 09:06:19 +0000 (12:06 +0300)]
Add a utility struct for parsing complex header values

It's not used to store headers in Message since not all headers follow
the same syntax.  User-Agent in particular may have semicolons which are
not parameters separators.

8 years agoAdd the most common redirection statuses
Mikko Rasa [Wed, 20 Apr 2016 21:00:21 +0000 (00:00 +0300)]
Add the most common redirection statuses

8 years agoProvide a method for the application to cancel connection keep-alive
Mikko Rasa [Tue, 19 Apr 2016 07:39:55 +0000 (10:39 +0300)]
Provide a method for the application to cancel connection keep-alive

8 years agoAdhere to the spec with connection keep-alive
Mikko Rasa [Tue, 19 Apr 2016 07:38:57 +0000 (10:38 +0300)]
Adhere to the spec with connection keep-alive

Recognize it case-insensitively and add the header on the response.

8 years agoUse connection keepalive on async responses too
Mikko Rasa [Tue, 19 Apr 2016 07:34:42 +0000 (10:34 +0300)]
Use connection keepalive on async responses too

8 years agoHide Http::Server destructor in the library
Mikko Rasa [Tue, 19 Apr 2016 07:31:27 +0000 (10:31 +0300)]
Hide Http::Server destructor in the library

Otherwise sigc::signal destructor will be emitted in the including file,
requiring explicit linking with libsigc++.

9 years agoUse a typecast to avoid a signedness mismatch warning
Mikko Rasa [Thu, 19 Nov 2015 08:17:18 +0000 (10:17 +0200)]
Use a typecast to avoid a signedness mismatch warning

9 years agoSet event types on Windows if connect finished immediately
Mikko Rasa [Fri, 10 Apr 2015 18:08:22 +0000 (21:08 +0300)]
Set event types on Windows if connect finished immediately

9 years agoInclude winsock2.h first
Mikko Rasa [Tue, 7 Apr 2015 10:58:25 +0000 (13:58 +0300)]
Include winsock2.h first

It wants to get included before windows.h

9 years agoReject requests with a relative path
Mikko Rasa [Mon, 6 Apr 2015 22:24:18 +0000 (01:24 +0300)]
Reject requests with a relative path

As per the HTTP specification

9 years agoCorrect a typo in a multiple inclusion guard
Mikko Rasa [Mon, 6 Apr 2015 22:23:12 +0000 (01:23 +0300)]
Correct a typo in a multiple inclusion guard

9 years agoProvide a signal to handle errors from Communicator
Mikko Rasa [Mon, 6 Apr 2015 22:19:21 +0000 (01:19 +0300)]
Provide a signal to handle errors from Communicator

Since Communicator is typically used with an EventDispatcher, it can be
inconvenient to just throw exceptions out.  Handling them would require
wrapping the EventDispatcher's tick call in a try block, and the exact
source of the exception would be lost.

9 years agoImplement connection keep-alive in HttpServer
Mikko Rasa [Thu, 22 Jan 2015 14:23:19 +0000 (16:23 +0200)]
Implement connection keep-alive in HttpServer

9 years agoMake Request API consistent with itself and others
Mikko Rasa [Thu, 22 Jan 2015 14:20:00 +0000 (16:20 +0200)]
Make Request API consistent with itself and others

Request::from_url was incorrectly creating requests with unencoded URLs.

9 years agoAdd 405 (method not allowed) status
Mikko Rasa [Thu, 22 Jan 2015 14:16:14 +0000 (16:16 +0200)]
Add 405 (method not allowed) status

Since the HttpServer class allows either GET or POST and returns 501 (not
implemented) for others, programs using it may wish to further limit
processing to GET requests only.

9 years agoAdd shutdown support for client sockets
Mikko Rasa [Thu, 22 Jan 2015 12:10:44 +0000 (14:10 +0200)]
Add shutdown support for client sockets

11 years agoFix 64-bit compilation
Mikko Rasa [Mon, 1 Apr 2013 18:32:19 +0000 (21:32 +0300)]
Fix 64-bit compilation

11 years agoAdd the target type to a lexical_cast invocation
Mikko Rasa [Sat, 1 Dec 2012 10:00:59 +0000 (12:00 +0200)]
Add the target type to a lexical_cast invocation

12 years agoUpdate Build and .gitignore files
Mikko Rasa [Mon, 15 Oct 2012 10:25:32 +0000 (13:25 +0300)]
Update Build and .gitignore files

12 years agoAdd support for AF_UNIX
Mikko Rasa [Mon, 15 Oct 2012 09:07:22 +0000 (12:07 +0300)]
Add support for AF_UNIX

12 years agoHide the set_option and get_option functions in socket_private.h
Mikko Rasa [Mon, 8 Oct 2012 20:38:31 +0000 (23:38 +0300)]
Hide the set_option and get_option functions in socket_private.h

These depend on a system-specific type, so they can't be in a public
header.

12 years agoFix some compilation problems
Mikko Rasa [Mon, 8 Oct 2012 20:37:44 +0000 (23:37 +0300)]
Fix some compilation problems

13 years agoDon't crash on errors without verbose mode
Mikko Rasa [Mon, 31 Oct 2011 14:33:56 +0000 (16:33 +0200)]
Don't crash on errors without verbose mode

13 years agoFix some header names
Mikko Rasa [Wed, 5 Oct 2011 08:30:41 +0000 (11:30 +0300)]
Fix some header names

13 years agoAdd an example of Http::Server usage
Mikko Rasa [Wed, 10 Aug 2011 19:31:42 +0000 (22:31 +0300)]
Add an example of Http::Server usage

13 years agoMake httpget handle socket errors
Mikko Rasa [Wed, 10 Aug 2011 19:31:26 +0000 (22:31 +0300)]
Make httpget handle socket errors

13 years agoDon't generate a duplicate signal when the connection is closed
Mikko Rasa [Wed, 10 Aug 2011 19:30:52 +0000 (22:30 +0300)]
Don't generate a duplicate signal when the connection is closed

13 years agoFix storage order of InetAddr::addr
Mikko Rasa [Wed, 10 Aug 2011 19:30:29 +0000 (22:30 +0300)]
Fix storage order of InetAddr::addr

13 years agoFix URL regex
Mikko Rasa [Wed, 10 Aug 2011 19:18:46 +0000 (22:18 +0300)]
Fix URL regex

13 years agoChange Client::signal_socket_error parameter to reference
Mikko Rasa [Wed, 10 Aug 2011 19:18:26 +0000 (22:18 +0300)]
Change Client::signal_socket_error parameter to reference

13 years agoAdd example of Http::Client usage
Mikko Rasa [Wed, 10 Aug 2011 18:44:40 +0000 (21:44 +0300)]
Add example of Http::Client usage

13 years agoStore pending responses in a map
Mikko Rasa [Wed, 10 Aug 2011 18:42:48 +0000 (21:42 +0300)]
Store pending responses in a map

13 years agoOne more exception change
Mikko Rasa [Wed, 10 Aug 2011 18:41:09 +0000 (21:41 +0300)]
One more exception change

13 years agoMerge branch 'http-master'
Mikko Rasa [Wed, 10 Aug 2011 18:14:42 +0000 (21:14 +0300)]
Merge branch 'http-master'

Conflicts:
.gitignore
Build

13 years agoPrepare for assimilating msphttp
Mikko Rasa [Wed, 10 Aug 2011 18:11:56 +0000 (21:11 +0300)]
Prepare for assimilating msphttp

13 years agoPrepare for assimilation into mspnet http-master
Mikko Rasa [Wed, 10 Aug 2011 18:07:48 +0000 (21:07 +0300)]
Prepare for assimilation into mspnet

13 years agoChange listen address construction
Mikko Rasa [Wed, 10 Aug 2011 18:07:08 +0000 (21:07 +0300)]
Change listen address construction

13 years agoUse maputils.h
Mikko Rasa [Wed, 10 Aug 2011 18:05:52 +0000 (21:05 +0300)]
Use maputils.h

13 years agoStreamListenSocket renamed as StreamServerSocket
Mikko Rasa [Wed, 10 Aug 2011 18:05:29 +0000 (21:05 +0300)]
StreamListenSocket renamed as StreamServerSocket

13 years agoException changes
Mikko Rasa [Wed, 10 Aug 2011 18:05:12 +0000 (21:05 +0300)]
Exception changes

13 years agoPass an exception to signal_socket_error instead of error code
Mikko Rasa [Wed, 10 Aug 2011 18:03:38 +0000 (21:03 +0300)]
Pass an exception to signal_socket_error instead of error code

13 years agoSocket::close was removed
Mikko Rasa [Wed, 10 Aug 2011 18:03:05 +0000 (21:03 +0300)]
Socket::close was removed

13 years agoAdd an overload for resolve that takes host and service separately
Mikko Rasa [Wed, 10 Aug 2011 17:49:39 +0000 (20:49 +0300)]
Add an overload for resolve that takes host and service separately

13 years agoAdd back get_port functions to InetAddr and Inet6Addr
Mikko Rasa [Wed, 10 Aug 2011 16:30:16 +0000 (19:30 +0300)]
Add back get_port functions to InetAddr and Inet6Addr

13 years agoCreate wildcard addresses if * is passed as host
Mikko Rasa [Wed, 10 Aug 2011 16:28:39 +0000 (19:28 +0300)]
Create wildcard addresses if * is passed as host

13 years agoAdd missing virtual keywords
Mikko Rasa [Wed, 10 Aug 2011 15:18:27 +0000 (18:18 +0300)]
Add missing virtual keywords

13 years agoRename SockAddr::from_sys to new_from_sys
Mikko Rasa [Wed, 10 Aug 2011 15:12:04 +0000 (18:12 +0300)]
Rename SockAddr::from_sys to new_from_sys

13 years agoDon't let exceptions from the socket fall out of Client::data_available
Mikko Rasa [Sun, 7 Aug 2011 08:45:44 +0000 (11:45 +0300)]
Don't let exceptions from the socket fall out of Client::data_available

13 years agoAdd linefeeds to error response content
Mikko Rasa [Sat, 6 Aug 2011 20:59:00 +0000 (23:59 +0300)]
Add linefeeds to error response content

13 years agoDrop Id tags and copyright notices from source files
Mikko Rasa [Sat, 6 Aug 2011 20:57:25 +0000 (23:57 +0300)]
Drop Id tags and copyright notices from source files

13 years agoStyle update: spaces around assignments
Mikko Rasa [Sat, 6 Aug 2011 20:53:52 +0000 (23:53 +0300)]
Style update: spaces around assignments

13 years agoPass an exception to signal_connect_finished
Mikko Rasa [Sat, 6 Aug 2011 21:02:13 +0000 (00:02 +0300)]
Pass an exception to signal_connect_finished

13 years agoMove signal_connect_finished to ClientSocket
Mikko Rasa [Sat, 6 Aug 2011 21:00:09 +0000 (00:00 +0300)]
Move signal_connect_finished to ClientSocket

13 years agoThere's no good reason to prefer WASConnect over connect
Mikko Rasa [Sat, 6 Aug 2011 20:40:33 +0000 (23:40 +0300)]
There's no good reason to prefer WASConnect over connect

13 years agoFix windows build
Mikko Rasa [Sat, 6 Aug 2011 20:40:22 +0000 (23:40 +0300)]
Fix windows build

13 years agoDon't consider calling poll_connect without a connection attempt an error
Mikko Rasa [Sat, 6 Aug 2011 20:39:00 +0000 (23:39 +0300)]
Don't consider calling poll_connect without a connection attempt an error

13 years agoCorrect poll usage
Mikko Rasa [Sat, 6 Aug 2011 20:32:26 +0000 (23:32 +0300)]
Correct poll usage

13 years agoMove some functions around a bit
Mikko Rasa [Sat, 6 Aug 2011 20:30:00 +0000 (23:30 +0300)]
Move some functions around a bit

13 years agoAdd ClientSocket and ServerSocket abstractions
Mikko Rasa [Sat, 6 Aug 2011 20:17:41 +0000 (23:17 +0300)]
Add ClientSocket and ServerSocket abstractions

13 years agoAdd netcat example
Mikko Rasa [Sat, 6 Aug 2011 16:24:36 +0000 (19:24 +0300)]
Add netcat example

13 years agoHide platform specific parts of socket addresses
Mikko Rasa [Sat, 6 Aug 2011 16:23:26 +0000 (19:23 +0300)]
Hide platform specific parts of socket addresses

13 years agoHide AF_* constants from the public header
Mikko Rasa [Sat, 6 Aug 2011 12:03:04 +0000 (15:03 +0300)]
Hide AF_* constants from the public header

13 years agoHide platform details of Socket behind pimpl
Mikko Rasa [Sat, 6 Aug 2011 09:14:36 +0000 (12:14 +0300)]
Hide platform details of Socket behind pimpl

13 years agoOne more header update
Mikko Rasa [Sat, 6 Aug 2011 09:14:10 +0000 (12:14 +0300)]
One more header update

13 years agoRemove the now-obsolete check_state method
Mikko Rasa [Fri, 5 Aug 2011 22:00:30 +0000 (01:00 +0300)]
Remove the now-obsolete check_state method

13 years agoRemove the close method from Socket, making it more RAII
Mikko Rasa [Fri, 5 Aug 2011 21:52:45 +0000 (00:52 +0300)]
Remove the close method from Socket, making it more RAII

13 years agoDon't close socket on Communicator error
Mikko Rasa [Fri, 5 Aug 2011 21:50:08 +0000 (00:50 +0300)]
Don't close socket on Communicator error

13 years agoException changes
Mikko Rasa [Thu, 4 Aug 2011 22:57:25 +0000 (01:57 +0300)]
Exception changes

13 years agoUpdate handle types
Mikko Rasa [Thu, 4 Aug 2011 22:46:00 +0000 (01:46 +0300)]
Update handle types
Derive Socket from EventObject

13 years agoUse maputils
Mikko Rasa [Thu, 4 Aug 2011 22:44:12 +0000 (01:44 +0300)]
Use maputils

13 years agoUpdate TimeDelta to timeval conversion
Mikko Rasa [Thu, 4 Aug 2011 22:42:33 +0000 (01:42 +0300)]
Update TimeDelta to timeval conversion

13 years agoHeader changes
Mikko Rasa [Thu, 4 Aug 2011 22:41:48 +0000 (01:41 +0300)]
Header changes

13 years agoRequire mspcore since the io library was integrated into it
Mikko Rasa [Thu, 4 Aug 2011 22:39:05 +0000 (01:39 +0300)]
Require mspcore since the io library was integrated into it

13 years agoComment changes
Mikko Rasa [Tue, 2 Aug 2011 08:36:09 +0000 (11:36 +0300)]
Comment changes

13 years agoStyle update: reorder class members
Mikko Rasa [Mon, 1 Aug 2011 12:17:45 +0000 (15:17 +0300)]
Style update: reorder class members