mirror of
https://github.com/drk1wi/portspoof.git
synced 2024-06-16 11:58:57 +00:00
Revert "Update connection.cpp"
This commit is contained in:
parent
a3b9c49621
commit
33bdd4ffe0
@ -38,7 +38,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/sockios.h>
|
||||
#include <time.h>
|
||||
#include "Threads.h"
|
||||
#include "connection.h"
|
||||
@ -128,24 +127,15 @@ void* process_connection(void *arg)
|
||||
|
||||
select_return = select(threads[tid].clients[i], &read_mask, (fd_set *)0, (fd_set *)0, &tv);
|
||||
|
||||
if (select_return < 0) /* [timeout=0, -1= ERROR] is returned */
|
||||
{
|
||||
n = -1;
|
||||
}
|
||||
else {
|
||||
n = 0;
|
||||
int data_to_be_read_size = 0;
|
||||
|
||||
if (ioctl(threads[tid].clients[i], FIONREAD, &data_to_be_read_size) < 0) {
|
||||
perror("ioctl failed");
|
||||
}
|
||||
|
||||
if (data_to_be_read_size > 0) {
|
||||
buffer_size = data_to_be_read_size;
|
||||
n = recv(threads[tid].clients[i], buffer, buffer_size, 0);
|
||||
}
|
||||
|
||||
}
|
||||
if(select_return <= 0) /* [timeout=0, -1= ERROR] is returned */
|
||||
{
|
||||
n=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer_size=configuration->mapPort2Buffer(original_port);
|
||||
n = recv(threads[tid].clients[i],buffer,buffer_size, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// deal with different recv buffer size
|
||||
@ -316,4 +306,4 @@ void* process_connection(void *arg)
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user