<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/5772" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2003-10-07T14:05:27-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/5772</id>

		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-10-07T14:05:27-04:00</updated>

		<published>2003-10-07T14:05:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28122#p28122</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28122#p28122"/>
		<title type="html"><![CDATA[killdcc not working?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28122#p28122"><![CDATA[
<blockquote class="uncited"><div>[snip]<br>Now while it isn't the same idx that just lost connection, I still suspect this is where the bug is (as you probably suspect as well).<br><br>Even though you shouldn't have to, as a work around, I'd suggest invoking a utimer to kill the client index..</div></blockquote>Yeah, I suspected something like that too. It appears that in a procedure called by the closing of an idx, another idx cannot be killed.<br><br>Indeed I also tried using an [utimer 0] and that works fine. But will make me wonder what the hell I was doing when seeing the code again in a year or so <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Thanks for the suggestions.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Tue Oct 07, 2003 2:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-10-07T13:31:51-04:00</updated>

		<published>2003-10-07T13:31:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28119#p28119</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28119#p28119"/>
		<title type="html"><![CDATA[killdcc not working?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28119#p28119"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div><blockquote class="uncited"><div>Thus the question is: why is it not possible to issue a "killdcc" at that point?</div></blockquote>  You answered this yourself....<br><blockquote class="uncited"><div>Remember the (odd) way eggdrop sends connection terminations as an empty string to the procs. <br>If a client sends an empty string it is simply not send to the procedures. </div></blockquote>In this situation where 'killdcc' is called, it is inside a check for the empty string, thus indicating that the connection was already lost, so how can you kill a lost connection?</div></blockquote>The connection that got lost was the connection between the eggdrop and the webserver. The connection to be killed is between eggdrop and the client. This connection still exists.<br><br>What the script does is: client connects to eggdrop, eggdrop connects to webserver, webserver sends info, webserver closes connection with eggdrop and then eggdrop should close the connection with the client.</div></blockquote>Ahh I see...my bad..<br><br>From the tcl-commands.doc:<blockquote class="uncited"><div>Description: removes an idx from the party line and sends all future input to the Tcl command given. The command will be called with two parameters: the idx and the input text. The command should return 0 to indicate success and 1 to indicate that it relinquishes control of the user back to the bot. If the input text is blank (""), it indicates that the connection has been dropped. <strong class="text-strong">Also, if the input text is blank, never call killdcc on it, as it will fail with "invalid idx"</strong>.</div></blockquote>Now while it isn't the same idx that just lost connection, I still suspect this is where the bug is (as you probably suspect as well).<br><br>Even though you shouldn't have to, as a work around, I'd suggest invoking a utimer to kill the client index..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Tue Oct 07, 2003 1:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-10-07T03:13:31-04:00</updated>

		<published>2003-10-07T03:13:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28081#p28081</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28081#p28081"/>
		<title type="html"><![CDATA[killdcc not working?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28081#p28081"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>Thus the question is: why is it not possible to issue a "killdcc" at that point?</div></blockquote>  You answered this yourself....<br><blockquote class="uncited"><div>Remember the (odd) way eggdrop sends connection terminations as an empty string to the procs. <br>If a client sends an empty string it is simply not send to the procedures. </div></blockquote>In this situation where 'killdcc' is called, it is inside a check for the empty string, thus indicating that the connection was already lost, so how can you kill a lost connection?</div></blockquote>The connection that got lost was the connection between the eggdrop and the webserver. The connection to be killed is between eggdrop and the client. This connection still exists.<br><br>What the script does is: client connects to eggdrop, eggdrop connects to webserver, webserver sends info, webserver closes connection with eggdrop and then eggdrop should close the connection with the client.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Tue Oct 07, 2003 3:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-10-06T18:54:12-04:00</updated>

		<published>2003-10-06T18:54:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28052#p28052</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28052#p28052"/>
		<title type="html"><![CDATA[killdcc not working?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28052#p28052"><![CDATA[
<blockquote class="uncited"><div>Thus the question is: why is it not possible to issue a "killdcc" at that point?</div></blockquote>  You answered this yourself....<br><blockquote class="uncited"><div>Remember the (odd) way eggdrop sends connection terminations as an empty string to the procs. <br>If a client sends an empty string it is simply not send to the procedures. </div></blockquote>In this situation where 'killdcc' is called, it is inside a check for the empty string, thus indicating that the connection was already lost, so how can you kill a lost connection?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Mon Oct 06, 2003 6:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-10-06T07:44:35-04:00</updated>

		<published>2003-10-06T07:44:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28019#p28019</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28019#p28019"/>
		<title type="html"><![CDATA[killdcc not working?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28019#p28019"><![CDATA[
<blockquote class="uncited"><div>My advice would be to do some debugging, and find out what is activate when.<br><br>You perform this in forward:server:status.<br><br>Each time it is called, putlog the incoming text. At the same time, perform a search for the IDX of the client from the output of dcclist (off the top of my head, however, there is a command).<br><br>You need to find out when and why it dies.</div></blockquote>Actually, that has been done and what happens is as follows:<br><br>(in the following, "#" represents the respective idx numbers)<br><br>1. We connect with a telnet client to port 35000<br>2. It reports: Client connection on IDX: #<br>3. Control for the client is handed over to the proc forward:client:ignore (which is fine and no problem)<br>4. A connection is made to the webserver at <a href="http://www.egghelp.org" class="postlink">www.egghelp.org</a><br>5. It reports: Client (#) connected to server (#)<br>6. Control for the client is handed over to the proc forward:server:status (which is fine and no problem)<br>7. The webserver sends the contents of the webpage to eggdrop which in turn sends it to the client (which is exactly what we want)<br>8. After sending the webpage, the webserver closes the connection (as expected) and we see "Server (#) closed connection." followed by "Killing Client (#)" (also as expected).<br>9. At this point we want to close the client connection too. Therefore a "killdcc" on the idx of the clientidx is issued. And it is this killdcc that fails. Note that the idx exists in the [dcclist] and the connection between eggdrop and the client is still open.<br><br>It thus appears that "killdcc" cannot be issued at any place in the code. Which is odd, because the client idx definitely exists and the client is connected.<br><br>Thus the question is: why is it not possible to issue a "killdcc" at that point?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Mon Oct 06, 2003 7:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-10-06T07:27:37-04:00</updated>

		<published>2003-10-06T07:27:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28018#p28018</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28018#p28018"/>
		<title type="html"><![CDATA[killdcc not working?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28018#p28018"><![CDATA[
My advice would be to do some debugging, and find out what is activate when.<br><br>You perform this in forward:server:status.<br><br>Each time it is called, putlog the incoming text. At the same time, perform a search for the IDX of the client from the output of dcclist (off the top of my head, however, there is a command).<br><br>You need to find out when and why it dies.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Oct 06, 2003 7:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-10-06T07:04:25-04:00</updated>

		<published>2003-10-06T07:04:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28017#p28017</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28017#p28017"/>
		<title type="html"><![CDATA[killdcc not working?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28017#p28017"><![CDATA[
<blockquote class="uncited"><div>proc forward:client:ignore { clientidx text } { <br>   putlog "CLIENT ($clientidx): $text" <br>   if { $text == "" } { return 1 } <br>   return 0 <br>}<br><br>Havn't tested, but wouldn't this kill the connection when the client sends the double \n for end of headers?</div></blockquote>Actually that part returns control to eggdrop in case the client terminates the connection.<br>Remember the (odd) way eggdrop sends connection terminations as an empty string to the procs.<br>If a client sends an empty string it is simply not send to the procedures.<br><br>In any case, for the problem at hand it is not an issue because the connection between eggdrop and the client does not get terminated.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Mon Oct 06, 2003 7:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-10-06T06:02:14-04:00</updated>

		<published>2003-10-06T06:02:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28016#p28016</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28016#p28016"/>
		<title type="html"><![CDATA[killdcc not working?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28016#p28016"><![CDATA[
proc forward:client:ignore { clientidx text } { <br>   putlog "CLIENT ($clientidx): $text" <br>   if { $text == "" } { return 1 } <br>   return 0 <br>}<br><br>Havn't tested, but wouldn't this kill the connection when the client sends the double \n for end of headers?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Oct 06, 2003 6:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-10-06T04:42:01-04:00</updated>

		<published>2003-10-06T04:42:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28013#p28013</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28013#p28013"/>
		<title type="html"><![CDATA[killdcc not working?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28013#p28013"><![CDATA[
It appears killdcc not always functions as one might expext it to work.<br><br>To illustrate the problem a code snippet is provided at the bottom. <br><br>What it does is:<br>- setup a listen port<br>- when a telnet client connects it will send out a request to a webserver and the idx of the client is stored in a variable<br>- the webserver will provide data which is forwarded to the client<br>- when the webserver terminates the connection, the connection with the client should be terminated through a killdcc<br><br>It is this last step that fails with an "Tcl error [forward:server:status]: invalid idx"<br><br>For some reason the idx is not recognised as a valid idx, eventhough a connection with the client exists under that idx.<br><br>Performing a manual ".tcl killdcc clientidx" on the partyline terminates the client connection, however.<br><br>Anyone any idea?<br><div class="codebox"><p>Code: </p><pre><code>#---------------------------------------------------------------------# set up listen port#---------------------------------------------------------------------listen 35000 script forward:onconnect#---------------------------------------------------------------------# When a client connects, make an outgoing connection to the server.#---------------------------------------------------------------------proc forward:onconnect { clientidx } {   global forwardidx   putlog "Client connection on IDX: $clientidx"   set forwardidx $clientidx   control $clientidx forward:client:ignore   # connect to website and submit request   set hostname "www.egghelp.org"   set servidx [connect $hostname 80]   control $servidx forward:server:status   putdcc $servidx "GET / HTTP/0.9"   putdcc $servidx ""   putlog "Client ($clientidx) connected to server ($servidx)"   return 0}#---------------------------------------------------------------------# ignore client text#---------------------------------------------------------------------proc forward:client:ignore { clientidx text } {   putlog "CLIENT ($clientidx): $text"   if { $text == "" } { return 1 }   return 0}#---------------------------------------------------------------------# forward all data from server to client# If the server closed the connection, close connection with client.#---------------------------------------------------------------------proc forward:server:status { servidx text } {   global forwardidx   set clientidx $forwardidx   # Server closed connection?    if { $text == "" } {       putlog "Server ($servidx) closed connection."      # The server closed the connection and now we want to close      # the connection with the client.      putlog "Killing Client ($clientidx)"      # Here it fails! :(      # Would assme that killdcc takes one argument (i.e. the idx)      # and simply kills the connection.      # But instead we get:      # Tcl error [forward:server:status]: invalid idx      killdcc $clientidx      return 1   }   putdcc $clientidx "$text\r"   return  0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Mon Oct 06, 2003 4:42 am</p><hr />
]]></content>
	</entry>
	</feed>
