Fix build warings in the server code.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@215 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
родитель
974a160fd3
Коммит
8c60d864c7
@ -30,12 +30,12 @@ extern "C" {
|
|||||||
|
|
||||||
typedef struct ssh_bind_struct SSH_BIND;
|
typedef struct ssh_bind_struct SSH_BIND;
|
||||||
|
|
||||||
SSH_BIND *ssh_bind_new();
|
SSH_BIND *ssh_bind_new(void);
|
||||||
void ssh_bind_set_options(SSH_BIND *ssh_bind, SSH_OPTIONS *options);
|
void ssh_bind_set_options(SSH_BIND *ssh_bind, SSH_OPTIONS *options);
|
||||||
int ssh_bind_listen(SSH_BIND *ssh_bind);
|
int ssh_bind_listen(SSH_BIND *ssh_bind);
|
||||||
void ssh_bind_set_blocking(SSH_BIND *ssh_bind,int blocking);
|
void ssh_bind_set_blocking(SSH_BIND *ssh_bind,int blocking);
|
||||||
int ssh_bind_get_fd(SSH_BIND *ssh_bind);
|
int ssh_bind_get_fd(SSH_BIND *ssh_bind);
|
||||||
int ssh_bind_set_toaccept(SSH_BIND *ssh_bind);
|
void ssh_bind_fd_toaccept(SSH_BIND *ssh_bind);
|
||||||
SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind);
|
SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind);
|
||||||
void ssh_bind_free(SSH_BIND *ssh_bind);
|
void ssh_bind_free(SSH_BIND *ssh_bind);
|
||||||
int ssh_accept(SSH_SESSION *session);
|
int ssh_accept(SSH_SESSION *session);
|
||||||
|
@ -81,7 +81,7 @@ static socket_t bind_socket(SSH_BIND *ssh_bind,char *hostname, int port) {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
SSH_BIND *ssh_bind_new(){
|
SSH_BIND *ssh_bind_new(void){
|
||||||
SSH_BIND *ptr=malloc(sizeof(SSH_BIND));
|
SSH_BIND *ptr=malloc(sizeof(SSH_BIND));
|
||||||
memset(ptr,0,sizeof(*ptr));
|
memset(ptr,0,sizeof(*ptr));
|
||||||
ptr->bindfd=-1;
|
ptr->bindfd=-1;
|
||||||
@ -129,6 +129,8 @@ void ssh_bind_fd_toaccept(SSH_BIND *ssh_bind){
|
|||||||
SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind){
|
SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind){
|
||||||
SSH_SESSION *session;
|
SSH_SESSION *session;
|
||||||
PRIVATE_KEY *dsa=NULL, *rsa=NULL;
|
PRIVATE_KEY *dsa=NULL, *rsa=NULL;
|
||||||
|
int fd = -1;
|
||||||
|
|
||||||
if(ssh_bind->bindfd<0){
|
if(ssh_bind->bindfd<0){
|
||||||
ssh_set_error(ssh_bind,SSH_FATAL,"Can't accept new clients on a "
|
ssh_set_error(ssh_bind,SSH_FATAL,"Can't accept new clients on a "
|
||||||
"not bound socket.");
|
"not bound socket.");
|
||||||
@ -153,7 +155,7 @@ SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind){
|
|||||||
}
|
}
|
||||||
ssh_say(2,"RSA private key read successfuly\n");
|
ssh_say(2,"RSA private key read successfuly\n");
|
||||||
}
|
}
|
||||||
int fd=accept(ssh_bind->bindfd,NULL,NULL);
|
fd = accept(ssh_bind->bindfd, NULL, NULL);
|
||||||
if(fd<0){
|
if(fd<0){
|
||||||
ssh_set_error(ssh_bind,SSH_FATAL,"Accepting a new connection: %s",
|
ssh_set_error(ssh_bind,SSH_FATAL,"Accepting a new connection: %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
@ -186,7 +188,7 @@ void ssh_bind_free(SSH_BIND *ssh_bind){
|
|||||||
|
|
||||||
extern char *supported_methods[];
|
extern char *supported_methods[];
|
||||||
|
|
||||||
int server_set_kex(SSH_SESSION * session) {
|
static int server_set_kex(SSH_SESSION * session) {
|
||||||
KEX *server = &session->server_kex;
|
KEX *server = &session->server_kex;
|
||||||
SSH_OPTIONS *options = session->options;
|
SSH_OPTIONS *options = session->options;
|
||||||
int i;
|
int i;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user