Apache HTTPD
Modules | Classes | Typedefs | Enumerations | Functions | Variables
Poll Routines

Modules

 Poll options
 
 Pollset Flags
 

Classes

union  apr_descriptor
 
struct  apr_pollfd_t
 

Typedefs

typedef struct apr_pollfd_t apr_pollfd_t
 
typedef struct apr_pollset_t apr_pollset_t
 
typedef struct apr_pollcb_t apr_pollcb_t
 
typedef apr_status_t(* apr_pollcb_cb_t) (void *baton, apr_pollfd_t *descriptor)
 

Enumerations

enum  apr_pollset_method_e {
  APR_POLLSET_DEFAULT , APR_POLLSET_SELECT , APR_POLLSET_KQUEUE , APR_POLLSET_PORT ,
  APR_POLLSET_EPOLL , APR_POLLSET_POLL , APR_POLLSET_AIO_MSGQ
}
 
enum  apr_datatype_e { APR_NO_DESC , APR_POLL_SOCKET , APR_POLL_FILE , APR_POLL_LASTDESC }
 

Functions

 APR_DECLARE (apr_status_t) apr_pollset_create(apr_pollset_t **pollset
 
 APR_DECLARE (const char *) apr_pollset_method_name(apr_pollset_t *pollset)
 

Variables

apr_uint32_t size
 
apr_uint32_t apr_pool_tp
 
apr_uint32_t apr_pool_t apr_uint32_t flags
 
apr_uint32_t apr_pool_t apr_uint32_t apr_pollset_method_e method
 
const apr_pollfd_tdescriptor
 
apr_interval_time_t timeout
 
apr_interval_time_t apr_int32_tnum
 
apr_interval_time_t apr_int32_t const apr_pollfd_t ** descriptors
 
apr_int32_t numsock
 
apr_int32_t apr_int32_tnsds
 
apr_interval_time_t apr_pollcb_cb_t func
 
apr_interval_time_t apr_pollcb_cb_t void * baton
 

Detailed Description

Typedef Documentation

◆ apr_pollcb_cb_t

typedef apr_status_t(* apr_pollcb_cb_t) (void *baton, apr_pollfd_t *descriptor)

Function prototype for pollcb handlers

Parameters
batonOpaque baton passed into apr_pollcb_poll()
descriptorContains the notification for an active descriptor. The rtnevents member describes which events were triggered for this descriptor.
Remarks
If the pollcb handler does not return APR_SUCCESS, the apr_pollcb_poll() call returns with the handler's return value.

Definition at line 401 of file apr_poll.h.

◆ apr_pollcb_t

Opaque structure used for pollcb API

Definition at line 317 of file apr_poll.h.

◆ apr_pollfd_t

See also
apr_pollfd_t

Definition at line 105 of file apr_poll.h.

◆ apr_pollset_t

Opaque structure used for pollset API

Definition at line 123 of file apr_poll.h.

Enumeration Type Documentation

◆ apr_datatype_e

Used in apr_pollfd_t to determine what the apr_descriptor is

Enumerator
APR_NO_DESC 

nothing here

APR_POLL_SOCKET 

descriptor refers to a socket

APR_POLL_FILE 

descriptor refers to a file

APR_POLL_LASTDESC 
Deprecated:
descriptor is the last one in the list

Definition at line 91 of file apr_poll.h.

◆ apr_pollset_method_e

Pollset Methods

Enumerator
APR_POLLSET_DEFAULT 

Platform default poll method

APR_POLLSET_SELECT 

Poll uses select method

APR_POLLSET_KQUEUE 

Poll uses kqueue method

APR_POLLSET_PORT 

Poll uses Solaris event port method

APR_POLLSET_EPOLL 

Poll uses epoll method

APR_POLLSET_POLL 

Poll uses poll method

APR_POLLSET_AIO_MSGQ 

Poll uses z/OS asio method

Definition at line 80 of file apr_poll.h.

Function Documentation

◆ APR_DECLARE() [1/2]

APR_DECLARE ( apr_status_t  )

Set up a pollset object

Parameters
pollsetThe pointer in which to return the newly created object
sizeThe maximum number of descriptors that this pollset can hold
pThe pool from which to allocate the pollset
flagsOptional flags to modify the operation of the pollset.
Remarks
If flags contains APR_POLLSET_THREADSAFE, then a pollset is created on which it is safe to make concurrent calls to apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() from separate threads. This feature is only supported on some platforms; the apr_pollset_create() call will fail with APR_ENOTIMPL on platforms where it is not supported.
If flags contains APR_POLLSET_WAKEABLE, then a pollset is created with an additional internal pipe object used for the apr_pollset_wakeup() call. The actual size of pollset is in that case size + 1. This feature is only supported on some platforms; the apr_pollset_create() call will fail with APR_ENOTIMPL on platforms where it is not supported.
If flags contains APR_POLLSET_NOCOPY, then the apr_pollfd_t structures passed to apr_pollset_add() are not copied and must have a lifetime at least as long as the pollset.
Some poll methods (including APR_POLLSET_KQUEUE, APR_POLLSET_PORT, and APR_POLLSET_EPOLL) do not have a fixed limit on the size of the pollset. For these methods, the size parameter controls the maximum number of descriptors that will be returned by a single call to apr_pollset_poll().

Set up a pollset object

Parameters
pollsetThe pointer in which to return the newly created object
sizeThe maximum number of descriptors that this pollset can hold
pThe pool from which to allocate the pollset
flagsOptional flags to modify the operation of the pollset.
methodPoll method to use. See apr_pollset_method_e. If this method cannot be used, the default method will be used unless the APR_POLLSET_NODEFAULT flag has been specified.
Remarks
If flags contains APR_POLLSET_THREADSAFE, then a pollset is created on which it is safe to make concurrent calls to apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() from separate threads. This feature is only supported on some platforms; the apr_pollset_create_ex() call will fail with APR_ENOTIMPL on platforms where it is not supported.
If flags contains APR_POLLSET_WAKEABLE, then a pollset is created with additional internal pipe object used for the apr_pollset_wakeup() call. The actual size of pollset is in that case size + 1. This feature is only supported on some platforms; the apr_pollset_create_ex() call will fail with APR_ENOTIMPL on platforms where it is not supported.
If flags contains APR_POLLSET_NOCOPY, then the apr_pollfd_t structures passed to apr_pollset_add() are not copied and must have a lifetime at least as long as the pollset.
Some poll methods (including APR_POLLSET_KQUEUE, APR_POLLSET_PORT, and APR_POLLSET_EPOLL) do not have a fixed limit on the size of the pollset. For these methods, the size parameter controls the maximum number of descriptors that will be returned by a single call to apr_pollset_poll().

Destroy a pollset object

Parameters
pollsetThe pollset to destroy

Add a socket or file descriptor to a pollset

Parameters
pollsetThe pollset to which to add the descriptor
descriptorThe descriptor to add
Remarks
If you set client_data in the descriptor, that value will be returned in the client_data field whenever this descriptor is signalled in apr_pollset_poll().
If the pollset has been created with APR_POLLSET_THREADSAFE and thread T1 is blocked in a call to apr_pollset_poll() for this same pollset that is being modified via apr_pollset_add() in thread T2, the currently executing apr_pollset_poll() call in T1 will either: (1) automatically include the newly added descriptor in the set of descriptors it is watching or (2) return immediately with APR_EINTR. Option (1) is recommended, but option (2) is allowed for implementations where option (1) is impossible or impractical.
If the pollset has been created with APR_POLLSET_NOCOPY, the apr_pollfd_t structure referenced by descriptor will not be copied and must have a lifetime at least as long as the pollset.
Do not add the same socket or file descriptor to the same pollset multiple times, even if the requested events differ for the different calls to apr_pollset_add(). If the events of interest for a descriptor change, you must first remove the descriptor from the pollset with apr_pollset_remove(), then add it again specifying all requested events.

Remove a descriptor from a pollset

Parameters
pollsetThe pollset from which to remove the descriptor
descriptorThe descriptor to remove
Remarks
If the descriptor is not found, APR_NOTFOUND is returned.
If the pollset has been created with APR_POLLSET_THREADSAFE and thread T1 is blocked in a call to apr_pollset_poll() for this same pollset that is being modified via apr_pollset_remove() in thread T2, the currently executing apr_pollset_poll() call in T1 will either: (1) automatically exclude the newly added descriptor in the set of descriptors it is watching or (2) return immediately with APR_EINTR. Option (1) is recommended, but option (2) is allowed for implementations where option (1) is impossible or impractical.
apr_pollset_remove() cannot be used to remove a subset of requested events for a descriptor. The reqevents field in the apr_pollfd_t parameter must contain the same value when removing as when adding.

Block for activity on the descriptor(s) in a pollset

Parameters
pollsetThe pollset to use
timeoutThe amount of time in microseconds to wait. This is a maximum, not a minimum. If a descriptor is signalled, the function will return before this time. If timeout is negative, the function will block until a descriptor is signalled or until apr_pollset_wakeup() has been called.
numNumber of signalled descriptors (output parameter)
descriptorsArray of signalled descriptors (output parameter)
Remarks
APR_EINTR will be returned if the pollset has been created with APR_POLLSET_WAKEABLE, apr_pollset_wakeup() has been called while waiting for activity, and there were no signalled descriptors at the time of the wakeup call.
Multiple signalled conditions for the same descriptor may be reported in one or more returned apr_pollfd_t structures, depending on the implementation.

Interrupt the blocked apr_pollset_poll() call.

Parameters
pollsetThe pollset to use
Remarks
If the pollset was not created with APR_POLLSET_WAKEABLE the return value is APR_EINIT.

Poll the descriptors in the poll structure

Parameters
aprsetThe poll structure we will be using.
numsockThe number of descriptors we are polling
nsdsThe number of descriptors signalled (output parameter)
timeoutThe amount of time in microseconds to wait. This is a maximum, not a minimum. If a descriptor is signalled, the function will return before this time. If timeout is negative, the function will block until a descriptor is signalled or until apr_pollset_wakeup() has been called.
Remarks
The number of descriptors signalled is returned in the third argument. This is a blocking call, and it will not return until either a descriptor has been signalled or the timeout has expired.
The rtnevents field in the apr_pollfd_t array will only be filled- in if the return value is APR_SUCCESS.

Set up a pollcb object

Parameters
pollcbThe pointer in which to return the newly created object
sizeThe maximum number of descriptors that a single _poll can return.
pThe pool from which to allocate the pollcb
flagsOptional flags to modify the operation of the pollcb.
Remarks
If flags contains APR_POLLSET_WAKEABLE, then a pollcb is created with an additional internal pipe object used for the apr_pollcb_wakeup() call. The actual size of pollcb is in that case size + 1.
Pollcb is only supported on some platforms; the apr_pollcb_create() call will fail with APR_ENOTIMPL on platforms where it is not supported.

Set up a pollcb object

Parameters
pollcbThe pointer in which to return the newly created object
sizeThe maximum number of descriptors that a single _poll can return.
pThe pool from which to allocate the pollcb
flagsOptional flags to modify the operation of the pollcb.
methodPoll method to use. See apr_pollset_method_e. If this method cannot be used, the default method will be used unless the APR_POLLSET_NODEFAULT flag has been specified.
Remarks
If flags contains APR_POLLSET_WAKEABLE, then a pollcb is created with an additional internal pipe object used for the apr_pollcb_wakeup() call. The actual size of pollcb is in that case size + 1.
Pollcb is only supported on some platforms; the apr_pollcb_create_ex() call will fail with APR_ENOTIMPL on platforms where it is not supported.

Add a socket or file descriptor to a pollcb

Parameters
pollcbThe pollcb to which to add the descriptor
descriptorThe descriptor to add
Remarks
If you set client_data in the descriptor, that value will be returned in the client_data field whenever this descriptor is signalled in apr_pollcb_poll().
Unlike the apr_pollset API, the descriptor is not copied, and users must retain the memory used by descriptor, as the same pointer will be returned to them from apr_pollcb_poll.
Do not add the same socket or file descriptor to the same pollcb multiple times, even if the requested events differ for the different calls to apr_pollcb_add(). If the events of interest for a descriptor change, you must first remove the descriptor from the pollcb with apr_pollcb_remove(), then add it again specifying all requested events.

Remove a descriptor from a pollcb

Parameters
pollcbThe pollcb from which to remove the descriptor
descriptorThe descriptor to remove
Remarks
If the descriptor is not found, APR_NOTFOUND is returned.
apr_pollcb_remove() cannot be used to remove a subset of requested events for a descriptor. The reqevents field in the apr_pollfd_t parameter must contain the same value when removing as when adding.

Block for activity on the descriptor(s) in a pollcb

Parameters
pollcbThe pollcb to use
timeoutThe amount of time in microseconds to wait. This is a maximum, not a minimum. If a descriptor is signalled, the function will return before this time. If timeout is negative, the function will block until a descriptor is signalled or until apr_pollcb_wakeup() has been called.
funcCallback function to call for each active descriptor.
batonOpaque baton passed to the callback function.
Remarks
Multiple signalled conditions for the same descriptor may be reported in one or more calls to the callback function, depending on the implementation.
APR_EINTR will be returned if the pollset has been created with APR_POLLSET_WAKEABLE and apr_pollcb_wakeup() has been called while waiting for activity.

Interrupt the blocked apr_pollcb_poll() call.

Parameters
pollcbThe pollcb to use
Remarks
If the pollcb was not created with APR_POLLSET_WAKEABLE the return value is APR_EINIT.

< File is read-only

< File is executable

< all protections

< File is read-only

< File is read-only

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Write by group

<

Deprecated:
See also
APR_FPROT_GWRITE

< Write by others

<

Deprecated:
See also
APR_FPROT_WWRITE

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Write by group

<

Deprecated:
See also
APR_FPROT_GWRITE

< Write by others

<

Deprecated:
See also
APR_FPROT_WWRITE

< File is executable

< File is executable

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by group

<

Deprecated:
See also
APR_FPROT_GEXECUTE

< Execute by others

<

Deprecated:
See also
APR_FPROT_WEXECUTE

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by group

<

Deprecated:
See also
APR_FPROT_GEXECUTE

< Execute by others

<

Deprecated:
See also
APR_FPROT_WEXECUTE

< Stat the link not the file itself if it is a link

< Stat the link not the file itself if it is a link

< ->name in proper case

< ->name in proper case

< Access Time

< Create the file if not there

< Open the file for reading

< Open the file for writing

< Delete the file after close

< Open should fail if APR_FOPEN_CREATE and file exists.

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Read by user

<

Deprecated:
See also
APR_FPROT_UREAD

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< ->name in proper case

< Modification Time

< Access Time

< Creation or inode-changed time

< Type

< Size of the file

< Storage size consumed by the file

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< ->name in proper case

< ->name in proper case

< Type

< all protections

< ->name in proper case

< ->name in proper case

< File is read-only

< File is hidden

< File is read-only

< File is read-only

< File is hidden

< File is hidden

< Platform dependent flag to enable * non blocking file io

< Open the file for reading

< Open the file for writing

< Open the file for reading

< Open the file for writing

< Open the file for buffered I/O

< Create the file if not there

< Open should fail if APR_FOPEN_CREATE and file exists.

< Open the file and truncate to 0 length

< Open should fail if APR_FOPEN_CREATE and file exists.

< Create the file if not there

< Open the file and truncate to 0 length

< Append to the end of the file

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Delete the file after close

< Open the file for buffered I/O

< Open the file for writing

< Open the file for writing

< Open the file for reading

< Append to the end of the file

< an atomic unix apr_stat()

< Open the file for writing

< Create the file if not there

< Open the file and truncate to 0 length

< Open the file for writing

< Create the file if not there

< Append to the end of the file

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< File is read-only

< File is executable

< all protections

< File is read-only

< File is read-only

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Write by group

<

Deprecated:
See also
APR_FPROT_GWRITE

< Write by others

<

Deprecated:
See also
APR_FPROT_WWRITE

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Write by group

<

Deprecated:
See also
APR_FPROT_GWRITE

< Write by others

<

Deprecated:
See also
APR_FPROT_WWRITE

< File is executable

< File is executable

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by group

<

Deprecated:
See also
APR_FPROT_GEXECUTE

< Execute by others

<

Deprecated:
See also
APR_FPROT_WEXECUTE

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by group

<

Deprecated:
See also
APR_FPROT_GEXECUTE

< Execute by others

<

Deprecated:
See also
APR_FPROT_WEXECUTE

< Access Time

< Stat the link not the file itself if it is a link

< Stat the link not the file itself if it is a link

< Stat the link not the file itself if it is a link

< Create the file if not there

< Open the file for reading

< Open the file for writing

< Open should fail if APR_FOPEN_CREATE and file exists.

< Delete the file after close

< Open the file for reading

< Open the file for writing

< Open the file for reading

< Open the file for writing

< Create the file if not there

< Open should fail if APR_FOPEN_CREATE and file exists.

< Open should fail if APR_FOPEN_CREATE and file exists.

< Create the file if not there

< Append to the end of the file

< Open the file and truncate to 0 length

< Platform dependent flag to enable * non blocking file io

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Open the file for buffered I/O

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Open the file for buffered I/O

< Open the file for writing

< Open the file for writing

< Open the file for reading

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

The problem with trying to output the entire iovec is that we cannot maintain the behaviour that a real writev would have. If we iterate over the iovec one at a time, we lose the atomic properties of writev(). The other option is to combine the entire iovec into one buffer that we could then send in one call to write(). This is not reasonable since we do not know how much data an iovec could contain.

The only reasonable option, that maintains the semantics of a real writev(), is to only write the first iovec. Callers of file_writev() must deal with partial writes as they normally would. If you want to ensure an entire iovec is written, use apr_file_writev_full().

< ->name in proper case

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Size of the file

< Size of the file

< dev and inode

< Number of links

< ->name in proper case

< Type

< Type

< ->name in proper case

< File is read-only

< File is hidden

< File is read-only

< File is read-only

< File is hidden

< File is hidden

< Open the file for reading

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

< Platform dependent flag to enable * non blocking file io

< Open the file for reading

< Open the file for writing

< Create the file if not there

< Open should fail if APR_FOPEN_CREATE and file exists.

< Open the file and truncate to 0 length

< Open the file and truncate to 0 length

< Open should fail if APR_FOPEN_CREATE and file exists.

< Create the file if not there

< Delete the file after close

< Open the file for reading

< Open the file for writing

< Platform dependent tag to open the file for use across multiple threads

< Append to the end of the file

< Open the file for buffered I/O

< Platform dependent flag to enable * sparse file support, see WARNING below

< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.

< Append to the end of the file

< Open the file for buffered I/O

< Open the file for writing

< Open the file for writing

< Open the file for reading

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Platform dependent tag to open the file for use across multiple threads

< Size of the file

< Platform dependent tag to open the file for use across multiple threads

< Size of the file

Definition at line 74 of file apr_atomic.c.

◆ APR_DECLARE() [2/2]

APR_DECLARE ( const char )

Return a printable representation of the pollset method.

Parameters
pollsetThe pollset to use

Return a printable representation of the default pollset method (APR_POLLSET_DEFAULT).

Return a printable representation of the pollcb method.

Parameters
pollcbThe pollcb to use

Return the name of the lockfile for the mutex, or NULL if the mutex doesn't use a lock file

Get the mechanism's name of the mutex, as it relates to the actual method used for the underlying apr_proc_mutex_t.

Parameters
mutexthe mutex to get the mechanism's name from.

Convert text data to base64, and return the results from a pool.

Parameters
pPool to allocate from.
srcThe original string.
slenThe length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL, use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet. If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding.
lenIf not NULL, outputs the length of the encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base64 errors).

