There is a configure time warning, though.
* New features:
+** Flow control for data objects.
+ Currently, gpgme_data_t objects are assumed to be blocking. To
+ break this assumption, we need either (A) a way for an user I/O
+ callback to store the current operation in a continuation that can
+ be resumed later. While the continuation exists, file descriptors
+ associated with this operation must be removed from their
+ respective event loop. or (B) a way for gpgme data objects to be
+ associated with a waitable object, that can be registered with the
+ user event loop. Neither is particularly simple.
** Extended notation support. When gpg supports arbitrary binary
notation data, provide a user interface for that.
** notification system
data, which is used by @acronym{GPGME} to exchange data with the user.
@end deftp
+@code{gpgme_data_t} objects do not provide notifications on events.
+It is assumed that read and write operations are blocking until data
+is available. If this is undesirable, the application must ensure
+that all GPGME data operations always have data available, for example
+by using memory buffers or files rather than pipes or sockets. This
+might be relevant, for example, if the external event loop mechanism
+is used.
+
@menu
* Creating Data Buffers:: Creating new data buffers.
* Destroying Data Buffers:: Releasing data buffers.
a bit more from the file descriptor than is actually needed by the
crypto engine in the desired operation because of internal buffering.
+Note that GPGME assumes that the file descriptor is set to blocking
+mode. Errors during I/O operations, except for EINTR, are usually
+fatal for crypto operations.
+
The function returns the error code @code{GPG_ERR_NO_ERROR} if the
data object was successfully created, and @code{GPG_ERR_ENOMEM} if not
enough memory is available.
a bit more from the stream than is actually needed by the crypto
engine in the desired operation because of internal buffering.
+Note that GPGME assumes that the stream is in blocking mode. Errors
+during I/O operations, except for EINTR, are usually fatal for crypto
+operations.
+
The function returns the error code @code{GPG_ERR_NO_ERROR} if the
data object was successfully created, and @code{GPG_ERR_ENOMEM} if not
enough memory is available.
current read position into the space starting at @var{buffer}. The
@var{handle} is provided by the user at data object creation time.
+Note that GPGME assumes that the read blocks until data is available.
+Errors during I/O operations, except for EINTR, are usually fatal for
+crypto operations.
+
The function should return the number of bytes read, 0 on EOF, and -1
on error. If an error occurs, @var{errno} should be set to describe
the type of the error.
current write position from the space starting at @var{buffer}. The
@var{handle} is provided by the user at data object creation time.
+Note that GPGME assumes that the write blocks until data is available.
+Errors during I/O operations, except for EINTR, are usually fatal for
+crypto operations.
+
The function should return the number of bytes written, and -1 on
error. If an error occurs, @var{errno} should be set to describe the
type of the error.
errno = ENOSYS;
return TRACE_SYSRES (-1);
}
- res = (*dh->cbs->read) (dh, buffer, size);
+ do
+ res = (*dh->cbs->read) (dh, buffer, size);
+ while (res < 0 && errno == EINTR);
+
return TRACE_SYSRES (res);
}
errno = ENOSYS;
return TRACE_SYSRES (-1);
}
- res = (*dh->cbs->write) (dh, buffer, size);
+ do
+ res = (*dh->cbs->write) (dh, buffer, size);
+ while (res < 0 && errno == EINTR);
+
return TRACE_SYSRES (res);
}