[Ante-cvs] SF.net SVN: ante: [495] trunk/ant
Brought to you by:
roguestar191
|
From: <rog...@us...> - 2008-04-01 00:13:29
|
Revision: 495
http://ante.svn.sourceforge.net/ante/?rev=495&view=rev
Author: roguestar191
Date: 2008-03-31 17:13:32 -0700 (Mon, 31 Mar 2008)
Log Message:
-----------
changed nread to ssize_t and removed nread = -1
Modified Paths:
--------------
trunk/ant/socket.cpp
trunk/ant/socket.h
Modified: trunk/ant/socket.cpp
===================================================================
--- trunk/ant/socket.cpp 2008-04-01 00:04:49 UTC (rev 494)
+++ trunk/ant/socket.cpp 2008-04-01 00:13:32 UTC (rev 495)
@@ -584,6 +584,7 @@
//set up our packet to return:
pls *Packet = new pls();
+ ssize_t nread = 0;
timeout.tv_sec = 0;
timeout.tv_usec = 250000;
//2 second timeout before sending the telnet welcome message
@@ -743,10 +744,11 @@
try {
nread = read(fd, buf, bufs-1);
} catch(std::string in) {
- nread = -1;
+// nread = -1;
+ goto endread;
}
if(nread == 0) { // {{{
- char *buf2 = new char[2];// = (char *)malloc(bufs);
+ char *buf2 = new char[2];// = (char *)malloc(bufs);
memset(buf, 0, bufs);
memset(buf2, 0, 2);
// {{{ if someone disconnects
@@ -887,6 +889,7 @@
Packet->packets.push_back(foundsome);// }}}
if((*(iter)).idletime!=0)(*(iter)).idletime=0;
}
+ endread:
memset(buf, 0, bufs);
delete[] buf;
if(!justSet){
Modified: trunk/ant/socket.h
===================================================================
--- trunk/ant/socket.h 2008-04-01 00:04:49 UTC (rev 494)
+++ trunk/ant/socket.h 2008-04-01 00:13:32 UTC (rev 495)
@@ -78,7 +78,6 @@
fd_set tempset;
struct timeval timeout2;
int length;
- int nread;
int fd;
int maxfd;
int nfound;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|