Convert binary data to base64, and return the results from a pool.

Parameters
pPool to allocate from.
srcThe original buffer.
slenThe length of the original buffer.
flagsIf APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL, use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet. If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding.
lenIf not NULL, outputs the length of the encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base64_binary errors).

Convert base64 or base64url with or without padding to text data, and return the results from a pool.

Parameters
pPool to allocate from.
srcThe base64 string to decode.
slenThe length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, attempt to decode the full original buffer, and return NULL if any bad character is detected. If APR_ENCODE_RELAXED, decode until the first non base64/base64url character.
lenIf not NULL, outputs the length of the decoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the decoding is not possible (see apr_decode_base64_binary errors).

Convert text data to base32, and return the results from a pool.

Parameters
pPool to allocate from.
srcThe original string.
slenThe length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding.
lenIf not NULL, outputs the length of the encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base32 errors).

Convert binary data to base32, and return the results from a pool.

Parameters
pPool to allocate from.
srcThe original buffer.
slenThe length of the original buffer.
flagsIf APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding.
lenIf not NULL, outputs the length of the encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base32_binary errors).

Convert base32 or base32hex with or without padding to text data, and return the results from a pool.

Parameters
pPool to allocate from.
srcThe base32 string to decode.
slenThe length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding.
lenIf not NULL, outputs the length of the encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the decoding is not possible (see apr_decode_base32 errors).

