Re: string cut at 78 characters?

Razvan Cosma <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
 Hello,
I have pasted incorrectly, sorry. The script is actually

$ENV{TDSDUMP}="/var/log/emp/tdsdump.log";
while (<STDIN>) {
 $orig .= $_;
 $count++; last if ($count>100 || /\w{70,}/);
 if (/(Precedence: bulk|X-Auto-Response-Suppress)/i) {$msg =
"out-of-the-office";}
 elsif (/Final-Recipient: rfc822;/i) {$msg = "undeliverable";}
# ... other parsing of the body
}
chomp($orig);$orig=~s/\r//g;$orig=~s/\n/\t/g; #print STDERR $orig;
my $dbserver='dbs'; my $user='dbu'; my $passwd='dbp';
my $db1 = DBI->connect("dbi:Sybase:server=$dbserver;database=dbd;",
$user, $passwd, { syb_err_handler => \&err_handler }) || exit 0;
$st1 = $db1->prepare("insert into bounces (recipientid, documentid,
bouncecode, bouncesubject, bounceheaders) values (?,?,?,?,?)") || exit
0;
$st1->execute($recid, $docid, $msg, $subj, $orig) || exit 0;

the fields are RecipientId nvarchar(250), DocumentId int, BounceCode
nvarchar(250), BounceSubject nvarchar(250), BounceHeaders
nvarchar(2500)
(I changed the bounceheaders length to various values to see if it
changes anything - it doesn't)

and in tdsdump.log:
ct.c:844:ct_send() command_type = 160
ct.c:4239:paraminfoalloc: status = 0, maxlen 0
ct.c:4240:paraminfoalloc: name = , varint size 2 column_type 47 size
56, 56 column_cur_size 56 column_output = 0
ct.c:4079:paramrowalloc, size = 56, data = 0x821eb60, row_size = 0
ct.c:4239:paraminfoalloc: status = 0, maxlen 0
ct.c:4240:paraminfoalloc: name = , varint size 2 column_type 47 size
0, 0 column_cur_size 0 column_output = 0
ct.c:4079:paramrowalloc, size = 0, data = 0x8207c60, row_size = 0
ct.c:4094:paramrowalloc(): setting parameter #1 to NULL
ct.c:4239:paraminfoalloc: status = 0, maxlen 0
ct.c:4240:paraminfoalloc: name = , varint size 2 column_type 47 size
0, 0 column_cur_size 0 column_output = 0
ct.c:4079:paramrowalloc, size = 0, data = 0x8207cb0, row_size = 0
ct.c:4094:paramrowalloc(): setting parameter #2 to NULL
ct.c:4239:paraminfoalloc: status = 0, maxlen 0
ct.c:4240:paraminfoalloc: name = , varint size 2 column_type 47 size
72, 72 column_cur_size 72 column_output = 0
ct.c:4079:paramrowalloc, size = 72, data = 0x821eba0, row_size = 0
ct.c:4239:paraminfoalloc: status = 0, maxlen 0
ct.c:4240:paraminfoalloc: name = , varint size 2 column_type 47 size
3022, 3022 column_cur_size 3022 column_output = 0
ct.c:4079:paramrowalloc, size = 3022, data = 0x8233510, row_size = 0
query.c:1631:tds_submit_execute()
mem.c:563:tds_free_all_results()
util.c:162:Changed query state from IDLE to QUERYING
query.c:1326:tds_put_data_info putting status
query.c:1420:tds_put_data: colsize = 56
query.c:1449:tds_put_data: not null param varint_size = 2
query.c:1326:tds_put_data_info putting status
query.c:1420:tds_put_data: colsize = -1
query.c:1423:tds_put_data: null param
query.c:1326:tds_put_data_info putting status
query.c:1420:tds_put_data: colsize = -1
query.c:1423:tds_put_data: null param
query.c:1326:tds_put_data_info putting status
query.c:1420:tds_put_data: colsize = 72
query.c:1449:tds_put_data: not null param varint_size = 2
query.c:1326:tds_put_data_info putting status
query.c:1420:tds_put_data: colsize = 3022
query.c:1449:tds_put_data: not null param varint_size = 2
util.c:162:Changed query state from QUERYING to PENDING
net.c:779:Sending packet
^^^ here I can see the packet, which includes all the text up to the
first base64 attachment (last if /\w{70,}/) as expected.

ct.c:215:setting command state from READY to SENT
ct.c:1100:ct_results()
token.c:495:tds_process_tokens(0x81df6a8, 0xbfa08cb8, 0xbfa08cb4, 0x6914)
util.c:162:Changed query state from PENDING to READING
net.c:592:Received header
0000 04 01 00 1f 00 3c 01 00-                        |.....<..|

net.c:671:Received packet
0000 ff 11 00 c3 00 01 00 00-00 79 00 00 00 00 fe 00 |........ .y......|
0010 00 e0 00 00 00 00 00   -                        |.......|

token.c:510:processing result tokens.  marker is  ff(DONEINPROC)
token.c:2201:tds_process_end: more_results = 1
                was_cancelled = 0
                error = 0
                done_count_valid = 1
token.c:2232:                rows_affected = 1
util.c:162:Changed query state from READING to PENDING
ct.c:1157:ct_results() process_result_tokens returned 1 (type 4054)
token.c:495:tds_process_tokens(0x81df6a8, 0xbfa08cb8, 0xbfa08cb4, 0x6914)
util.c:162:Changed query state from PENDING to READING
token.c:510:processing result tokens.  marker is  79(RETURNSTATUS)
token.c:510:processing result tokens.  marker is  fe(DONEPROC)
token.c:2201:tds_process_end: more_results = 0
                was_cancelled = 0
                error = 0
                done_count_valid = 0
token.c:2217:tds_process_end() state set to TDS_IDLE
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.