]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fixes
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 11 Apr 2004 18:46:27 +0000 (18:46 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 11 Apr 2004 18:46:27 +0000 (18:46 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@549 e03df62e-2008-0410-955e-edbf42e46eb7

src/InspIRCd.layout
src/connection.cpp
src/inspircd.cpp

index 286195869b4c1cce0b746b2dcbab32da1717e213..36d142425a43fe71f5df19aca9d66aba62565ccb 100644 (file)
@@ -1,5 +1,5 @@
 [Editors]
-Focused=1
+Focused=24
 Order=1,2,-1,4,6,3,7,25,5,24
 
 [Editor_0]
@@ -12,10 +12,10 @@ LeftChar=1
 
 [Editor_1]
 Open=1
-Top=1
-CursorCol=13
-CursorRow=6933
-TopLine=6881
+Top=0
+CursorCol=24
+CursorRow=6946
+TopLine=6898
 LeftChar=1
 
 [Editor_2]
@@ -109,9 +109,9 @@ LeftChar=1
 [Editor_13]
 Open=1
 Top=0
-CursorCol=6
-CursorRow=30
-TopLine=20
+CursorCol=18
+CursorRow=16
+TopLine=1
 LeftChar=1
 
 [Editor_14]
@@ -174,8 +174,8 @@ LeftChar=1
 Open=1
 Top=0
 CursorCol=1
-CursorRow=68
-TopLine=13
+CursorRow=63
+TopLine=14
 LeftChar=1
 
 [Editor_22]
@@ -196,10 +196,10 @@ LeftChar=1
 
 [Editor_24]
 Open=1
-Top=0
-CursorCol=3
-CursorRow=320
-TopLine=271
+Top=1
+CursorCol=1
+CursorRow=194
+TopLine=1
 LeftChar=1
 [Editor_25]
 Open=1
index a7f7ed0a1d3606934bcd90f1572f8e87b77150ca..7393d7d77f2208149a8cc20eefb3409bdb0e67e4 100644 (file)
@@ -136,77 +136,10 @@ bool connection::SendPacket(char *message, char* host, int port, long ourkey)
                log(DEBUG,"sendto() failed for Connection::SendPacket() with a packet of size %d: %s",sizeof(p),strerror(errno));
                return false;
        }
-       this->state = STATE_WAIT_FOR_ACK;
 
-
-       // host_address remains unchanged. we only want to receive from where we just sent the packet to.
-       
-       // retry the packet up to 5 times
-       for (int retries = 0; retries < 5; retries++)
-       {
-               socklen_t host_address_size;
-               host_address.sin_family=AF_INET;
-               host_address_size=sizeof(host_address);
-       
-               // wait for ack, or timeout.
-               // if reached a timeout, send again.
-               // the packet id in the ack must match that in the original packet
-               // this MUST operate in lock/step fashion!!!
-               int cycles = 0;
-               packet p2;
-               do 
-               {
-                       fd_set sfd;
-                       timeval tval;
-                       tval.tv_usec = 100;
-                       tval.tv_sec = 0;
-                       FD_ZERO(&sfd);
-                       FD_SET(fd,&sfd);
-                       int res = select(65535, &sfd, NULL, NULL, &tval);
-                       cycles++;
-               }
-               while ((recvfrom(fd,&p2,sizeof(p2),0,(sockaddr*)&host_address,&host_address_size)<0) && (cycles < 10));
-               
-               if (cycles >= 10)
-               {
-                       log(DEFAULT,"ERROR! connection::SendPacket() waited >10000 nanosecs for an ACK. Will resend up to 5 times");
-               }
-               else
-               {
-                       if (p2.type != PT_ACK_ONLY)
-                       {
-                               packet_buf pb;
-                               pb.p.id = p.id;
-                               pb.p.key = p.key;
-                               pb.p.type = p.type;
-                               strcpy(pb.p.data,p.data);
-                               strcpy(pb.host,inet_ntoa(host_address.sin_addr));
-                               pb.port = ntohs(host_address.sin_port);
-                               this->buffer.push_back(pb);
-                               
-                               log(DEFAULT,"ERROR! connection::SendPacket() received a data response and was expecting an ACK!!!");
-                               this->state = STATE_CLEAR;
-                               return true;
-                       }
-
-                       if (p2.id != p.id)
-                       {
-                               log(DEFAULT,"ERROR! connection::SendPacket() received an ack for a packet it didnt send!");
-                               this->state = STATE_CLEAR;
-                               return false;
-                       }
-                       else
-                       {
-                               log(DEFAULT,"Successfully received ACK");
-                               this->state = STATE_CLEAR;
-                               return true;
-                               break;
-                       }
-               }
-       }
-       log(DEFAULT,"We never received an ack. Something fishy going on, host is dead.");
        this->state = STATE_CLEAR;
-       return false;
+       return true;
+       break;
 
 }
 
@@ -308,18 +241,6 @@ bool connection::RecvPacket(char *message, char* host, int &prt, long &theirkey)
        //int recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen);
        if (recvfrom(fd,&p,sizeof(p),0,(sockaddr*)&host_address,&host_address_size)<0)
        {
-               if (buffer.size()>0)
-               {
-                       log(DEBUG,"Fetching a buffered packet size %d",buffer.size());
-                       strcpy(message,buffer[0].p.data);
-                       theirkey = buffer[0].p.key;
-                       strcpy(host,buffer[0].host);
-                       prt = buffer[0].port;
-                       
-                       buffer.erase(buffer.begin());
-                       
-                       return true;
-               }
                return false;
        }
 
@@ -350,27 +271,6 @@ bool connection::RecvPacket(char *message, char* host, int &prt, long &theirkey)
                theirkey = p.key;
                prt = ntohs(host_address.sin_port); // the port we received it on
                SendACK(host,prt,p.id);
-
-               if (buffer.size()>0)
-               {
-                       log(DEBUG,"Fetching a buffered packet size %d",buffer.size());
-                       packet_buf pb;
-                       pb.p.id = p.id;
-                       pb.p.key = p.key;
-                       pb.p.type = p.type;
-                       strcpy(pb.p.data,p.data);
-                       strcpy(pb.host,inet_ntoa(host_address.sin_addr));
-                       pb.port = ntohs(host_address.sin_port);
-                       this->buffer.push_back(pb);
-
-                       strcpy(message,buffer[0].p.data);
-                       theirkey = buffer[0].p.key;
-                       strcpy(host,buffer[0].host);
-                       prt = buffer[0].port;
-                       
-                       buffer.erase(buffer.begin());
-               }
-
                return true;
        }
 
index 1adaac5808cbd0751084d0bcc23f3cd8fbf4c03d..79f2d58c450e7b915c5692174b13e4af81cefe88 100644 (file)
@@ -6502,14 +6502,6 @@ void process_restricted_commands(char token,char* params,serverrec* source,serve
                case 'F':
                        WriteOpers("Server %s has completed netburst. (%d secs)",source->name,time(NULL)-nb_start);
                        handle_F(token,params,source,reply,udp_host,udp_port);
-
-                       WriteOpers("Sending my burst now.");
-                       nb_start = time(NULL);
-                       //if (!source->initiator)
-                       //{
-                       //      DoSync(reply,udp_host,udp_port,MyKey);
-                       //}
-                       WriteOpers("Completed burst to %s (%d secs)",source->name,time(NULL)-nb_start);
                break;
                // anything else
                default: