This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Long lines get truncated with puthelp

Old posts that have not been replied to for several years.
Locked
c
cleese

Long lines get truncated with puthelp

Post by cleese »

Having a bit of a problem with my eggdrop. When I use puthelp or putquick in my tcl-scripts, it seems the lines get truncated after appx 450 chars. Any way around this?
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Re: Long lines get truncated with puthelp

Post by egghead »

nvm. wrong answer :)
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Eggdrop truncates long lines because servers place restrictions on line length. Unless you have some modified ircd that allows longer lines anyway. There is probably a way around it... use putdccraw with idx 0 for the server.

set blah "this is a really long line\n"
putdccraw 0 [string length $blah] $blah

I think it'll work :)
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

stdragon wrote:Eggdrop truncates long lines because servers place restrictions on line length. Unless you have some modified ircd that allows longer lines anyway. There is probably a way around it... use putdccraw with idx 0 for the server.

set blah "this is a really long line\n"
putdccraw 0 [string length $blah] $blah

I think it'll work :)
Using putdccraw doesn't work either. I thought it was a matter of editing tclserv.c but I purged the previous posting since it is more than that. :( It seems that the actual writing to the socket also has a max length.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

I'm not sure how you tested it, but putdccraw does not impose any length restriction on the content. Neither does tputs, the network output function it uses.

Here's how you can test it:

Using tclsh, do this
% proc blah {args} {puts "blah: $args"}
% socket -server blah 1234

Then in eggdrop, do
.tcl connect localhost 1234
Tcl: 7
.tcl set blah [string repeat "horse" 1000]\n
Tcl: horsehorsehorsehorsehorsehorsehorse...
.tcl putdccraw 7 [string length $blah] $blah
Tcl:

Then back in tclsh, do
% update
blah: sock4 127.0.0.1 42027 (<-- it prints this out)
% set test [gets sock4]
horsehorsehorsehorse....
% string length $test
5000
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

If putdccraw is failing too, then it's not a eggdrop issue.

The IRC server you are connected too, must impose a length restriction lower than the RFC implmentation of 510 chracters.
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

ppslim wrote:If putdccraw is failing too, then it's not a eggdrop issue.

The IRC server you are connected too, must impose a length restriction lower than the RFC implmentation of 510 chracters.
Yes, what I observed was an IRC server limitation and not a limitation of putdccraw which indeed seems to work fine. My mistake :oops: I was a bit tricked by putlog which does not seem to display the full string :(

Code: Select all

bind pub m !maxmsg maxmsg

proc maxmsg { nick uhost hand chan text } {

   for { set count 10 } { $count <= 600 } { incr count 10 } {
      append string [format %10s $count]
   }

   regsub -all -- { } $string {*} string

   putlog "LENGTH STRING: [string length $string]"

   set string "PRIVMSG $chan :$string\n"

   set slength [string length $string]

   putlog "LENGTH STRING: $slength"

   putdccraw 0 $slength $string

   putlog $string

}
Locked