Convert text data to base16 (hex), and return the results from a pool.

Parameters
pPool to allocate from.
srcThe original string.
slenThe length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, separate each token with a colon.
lenIf not NULL, outputs the length of the encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base16 errors).

Convert binary data to base16 (hex), and return the results from a pool.

Parameters
pPool to allocate from.
srcThe original buffer.
slenThe length of the original buffer.
flagsIf APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, separate each token with a colon.
lenIf not NULL, outputs the length of the encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base16_binary errors).

Convert base16 (hex) and return the results from a pool.

Parameters
pPool to allocate from.
srcThe base16 string to decode.
slenThe length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination.
flagsIf APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, allow tokens to be separated with a colon.
lenIf not NULL, outputs the length of the encoding (excluding the trailing NUL).
Returns
A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the decoding is not possible (see apr_decode_base16 errors).

Perform shell escaping on the provided string, returning the result from the pool.

Shell escaping causes characters to be prefixed with a '\' character.

If no characters were escaped, the original string is returned.

Parameters
pPool to allocate from
strThe original string
Returns
the encoded string, allocated from the pool, or the original string if no escaping took place or the string was NULL.

Unescapes a URL, leaving reserved characters intact, returning the result from a pool.

Parameters
pPool to allocate from
urlString to be unescaped in place
forbidOptional list of forbidden characters, in addition to 0x00
reservedOptional list of reserved characters that will be left unescaped
plusIf non zero, '+' is converted to ' ' as per application/x-www-form-urlencoded encoding
Returns
A string allocated from the pool on success, the original string if no characters are decoded, or NULL if a bad escape sequence is found or if a character on the forbid list is found, or if the original string was NULL.

