Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- getHttpVersion
- getLocalAddress
- getMethod
- getReasonPhrase
- getRemoteAddress
- getRemoteHost
- getRequestBody
- getRequestHeaders
- getResponseBody
- getResponseHeaders
- getSocket
- getStatus
- getTlsPeerCertificate
- getTlsPeerCertificateErrors
- getUri
- isOptionsPing
- pause
- setHttpVersion
- setRedirect
- setResponse
- setStatus
- stealConnection
- unpause
- Properties
- Signals
An HTTP server request and response pair.
A SoupServerMessage represents an HTTP message that is being sent or
received on a [classserver
].
- class
server
- will create
SoupServerMessage
s automatically for incoming requests, which your application will receive via handlers.
Note that libsoup's terminology here does not quite match the HTTP
specification: in RFC 2616, an "HTTP-message" is *either* a Request, *or* a
Response. In libsoup, a ServerMessage
combines both the request and the
response.
Synopsis
- newtype ServerMessage = ServerMessage (ManagedPtr ServerMessage)
- class (GObject o, IsDescendantOf ServerMessage o) => IsServerMessage o
- toServerMessage :: (MonadIO m, IsServerMessage o) => o -> m ServerMessage
- serverMessageGetHttpVersion :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m HTTPVersion
- serverMessageGetLocalAddress :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m (Maybe SocketAddress)
- serverMessageGetMethod :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m Text
- serverMessageGetReasonPhrase :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m (Maybe Text)
- serverMessageGetRemoteAddress :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m (Maybe SocketAddress)
- serverMessageGetRemoteHost :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m (Maybe Text)
- serverMessageGetRequestBody :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m MessageBody
- serverMessageGetRequestHeaders :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m MessageHeaders
- serverMessageGetResponseBody :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m MessageBody
- serverMessageGetResponseHeaders :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m MessageHeaders
- serverMessageGetSocket :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m (Maybe Socket)
- serverMessageGetStatus :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m Word32
- serverMessageGetTlsPeerCertificate :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m (Maybe TlsCertificate)
- serverMessageGetTlsPeerCertificateErrors :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m [TlsCertificateFlags]
- serverMessageGetUri :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m Uri
- serverMessageIsOptionsPing :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m Bool
- serverMessagePause :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m ()
- serverMessageSetHttpVersion :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> HTTPVersion -> m ()
- serverMessageSetRedirect :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> Word32 -> Text -> m ()
- serverMessageSetResponse :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> Maybe Text -> MemoryUse -> Maybe ByteString -> m ()
- serverMessageSetStatus :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> Word32 -> Maybe Text -> m ()
- serverMessageStealConnection :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m IOStream
- serverMessageUnpause :: (HasCallStack, MonadIO m, IsServerMessage a) => a -> m ()
- getServerMessageTlsPeerCertificate :: (MonadIO m, IsServerMessage o) => o -> m (Maybe TlsCertificate)
- getServerMessageTlsPeerCertificateErrors :: (MonadIO m, IsServerMessage o) => o -> m [TlsCertificateFlags]
- type ServerMessageAcceptCertificateCallback = TlsCertificate -> [TlsCertificateFlags] -> IO Bool
- afterServerMessageAcceptCertificate :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageAcceptCertificateCallback) -> m SignalHandlerId
- onServerMessageAcceptCertificate :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageAcceptCertificateCallback) -> m SignalHandlerId
- type ServerMessageConnectedCallback = IO ()
- afterServerMessageConnected :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageConnectedCallback) -> m SignalHandlerId
- onServerMessageConnected :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageConnectedCallback) -> m SignalHandlerId
- type ServerMessageDisconnectedCallback = IO ()
- afterServerMessageDisconnected :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageDisconnectedCallback) -> m SignalHandlerId
- onServerMessageDisconnected :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageDisconnectedCallback) -> m SignalHandlerId
- type ServerMessageFinishedCallback = IO ()
- afterServerMessageFinished :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageFinishedCallback) -> m SignalHandlerId
- onServerMessageFinished :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageFinishedCallback) -> m SignalHandlerId
- type ServerMessageGotBodyCallback = IO ()
- afterServerMessageGotBody :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageGotBodyCallback) -> m SignalHandlerId
- onServerMessageGotBody :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageGotBodyCallback) -> m SignalHandlerId
- type ServerMessageGotChunkCallback = Bytes -> IO ()
- afterServerMessageGotChunk :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageGotChunkCallback) -> m SignalHandlerId
- onServerMessageGotChunk :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageGotChunkCallback) -> m SignalHandlerId
- type ServerMessageGotHeadersCallback = IO ()
- afterServerMessageGotHeaders :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageGotHeadersCallback) -> m SignalHandlerId
- onServerMessageGotHeaders :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageGotHeadersCallback) -> m SignalHandlerId
- type ServerMessageWroteBodyCallback = IO ()
- afterServerMessageWroteBody :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteBodyCallback) -> m SignalHandlerId
- onServerMessageWroteBody :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteBodyCallback) -> m SignalHandlerId
- type ServerMessageWroteBodyDataCallback = Word32 -> IO ()
- afterServerMessageWroteBodyData :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteBodyDataCallback) -> m SignalHandlerId
- onServerMessageWroteBodyData :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteBodyDataCallback) -> m SignalHandlerId
- type ServerMessageWroteChunkCallback = IO ()
- afterServerMessageWroteChunk :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteChunkCallback) -> m SignalHandlerId
- onServerMessageWroteChunk :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteChunkCallback) -> m SignalHandlerId
- type ServerMessageWroteHeadersCallback = IO ()
- afterServerMessageWroteHeaders :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteHeadersCallback) -> m SignalHandlerId
- onServerMessageWroteHeaders :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteHeadersCallback) -> m SignalHandlerId
- type ServerMessageWroteInformationalCallback = IO ()
- afterServerMessageWroteInformational :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteInformationalCallback) -> m SignalHandlerId
- onServerMessageWroteInformational :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteInformationalCallback) -> m SignalHandlerId
Exported types
newtype ServerMessage Source #
Memory-managed wrapper type.
ServerMessage (ManagedPtr ServerMessage) |
Instances
Eq ServerMessage Source # | |
Defined in GI.Soup.Objects.ServerMessage (==) :: ServerMessage -> ServerMessage -> Bool # (/=) :: ServerMessage -> ServerMessage -> Bool # | |
GObject ServerMessage Source # | |
Defined in GI.Soup.Objects.ServerMessage | |
ManagedPtrNewtype ServerMessage Source # | |
Defined in GI.Soup.Objects.ServerMessage toManagedPtr :: ServerMessage -> ManagedPtr ServerMessage | |
TypedObject ServerMessage Source # | |
Defined in GI.Soup.Objects.ServerMessage | |
HasParentTypes ServerMessage Source # | |
Defined in GI.Soup.Objects.ServerMessage | |
IsGValue (Maybe ServerMessage) Source # | Convert |
Defined in GI.Soup.Objects.ServerMessage gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe ServerMessage -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe ServerMessage) | |
type ParentTypes ServerMessage Source # | |
Defined in GI.Soup.Objects.ServerMessage type ParentTypes ServerMessage = '[Object] |
class (GObject o, IsDescendantOf ServerMessage o) => IsServerMessage o Source #
Type class for types which can be safely cast to ServerMessage
, for instance with toServerMessage
.
Instances
(GObject o, IsDescendantOf ServerMessage o) => IsServerMessage o Source # | |
Defined in GI.Soup.Objects.ServerMessage |
toServerMessage :: (MonadIO m, IsServerMessage o) => o -> m ServerMessage Source #
Cast to ServerMessage
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, isOptionsPing, notify, notifyByPspec, pause, ref, refSink, runDispose, stealConnection, stealData, stealQdata, thawNotify, unpause, unref, watchClosure.
Getters
getData, getHttpVersion, getLocalAddress, getMethod, getProperty, getQdata, getReasonPhrase, getRemoteAddress, getRemoteHost, getRequestBody, getRequestHeaders, getResponseBody, getResponseHeaders, getSocket, getStatus, getTlsPeerCertificate, getTlsPeerCertificateErrors, getUri.
Setters
setData, setDataFull, setHttpVersion, setProperty, setRedirect, setResponse, setStatus.
getHttpVersion
serverMessageGetHttpVersion Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m HTTPVersion | Returns: a |
Get the HTTP version of msg
.
getLocalAddress
serverMessageGetLocalAddress Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m (Maybe SocketAddress) | Returns: the |
Retrieves the SocketAddress
associated with the local end
of a connection.
getMethod
serverMessageGetMethod Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m Text | Returns: the HTTP method. |
Get the HTTP method of msg
.
getReasonPhrase
serverMessageGetReasonPhrase Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m (Maybe Text) | Returns: the reason phrase. |
Get the HTTP reason phrase of msg
.
getRemoteAddress
serverMessageGetRemoteAddress Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m (Maybe SocketAddress) | Returns: the |
Retrieves the SocketAddress
associated with the remote end
of a connection.
getRemoteHost
serverMessageGetRemoteHost Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m (Maybe Text) | Returns: the IP address associated with the remote
end of a connection, it may be |
Retrieves the IP address associated with the remote end of a connection.
getRequestBody
serverMessageGetRequestBody Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m MessageBody | Returns: a |
Get the request body of msg
.
getRequestHeaders
serverMessageGetRequestHeaders Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m MessageHeaders | Returns: a |
Get the request headers of msg
.
getResponseBody
serverMessageGetResponseBody Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m MessageBody | Returns: a |
Get the response body of msg
.
getResponseHeaders
serverMessageGetResponseHeaders Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m MessageHeaders | Returns: a |
Get the response headers of msg
.
getSocket
serverMessageGetSocket Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m (Maybe Socket) | Returns: the |
Retrieves the Socket
that msg
is associated with.
If you are using this method to observe when multiple requests are made on the same persistent HTTP connection (eg, as the ntlm-test test program does), you will need to pay attention to socket destruction as well (eg, by using weak references), so that you do not get fooled when the allocator reuses the memory address of a previously-destroyed socket to represent a new socket.
getStatus
serverMessageGetStatus Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m Word32 | Returns: the HTTP status code. |
Get the HTTP status code of msg
.
getTlsPeerCertificate
serverMessageGetTlsPeerCertificate Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m (Maybe TlsCertificate) | Returns: |
Gets the peer's TlsCertificate
associated with msg
's connection.
Note that this is not set yet during the emission of
SoupServerMessageacceptCertificate signal.
Since: 3.2
getTlsPeerCertificateErrors
serverMessageGetTlsPeerCertificateErrors Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m [TlsCertificateFlags] | Returns: a |
Gets the errors associated with validating msg
's TLS peer certificate.
Note that this is not set yet during the emission of
SoupServerMessageacceptCertificate signal.
Since: 3.2
getUri
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m Uri | Returns: a |
Get msg
's URI.
isOptionsPing
serverMessageIsOptionsPing Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m Bool | Returns: |
Gets if msg
represents an OPTIONS message with the path *
.
pause
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m () |
Pauses I/O on msg
.
This can be used when you need to return from the server handler without
having the full response ready yet. Use [methodserverMessage
.unpause] to
resume I/O.
Since: 3.2
setHttpVersion
serverMessageSetHttpVersion Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> HTTPVersion |
|
-> m () |
Set the HTTP version of msg
.
setRedirect
serverMessageSetRedirect Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> Word32 |
|
-> Text |
|
-> m () |
Sets msg
's status_code to statusCode
and adds a Location header
pointing to redirectUri
. Use this from a [classserver
] when you
want to redirect the client to another URI.
redirectUri
can be a relative URI, in which case it is
interpreted relative to msg
's current URI. In particular, if
redirectUri
is just a path, it will replace the path
*and query* of msg
's URI.
setResponse
serverMessageSetResponse Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> Maybe Text |
|
-> MemoryUse |
|
-> Maybe ByteString |
|
-> m () |
Convenience function to set the response body of a ServerMessage
. If
contentType
is Nothing
, the response body must be empty as well.
setStatus
serverMessageSetStatus Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> Word32 |
|
-> Maybe Text |
|
-> m () |
Sets msg
's status code to statusCode
.
If statusCode
is a known value and reasonPhrase
is Nothing
, the
reason_phrase will be set automatically.
stealConnection
serverMessageStealConnection Source #
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m IOStream | Returns: the |
"Steals" the HTTP connection associated with msg
from its Server
. This
happens immediately, regardless of the current state of the connection; if
the response to msg
has not yet finished being sent, then it will be
discarded; you can steal the connection from a
signalserverMessage
[wroteInformational] or
signalserverMessage
[wroteBody] signal handler if you need to wait for
part or all of the response to be sent.
Note that when calling this function from C, msg
will most
likely be freed as a side effect.
unpause
:: (HasCallStack, MonadIO m, IsServerMessage a) | |
=> a |
|
-> m () |
Resumes I/O on msg
.
Use this to resume after calling [methodserverMessage
.pause], or after
adding a new chunk to a chunked response. I/O won't actually resume until you
return to the main loop.
Since: 3.2
Properties
tlsPeerCertificate
The peer's TlsCertificate
associated with the message
Since: 3.2
getServerMessageTlsPeerCertificate :: (MonadIO m, IsServerMessage o) => o -> m (Maybe TlsCertificate) Source #
Get the value of the “tls-peer-certificate
” property.
When overloading is enabled, this is equivalent to
get
serverMessage #tlsPeerCertificate
tlsPeerCertificateErrors
The verification errors on ServerMessage:tlsPeerCertificate
Since: 3.2
getServerMessageTlsPeerCertificateErrors :: (MonadIO m, IsServerMessage o) => o -> m [TlsCertificateFlags] Source #
Get the value of the “tls-peer-certificate-errors
” property.
When overloading is enabled, this is equivalent to
get
serverMessage #tlsPeerCertificateErrors
Signals
acceptCertificate
type ServerMessageAcceptCertificateCallback Source #
= TlsCertificate |
|
-> [TlsCertificateFlags] |
|
-> IO Bool | Returns: |
Emitted during the msg
's connection TLS handshake
after client TLS certificate has been received.
You can return True
to accept tlsCertificate
despite
tlsErrors
.
afterServerMessageAcceptCertificate :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageAcceptCertificateCallback) -> m SignalHandlerId Source #
Connect a signal handler for the acceptCertificate signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
serverMessage #acceptCertificate callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onServerMessageAcceptCertificate :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageAcceptCertificateCallback) -> m SignalHandlerId Source #
Connect a signal handler for the acceptCertificate signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
serverMessage #acceptCertificate callback
connected
type ServerMessageConnectedCallback = IO () Source #
Emitted when the msg
's socket is connected and the TLS handshake completed.
afterServerMessageConnected :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageConnectedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the connected signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
serverMessage #connected callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onServerMessageConnected :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageConnectedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the connected signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
serverMessage #connected callback
disconnected
type ServerMessageDisconnectedCallback = IO () Source #
Emitted when the msg
's socket is disconnected.
afterServerMessageDisconnected :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageDisconnectedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the disconnected signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
serverMessage #disconnected callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onServerMessageDisconnected :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageDisconnectedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the disconnected signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
serverMessage #disconnected callback
finished
type ServerMessageFinishedCallback = IO () Source #
Emitted when all HTTP processing is finished for a message.
(After signalserverMessage
[wroteBody]).
afterServerMessageFinished :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageFinishedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the finished signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
serverMessage #finished callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onServerMessageFinished :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageFinishedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the finished signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
serverMessage #finished callback
gotBody
type ServerMessageGotBodyCallback = IO () Source #
Emitted after receiving the complete request body.
afterServerMessageGotBody :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageGotBodyCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotBody signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
serverMessage #gotBody callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onServerMessageGotBody :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageGotBodyCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotBody signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
serverMessage #gotBody callback
gotChunk
type ServerMessageGotChunkCallback Source #
= Bytes |
|
-> IO () |
Emitted after receiving a chunk of a message body.
Note that "chunk" in this context means any subpiece of the body, not necessarily the specific HTTP 1.1 chunks sent by the other side.
afterServerMessageGotChunk :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageGotChunkCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotChunk signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
serverMessage #gotChunk callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onServerMessageGotChunk :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageGotChunkCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotChunk signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
serverMessage #gotChunk callback
gotHeaders
type ServerMessageGotHeadersCallback = IO () Source #
Emitted after receiving the Request-Line and request headers.
afterServerMessageGotHeaders :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageGotHeadersCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotHeaders signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
serverMessage #gotHeaders callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onServerMessageGotHeaders :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageGotHeadersCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotHeaders signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
serverMessage #gotHeaders callback
wroteBody
type ServerMessageWroteBodyCallback = IO () Source #
Emitted immediately after writing the complete response body for a message.
afterServerMessageWroteBody :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteBodyCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteBody signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
serverMessage #wroteBody callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onServerMessageWroteBody :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteBodyCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteBody signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
serverMessage #wroteBody callback
wroteBodyData
type ServerMessageWroteBodyDataCallback Source #
Emitted immediately after writing a portion of the message body to the network.
afterServerMessageWroteBodyData :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteBodyDataCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteBodyData signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
serverMessage #wroteBodyData callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onServerMessageWroteBodyData :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteBodyDataCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteBodyData signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
serverMessage #wroteBodyData callback
wroteChunk
type ServerMessageWroteChunkCallback = IO () Source #
Emitted immediately after writing a body chunk for a message.
Note that this signal is not parallel to
signalserverMessage
[gotChunk]; it is emitted only when a complete
chunk (added with [methodmessageBody
.append] or
[methodmessageBody
.append_bytes] has been written. To get
more useful continuous progress information, use
signalserverMessage
[wroteBodyData].
afterServerMessageWroteChunk :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteChunkCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteChunk signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
serverMessage #wroteChunk callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onServerMessageWroteChunk :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteChunkCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteChunk signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
serverMessage #wroteChunk callback
wroteHeaders
type ServerMessageWroteHeadersCallback = IO () Source #
Emitted immediately after writing the response headers for a message.
afterServerMessageWroteHeaders :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteHeadersCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteHeaders signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
serverMessage #wroteHeaders callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onServerMessageWroteHeaders :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteHeadersCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteHeaders signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
serverMessage #wroteHeaders callback
wroteInformational
type ServerMessageWroteInformationalCallback = IO () Source #
Emitted immediately after writing a 1xx (Informational) response.
afterServerMessageWroteInformational :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteInformationalCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteInformational signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
serverMessage #wroteInformational callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onServerMessageWroteInformational :: (IsServerMessage a, MonadIO m) => a -> ((?self :: a) => ServerMessageWroteInformationalCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteInformational signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
serverMessage #wroteInformational callback