Top |
SSL support functionsSSL support functions — Functions to send and receive encrypted data over a socket. |
gboolean
gnome_vfs_ssl_enabled (void
);
Checks whether gnome-vfs was compiled with SSL support.
GnomeVFSResult gnome_vfs_ssl_create (GnomeVFSSSL **handle_return
,const char *host
,unsigned int port
,GnomeVFSCancellation *cancellation
);
Creates an SSL socket connection at handle_return
to host
using
port port
.
handle_return |
pointer to a GnomeVFSSSL struct, which will contain an allocated GnomeVFSSSL object on return. |
|
host |
string indicating the hostname to establish an SSL connection with. |
|
port |
port number to connect to. |
|
cancellation |
handle allowing cancellation of the operation. |
GnomeVFSResult gnome_vfs_ssl_create_from_fd (GnomeVFSSSL **handle_return
,gint fd
,GnomeVFSCancellation *cancellation
);
Try to establish an SSL connection over the file descriptor fd
.
handle_return |
pointer to a GnomeVFSSSL struct, which will contain an allocated GnomeVFSSSL object on return. |
|
fd |
file descriptior to try and establish an SSL connection over. |
|
cancellation |
handle allowing cancellation of the operation. |
GnomeVFSResult gnome_vfs_ssl_read (GnomeVFSSSL *ssl
,gpointer buffer
,GnomeVFSFileSize bytes
,GnomeVFSFileSize *bytes_read
,GnomeVFSCancellation *cancellation
);
Read bytes
bytes of data from the SSL socket ssl
into buffer
.
ssl |
SSL socket to read data from. |
|
buffer |
allocated buffer of at least |
|
bytes |
number of bytes to read from |
|
bytes_read |
pointer to a GnomeVFSFileSize, will contain
the number of bytes actually read from the socket |
|
cancellation |
handle allowing cancellation of the operation. |
GnomeVFSResult gnome_vfs_ssl_write (GnomeVFSSSL *ssl
,gconstpointer buffer
,GnomeVFSFileSize bytes
,GnomeVFSFileSize *bytes_written
,GnomeVFSCancellation *cancellation
);
Write bytes
bytes of data from buffer
to ssl
.
ssl |
SSL socket to write data to. |
|
buffer |
data to write to the socket. |
|
bytes |
number of bytes to write from |
|
bytes_written |
pointer to a GnomeVFSFileSize, will contain the number of bytes actually written to the socket on return. |
|
cancellation |
handle allowing cancellation of the operation. |
void gnome_vfs_ssl_destroy (GnomeVFSSSL *ssl
,GnomeVFSCancellation *cancellation
);
Free resources used by ssl
and close the connection.
GnomeVFSSocket *
gnome_vfs_ssl_to_socket (GnomeVFSSSL *ssl
);
Wrap an SSL socket inside a standard GnomeVFSSocket.
GnomeVFSResult gnome_vfs_ssl_set_timeout (GnomeVFSSSL *ssl
,GTimeVal *timeout
,GnomeVFSCancellation *cancellation
);
Set a timeout of timeout
. If timeout
is NULL
following operations
will block indefinitely).
Note if you set timeout
to 0 (means tv_sec and tv_usec are both 0)
every following operation will return immediately. (This can be used
for polling.)
ssl |
SSL socket to set the timeout of. |
|
timeout |
the timeout. |
|
cancellation |
optional cancellation object. |
Since: 2.8