fix: io_set_ssl NULL in client_disconnect, SSL* type safety in protocol.h
This commit is contained in:
@@ -15,8 +15,8 @@ void io_set_fds(int read_fd, int write_fd) {
|
||||
io_write_fd = write_fd;
|
||||
}
|
||||
|
||||
void io_set_ssl(void *ssl) {
|
||||
io_ssl = (SSL *)ssl;
|
||||
void io_set_ssl(SSL *ssl) {
|
||||
io_ssl = ssl;
|
||||
}
|
||||
|
||||
static int io_fd(int dir_fd, int file_descriptor) {
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
typedef struct ssl_st SSL;
|
||||
|
||||
typedef int Status;
|
||||
enum NET_STATUS { STATUS_OK, STATUS_ERROR, STATUS_FINISHED, STATUS_NEXT, STATUS_CHUNK, STATUS_MANIFEST };
|
||||
|
||||
void io_set_fds(int read_fd, int write_fd);
|
||||
void io_set_ssl(void *ssl);
|
||||
void io_set_ssl(SSL *ssl);
|
||||
bool send_n_data(int file_descriptor, void *data, size_t data_size);
|
||||
bool receive_n_data(int file_descriptor, void *data, size_t data_size);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "transport_tcp.h"
|
||||
#include "log.h"
|
||||
#include "protocol.h"
|
||||
#include <arpa/inet.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include <signal.h>
|
||||
@@ -152,6 +153,7 @@ void client_disconnect(Client *client) {
|
||||
SSL_shutdown(client->ssl);
|
||||
SSL_free(client->ssl);
|
||||
client->ssl = NULL;
|
||||
io_set_ssl(NULL);
|
||||
}
|
||||
close(client->file_descriptor);
|
||||
if (client->ssh_child_pid > 0) {
|
||||
|
||||
Reference in New Issue
Block a user