Escape a path segment, as defined in RFC1808, returning the result from a pool.

Parameters
pPool to allocate from
strString to be escaped
Returns
A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL.

Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808, returning the result from a pool.

In all cases if a ':' occurs before the first '/' in the URL, the URL should be prefixed with "./" (or the ':' escaped). In the case of Unix, this means leaving '/' alone, but otherwise doing what escape_path_segment() does. For efficiency reasons, we don't use escape_path_segment(), which is provided for reference. Again, RFC 1808 is where this stuff is defined.

If partial is set, os_escape_path() assumes that the path will be appended to something with a '/' in it (and thus does not prefix "./").

Parameters
pPool to allocate from
strThe original string
partialIf non zero, suppresses the prepending of "./"
Returns
A string allocated from the pool on success, the original string if no characters are encoded or if the string was NULL.

Urlencode a string, as defined in http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1, returning the result from a pool.

Parameters
pPool to allocate from
strString to be escaped
Returns
A string allocated from the pool on success, the original string if no characters are encoded or if the string was NULL.

Apply entity encoding to a string, returning the result from a pool. Characters are replaced as follows: '<' becomes '&lt;', '>' becomes '&gt;', '&' becomes '&amp;', the double quote becomes '&quot;" and the single quote becomes '\&apos;'. @param p Pool to allocate from @param str The original string @param toasc If non zero, encode non ascii characters @return A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL. Decodes html entities or numeric character references in a string. If the string to be unescaped is syntactically incorrect, then the following fixups will be made: unknown entities will be left undecoded; references to unused numeric characters will be deleted. In particular, &#00; will not be decoded, but will be deleted. @param p Pool to allocate from @param str The original string @return A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL. Escape control characters in a string, as performed by the shell's 'echo' command, and return the results from a pool. Characters are replaced as follows: \\a alert (bell), \\b backspace, \\f form feed, \\n new line, \\r carriage return, \\t horizontal tab, \\v vertical tab, \\ backslash. Any non ascii character will be encoded as '\\xHH', where HH is the hex code of the character. If quote is not zero, the double quote character will also be escaped. @param p Pool to allocate from @param str The original string @param quote If non zero, encode double quotes @return A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL. Convert binary data to a hex encoding, and return the results from a pool. @param p Pool to allocate from @param src The original buffer @param slen The length of the original buffer @param colon If not zero, insert colon characters between hex digits. @return A zero padded buffer allocated from the pool on success, or NULL if src was NULL. Apply LDAP escaping to binary data, and return the results from a pool. Characters from RFC4514 and RFC4515 are escaped with their hex equivalents. @param p Pool to allocate from @param src The original buffer @param slen The length of the original buffer @param flags APR_ESCAPE_LDAP_DN for RFC4514, APR_ESCAPE_LDAP_FILTER for RFC4515, APR_ESCAPE_LDAP_ALL for both @return A zero padded buffer allocated from the pool on success, or NULL if src was NULL. Return the name of the lockfile for the mutex, or NULL if the mutex doesn't use a lock file Get the mechanism's name of the mutex, as it relates to the actual method used for the underlying apr_proc_mutex_t. @param mutex the mutex to get the mechanism's name from. Convert text data to base64, and return the results from a pool. @param p Pool to allocate from. @param src The original string. @param slen The length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination. @param flags If APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL, use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet. If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base64 errors). Convert binary data to base64, and return the results from a pool. @param p Pool to allocate from. @param src The original buffer. @param slen The length of the original buffer. @param flags If APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL, use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet. If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base64_binary errors). Convert base64 or base64url with or without padding to text data, and return the results from a pool. @param p Pool to allocate from. @param src The base64 string to decode. @param slen The length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination. @param flags If APR_ENCODE_NONE, attempt to decode the full original buffer, and return NULL if any bad character is detected. If APR_ENCODE_RELAXED, decode until the first non base64/base64url character. @param len If not NULL, outputs the length of the decoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the decoding is not possible (see apr_decode_base64_binary errors). Convert text data to base32, and return the results from a pool. @param p Pool to allocate from. @param src The original string. @param slen The length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination. @param flags If APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base32 errors). Convert binary data to base32, and return the results from a pool. @param p Pool to allocate from. @param src The original buffer. @param slen The length of the original buffer. @param flags If APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base32_binary errors). Convert base32 or base32hex with or without padding to text data, and return the results from a pool. @param p Pool to allocate from. @param src The base32 string to decode. @param slen The length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination. @param flags If APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the decoding is not possible (see apr_decode_base32 errors). Convert text data to base16 (hex), and return the results from a pool. @param p Pool to allocate from. @param src The original string. @param slen The length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination. @param flags If APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, separate each token with a colon. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base16 errors). Convert binary data to base16 (hex), and return the results from a pool. @param p Pool to allocate from. @param src The original buffer. @param slen The length of the original buffer. @param flags If APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, separate each token with a colon. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the encoding is not possible (see apr_encode_base16_binary errors). Convert base16 (hex) and return the results from a pool. @param p Pool to allocate from. @param src The base16 string to decode. @param slen The length of the original string, or APR_ENCODE_STRING if the actual length should be computed based on NUL termination. @param flags If APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If APR_ENCODE_COLON, allow tokens to be separated with a colon. @param len If not NULL, outputs the length of the encoding (excluding the trailing NUL). @return A NUL terminated string allocated from the pool on success, or NULL if src is NULL or allocation failed or the decoding is not possible (see apr_decode_base16 errors). Perform shell escaping on the provided string, returning the result from the pool. Shell escaping causes characters to be prefixed with a '\' character. If no characters were escaped, the original string is returned. @param p Pool to allocate from @param str The original string @return the encoded string, allocated from the pool, or the original string if no escaping took place or the string was NULL. Unescapes a URL, leaving reserved characters intact, returning the result from a pool. @param p Pool to allocate from @param url String to be unescaped in place @param forbid Optional list of forbidden characters, in addition to 0x00 @param reserved Optional list of reserved characters that will be left unescaped @param plus If non zero, '+' is converted to ' ' as per application/x-www-form-urlencoded encoding @return A string allocated from the pool on success, the original string if no characters are decoded, or NULL if a bad escape sequence is found or if a character on the forbid list is found, or if the original string was NULL. Escape a path segment, as defined in RFC1808, returning the result from a pool. @param p Pool to allocate from @param str String to be escaped @return A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL. Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808, returning the result from a pool. In all cases if a ':' occurs before the first '/' in the URL, the URL should be prefixed with "./" (or the ':' escaped). In the case of Unix, this means leaving '/' alone, but otherwise doing what escape_path_segment() does. For efficiency reasons, we don't use escape_path_segment(), which is provided for reference. Again, RFC 1808 is where this stuff is defined. If partial is set, os_escape_path() assumes that the path will be appended to something with a '/' in it (and thus does not prefix "./"). @param p Pool to allocate from @param str The original string @param partial If non zero, suppresses the prepending of "./" @return A string allocated from the pool on success, the original string if no characters are encoded or if the string was NULL. Urlencode a string, as defined in http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1, returning the result from a pool. @param p Pool to allocate from @param str String to be escaped @return A string allocated from the pool on success, the original string if no characters are encoded or if the string was NULL. Apply entity encoding to a string, returning the result from a pool. Characters are replaced as follows: '<' becomes '\&lt;', '>' becomes '\&gt;', '&' becomes '\&amp;', the double quote becomes '\&quot;" and the single quote becomes '&apos;'.

