diff options
author | Eric Wong <e@80x24.org> | 2020-10-27 07:54:53 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-11-07 10:22:16 +0000 |
commit | 5a1ee8a928382bc3fac9b8faff67b0c24396ff9b (patch) | |
tree | 3c71a8052f18b12d2785e64265aa5a6005aa73c9 /lib | |
parent | 7ce1a0d97294c5603cf8c6cf89cab491cc5840d3 (diff) | |
download | public-inbox-5a1ee8a928382bc3fac9b8faff67b0c24396ff9b.tar.gz |
Seeing "Xorg.foo.bar" can be confusing in warnings if the eidx_key is only "org.foo.bar" with no relation to "Xorg" at all. Furthermore, printing "\0" to log or terminal output isn't very nice and could throw off some users/tools.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/SearchIdxShard.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/SearchIdxShard.pm b/lib/PublicInbox/SearchIdxShard.pm index 644d8b58..e194b7e0 100644 --- a/lib/PublicInbox/SearchIdxShard.pm +++ b/lib/PublicInbox/SearchIdxShard.pm @@ -87,8 +87,9 @@ sub shard_worker_loop ($$$$$) { } else { chomp $line; my $eidx_key; - if ($line =~ s/\AX(.+)\0//) { + if ($line =~ s/\AX=(.+)\0//) { $eidx_key = $1; + $v2w->{current_info} =~ s/\0/\\0/; } # n.b. $mid may contain spaces(!) my ($len, $bytes, $num, $oid, $ds, $ts, $tid, $mid) @@ -114,7 +115,7 @@ sub index_raw { my ($self, $msgref, $eml, $smsg, $ibx) = @_; if (my $w = $self->{w}) { if ($ibx) { - print $w 'X', $ibx->eidx_key, "\0" or die + print $w 'X=', $ibx->eidx_key, "\0" or die "failed to write shard: $!\n"; } $msgref //= \($eml->as_string); |