eefa3d8e | 12-Sep-2017 |
Brandon Carpenter <brandon.carpenter@cypherpath.com> |
io: Small updates in preparation for websocket changes
Gets rid of unnecessary bit shifting and performs proper EOF checking to avoid a large number of repeated calls to recvmsg() when a client abru
io: Small updates in preparation for websocket changes
Gets rid of unnecessary bit shifting and performs proper EOF checking to avoid a large number of repeated calls to recvmsg() when a client abruptly terminates a connection (bug fix).
Signed-off-by: Brandon Carpenter <brandon.carpenter@cypherpath.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
show more ...
|
33badfd1 | 06-Sep-2017 |
Daniel P. Berrange <berrange@redhat.com> |
io: use case insensitive check for Connection & Upgrade websock headers
When checking the value of the Connection and Upgrade HTTP headers the websock RFC (6455) requires the comparison to be case i
io: use case insensitive check for Connection & Upgrade websock headers
When checking the value of the Connection and Upgrade HTTP headers the websock RFC (6455) requires the comparison to be case insensitive. The Connection value should be an exact match not a substring.
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
show more ...
|
3a3f8705 | 06-Sep-2017 |
Daniel P. Berrange <berrange@redhat.com> |
io: include full error message in websocket handshake trace
When the websocket handshake fails it is useful to log the real error message via the trace points for debugging purposes.
Fixes bug: #17
io: include full error message in websocket handshake trace
When the websocket handshake fails it is useful to log the real error message via the trace points for debugging purposes.
Fixes bug: #1715186
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
show more ...
|
e8ffaa31 | 05-Sep-2017 |
Eric Blake <eblake@redhat.com> |
io: Add new qio_channel_read{, v}_all_eof functions
Some callers want to distinguish between clean EOF (no bytes read) vs. a short read (at least one byte read, but EOF encountered before reaching t
io: Add new qio_channel_read{, v}_all_eof functions
Some callers want to distinguish between clean EOF (no bytes read) vs. a short read (at least one byte read, but EOF encountered before reaching the desired length), as it allows clients the ability to do a graceful shutdown when a server shuts down at defined safe points in the protocol, rather than treating all shutdown scenarios as an error due to EOF. However, we don't want to require all callers to have to check for early EOF. So add another wrapper function that can be used by the callers that care about the distinction.
Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20170905191114.5959-3-eblake@redhat.com> Acked-by: Daniel P. Berrange <berrange@redhat.com>
show more ...
|
d4622e55 | 30-Aug-2017 |
Daniel P. Berrange <berrange@redhat.com> |
io: add new qio_channel_{readv, writev, read, write}_all functions
These functions wait until they are able to read / write the full requested data buffer(s).
Reviewed-by: Eric Blake <eblake@redhat
io: add new qio_channel_{readv, writev, read, write}_all functions
These functions wait until they are able to read / write the full requested data buffer(s).
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
show more ...
|
bd269ebc | 26-Apr-2017 |
Markus Armbruster <armbru@redhat.com> |
sockets: Limit SocketAddressLegacy to external interfaces
SocketAddressLegacy is a simple union, and simple unions are awkward: they have their variant members wrapped in a "data" object on the wire
sockets: Limit SocketAddressLegacy to external interfaces
SocketAddressLegacy is a simple union, and simple unions are awkward: they have their variant members wrapped in a "data" object on the wire, and require additional indirections in C. SocketAddress is the equivalent flat union. Convert all users of SocketAddressLegacy to SocketAddress, except for existing external interfaces.
See also commit fce5d53..9445673 and 85a82e8..c5f1ae3.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-7-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Minor editing accident fixed, commit message and a comment tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
b8a68728 | 03-Apr-2017 |
Daniel P. Berrange <berrange@redhat.com> |
io: fix FD socket handling in DNS lookup
The qio_dns_resolver_lookup_sync() method is required to be a no-op for socket kinds that don't require name resolution. Thus the KIND_FD handling should not
io: fix FD socket handling in DNS lookup
The qio_dns_resolver_lookup_sync() method is required to be a no-op for socket kinds that don't require name resolution. Thus the KIND_FD handling should not return an error.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
show more ...
|
07e95cd5 | 28-Feb-2017 |
Daniel P. Berrange <berrange@redhat.com> |
io: fully parse & validate HTTP headers for websocket protocol handshake
The current websockets protocol handshake code is very relaxed, just doing crude string searching across the HTTP header data
io: fully parse & validate HTTP headers for websocket protocol handshake
The current websockets protocol handshake code is very relaxed, just doing crude string searching across the HTTP header data. This causes it to both reject valid connections and fail to reject invalid connections. For example, according to the RFC 6455 it:
- MUST reject any method other than "GET" - MUST reject any HTTP version less than "HTTP/1.1" - MUST reject Connection header without "Upgrade" listed - MUST reject Upgrade header which is not 'websocket' - MUST reject missing Host header - MUST treat HTTP header names as case insensitive
To do all this validation correctly requires that we fully parse the HTTP headers, populating a data structure containing the header fields.
After this change, we also reject any path other than '/'
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
show more ...
|
c4c497d2 | 13-Feb-2017 |
Paolo Bonzini <pbonzini@redhat.com> |
io: make qio_channel_yield aware of AioContexts
Support separate coroutines for reading and writing, and place the read/write handlers on the AioContext that the QIOChannel is registered with.
Revi
io: make qio_channel_yield aware of AioContexts
Support separate coroutines for reading and writing, and place the read/write handlers on the AioContext that the QIOChannel is registered with.
Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 20170213135235.12274-7-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|