Parameters
pPool to allocate from
strThe original string
toascIf non zero, encode non ascii characters
Returns
A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL.

Decodes html entities or numeric character references in a string. If the string to be unescaped is syntactically incorrect, then the following fixups will be made: unknown entities will be left undecoded; references to unused numeric characters will be deleted. In particular, &#00; will not be decoded, but will be deleted.

Parameters
pPool to allocate from
strThe original string
Returns
A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL.

Escape control characters in a string, as performed by the shell's 'echo' command, and return the results from a pool. Characters are replaced as follows: \a alert (bell), \b backspace, \f form feed, \n new line, \r carriage return, \t horizontal tab, \v vertical tab, \ backslash.

Any non ascii character will be encoded as '\xHH', where HH is the hex code of the character.

If quote is not zero, the double quote character will also be escaped.

Parameters
pPool to allocate from
strThe original string
quoteIf non zero, encode double quotes
Returns
A string allocated from the pool on success, the original string if no characters are encoded or the string is NULL.

Convert binary data to a hex encoding, and return the results from a pool.

Parameters
pPool to allocate from
srcThe original buffer
slenThe length of the original buffer
colonIf not zero, insert colon characters between hex digits.
Returns
A zero padded buffer allocated from the pool on success, or NULL if src was NULL.

