mirror of
https://github.com/clearml/dropbear
synced 2025-04-19 13:45:04 +00:00
Just put the version string on the queue, don't use atomicio
This commit is contained in:
parent
286fa93a8d
commit
a2f70a3751
@ -33,7 +33,6 @@
|
|||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "kex.h"
|
#include "kex.h"
|
||||||
#include "channel.h"
|
#include "channel.h"
|
||||||
#include "atomicio.h"
|
|
||||||
#include "runopts.h"
|
#include "runopts.h"
|
||||||
|
|
||||||
static void checktimeouts();
|
static void checktimeouts();
|
||||||
@ -50,8 +49,6 @@ int sessinitdone = 0; /* GLOBAL */
|
|||||||
/* this is set when we get SIGINT or SIGTERM, the handler is in main.c */
|
/* this is set when we get SIGINT or SIGTERM, the handler is in main.c */
|
||||||
int exitflag = 0; /* GLOBAL */
|
int exitflag = 0; /* GLOBAL */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* called only at the start of a session, set up initial state */
|
/* called only at the start of a session, set up initial state */
|
||||||
void common_session_init(int sock_in, int sock_out) {
|
void common_session_init(int sock_in, int sock_out) {
|
||||||
|
|
||||||
@ -257,13 +254,12 @@ void session_cleanup() {
|
|||||||
TRACE(("leave session_cleanup"))
|
TRACE(("leave session_cleanup"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void send_session_identification() {
|
void send_session_identification() {
|
||||||
/* write our version string, this blocks */
|
buffer *writebuf = buf_new(strlen(LOCAL_IDENT "\r\n") + 1);
|
||||||
if (atomicio(write, ses.sock_out, LOCAL_IDENT "\r\n",
|
buf_putbytes(writebuf, LOCAL_IDENT "\r\n", strlen(LOCAL_IDENT "\r\n"));
|
||||||
strlen(LOCAL_IDENT "\r\n")) == DROPBEAR_FAILURE) {
|
buf_putbyte(writebuf, 0x0); // packet type
|
||||||
ses.remoteclosed();
|
buf_setpos(writebuf, 0);
|
||||||
}
|
enqueue(&ses.writequeue, writebuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void read_session_identification() {
|
static void read_session_identification() {
|
||||||
|
@ -48,7 +48,7 @@ void process_packet() {
|
|||||||
TRACE2(("enter process_packet"))
|
TRACE2(("enter process_packet"))
|
||||||
|
|
||||||
type = buf_getbyte(ses.payload);
|
type = buf_getbyte(ses.payload);
|
||||||
TRACE(("process_packet: packet type = %d", type))
|
TRACE(("process_packet: packet type = %d, len %d", type, ses.payload->len))
|
||||||
|
|
||||||
ses.lastpacket = type;
|
ses.lastpacket = type;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user