Apply LDAP escaping to binary data, and return the results from a pool. Characters from RFC4514 and RFC4515 are escaped with their hex equivalents.

Parameters
pPool to allocate from
srcThe original buffer
slenThe length of the original buffer
flagsAPR_ESCAPE_LDAP_DN for RFC4514, APR_ESCAPE_LDAP_FILTER for RFC4515, APR_ESCAPE_LDAP_ALL for both
Returns
A zero padded buffer allocated from the pool on success, or NULL if src was NULL.

Definition at line 128 of file dso.c.

Variable Documentation

◆ baton

Definition at line 423 of file apr_poll.h.

◆ descriptor

apr_pollfd_t * descriptor

Definition at line 230 of file apr_poll.h.

◆ descriptors

Definition at line 274 of file apr_poll.h.

◆ flags

Definition at line 157 of file apr_poll.h.

◆ func

Definition at line 422 of file apr_poll.h.

◆ method

Definition at line 195 of file apr_poll.h.

◆ nsds

Definition at line 301 of file apr_poll.h.

◆ num

Definition at line 273 of file apr_poll.h.

◆ numsock

apr_int32_t numsock

Definition at line 300 of file apr_poll.h.

◆ p

Definition at line 156 of file apr_poll.h.

◆ size

apr_uint32_t size

Definition at line 155 of file apr_poll.h.

◆ timeout

Definition at line 272 of file apr_poll.h.