May 9th, 2002

ljcom

Module Name: ljcom
Committed By: bradfitz
Date: Thu May 9 08:06:24 UTC 2002

Modified Files:
---------------
ljcom/bin: dumpsql.pl
ljcom/bin/upgrading: base-data-local.sql

Log Message:
------------
new dumpsql.pl addition that handles redistributing s1 styles sanely finally


To generate a diff of this commit:
cvs rdiff -r1.9 -r1.10 ljcom/bin/dumpsql.pl
http://cvs.livejournal.org/browse.cgi/ljcom/bin/dumpsql.pl.diff?r1=1.9&r2=1.10
cvs rdiff -r1.1 -r1.2 ljcom/bin/upgrading/base-data-local.sql
http://cvs.livejournal.org/browse.cgi/ljcom/bin/upgrading/base-data-local.sql.diff?r1=1.1&r2=1.2

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 08:08:47 UTC 2002

Modified Files:
---------------
livejournal/bin/upgrading: base-data.sql update-db.pl
Added Files:
------------
livejournal/bin/upgrading: s1style-rw.pl s1styles.dat

Log Message:
------------
base-data.sql: no more style data

s1styles.dat: it's now here

s1style-rw.pl: this library reads/writes s1styles.dat (ljcom:bin/dumpsql.pl uses it also)

update-db.pl: now uses s1style-rw.pl lib to read S1 styles in --populate mode


To generate a diff of this commit:
cvs rdiff -r1.12 -r1.13 livejournal/bin/upgrading/base-data.sql
http://cvs.livejournal.org/browse.cgi/livejournal/bin/upgrading/base-data.sql.diff?r1=1.12&r2=1.13
cvs rdiff -r0 -r1.1 livejournal/bin/upgrading/s1style-rw.pl \
livejournal/bin/upgrading/s1styles.dat
http://cvs.livejournal.org/browse.cgi/livejournal/bin/upgrading/s1style-rw.pl.diff?r1=0&r2=1.1
http://cvs.livejournal.org/browse.cgi/livejournal/bin/upgrading/s1styles.dat.diff?r1=0&r2=1.1
cvs rdiff -r1.14 -r1.15 livejournal/bin/upgrading/update-db.pl
http://cvs.livejournal.org/browse.cgi/livejournal/bin/upgrading/update-db.pl.diff?r1=1.14&r2=1.15

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 08:17:43 UTC 2002

Modified Files:
---------------
livejournal/bin/upgrading: base-data.sql s1styles.dat

Log Message:
------------
I ran the new dumpsql.pl on livejournal.com's database.
This brings the CVS data files up-to-date cleanly for the first time.
Now we can do this all the time.


To generate a diff of this commit:
cvs rdiff -r1.13 -r1.14 livejournal/bin/upgrading/base-data.sql
http://cvs.livejournal.org/browse.cgi/livejournal/bin/upgrading/base-data.sql.diff?r1=1.13&r2=1.14
cvs rdiff -r1.1 -r1.2 livejournal/bin/upgrading/s1styles.dat
http://cvs.livejournal.org/browse.cgi/livejournal/bin/upgrading/s1styles.dat.diff?r1=1.1&r2=1.2

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 08:24:41 UTC 2002

Modified Files:
---------------
livejournal/bin/upgrading: s1style-rw.pl

Log Message:
------------
DB might contain DOS line endings in styles. but let's not write
them back to disk. (later we can fix the problem of them getting
into the database at all, thought it really doesn't matter much there)


To generate a diff of this commit:
cvs rdiff -r1.2 -r1.3 livejournal/bin/upgrading/s1style-rw.pl
http://cvs.livejournal.org/browse.cgi/livejournal/bin/upgrading/s1style-rw.pl.diff?r1=1.2&r2=1.3

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 08:31:14 UTC 2002

Modified Files:
---------------
livejournal/bin/upgrading: update-db.pl

Log Message:
------------
new config option: $LJ::DONT_TOUCH_STYLES

so update-db.pl won't modify site's styles with CVS copy.

useful for livejournal.com ... style monkeys might've modified styles
in-between dumpsql.pl snapshots, and I don't want to be accidentally
reverting their work when I update-db.pl ---populate to get new
*proplist data onto the site from my development machine


To generate a diff of this commit:
cvs rdiff -r1.15 -r1.16 livejournal/bin/upgrading/update-db.pl
http://cvs.livejournal.org/browse.cgi/livejournal/bin/upgrading/update-db.pl.diff?r1=1.15&r2=1.16

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 18:23:42 UTC 2002

Modified Files:
---------------
livejournal/cgi-bin: bml_client.pl bmlp.pl
livejournal/cgi-bin/Apache: BML.pm

Log Message:
------------
BML cookie change: BML automatically changes %COOKIE, so caller
doesn't need to.

also, added in BML::set_cookie() wrapper to internal
BMLClient::set_cooke(), and so now BML::set_cookie() can be used
everywhere, as BMLClient is deprecated.


To generate a diff of this commit:
cvs rdiff -r1.5 -r1.6 livejournal/cgi-bin/bml_client.pl
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/bml_client.pl.diff?r1=1.5&r2=1.6
cvs rdiff -r1.26 -r1.27 livejournal/cgi-bin/bmlp.pl
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/bmlp.pl.diff?r1=1.26&r2=1.27
cvs rdiff -r1.9 -r1.10 livejournal/cgi-bin/Apache/BML.pm
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/Apache/BML.pm.diff?r1=1.9&r2=1.10

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 19:07:18 UTC 2002

Modified Files:
---------------
livejournal/cgi-bin: bmlp.pl
livejournal/cgi-bin/Apache: BML.pm

Log Message:
------------
new BML function: BML::decide_langage()

let's BML client code re-run the language decision logic, in case
it changed something (like the cookies). without this, all the client
code could do is fall-back to something like the DefaultLanguage, ignoring
the Accept-Language entirely.

this also cleans up both BML processor's handler loop, since all the logic
is moved.

and since it's in a sub, and we can just return when we know the answer,
it's also cleaner logic, and perhaps even faster, but that wasn't a goal.


To generate a diff of this commit:
cvs rdiff -r1.27 -r1.28 livejournal/cgi-bin/bmlp.pl
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/bmlp.pl.diff?r1=1.27&r2=1.28
cvs rdiff -r1.10 -r1.11 livejournal/cgi-bin/Apache/BML.pm
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/Apache/BML.pm.diff?r1=1.10&r2=1.11

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 19:20:02 UTC 2002

Modified Files:
---------------
livejournal/bin/upgrading: base-data.sql
livejournal/htdocs: login.bml logout.bml setlang.bml

Log Message:
------------
This was the 5 minute project I wanted to do yesterday morning, but
got distracted cleaning up everything ugly I saw in our infrastructure
along the way.

Anyway, what this does:

- new userprop 'browselang' which contains the language code you like
to browse the site in, as opposed to what language you tend to write
in, which will probably come later, for directory searches.

- setlang.bml sets that userprop if you're logged in

- login.bml re-sets your lanugage upon login, based on your userprop.
also, login sets new userprop 'permlogin' so a future setlang change
can know the expiration date of the new cookie to send.

- logout.bml clears login cookies, langpref, and permlogin, then re-decides
which language to use.

Next step: modify dystopia scheme to link to setlang.bml in graphic-friendly
way. (some American/British Flag, and some elippsisses and speech bubble?)


To generate a diff of this commit:
cvs rdiff -r1.14 -r1.15 livejournal/bin/upgrading/base-data.sql
http://cvs.livejournal.org/browse.cgi/livejournal/bin/upgrading/base-data.sql.diff?r1=1.14&r2=1.15
cvs rdiff -r1.6 -r1.7 livejournal/htdocs/login.bml \
livejournal/htdocs/setlang.bml
http://cvs.livejournal.org/browse.cgi/livejournal/htdocs/login.bml.diff?r1=1.6&r2=1.7
http://cvs.livejournal.org/browse.cgi/livejournal/htdocs/setlang.bml.diff?r1=1.6&r2=1.7
cvs rdiff -r1.5 -r1.6 livejournal/htdocs/logout.bml
http://cvs.livejournal.org/browse.cgi/livejournal/htdocs/logout.bml.diff?r1=1.5&r2=1.6

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 19:32:56 UTC 2002

Modified Files:
---------------
livejournal/cgi-bin: ljviews.pl

Log Message:
------------
signe: ljviews had a check that prevented &filter from being properly propogated to %%skiplinks%% when the filter value was 0.

Not a lot of people probably use filter=0, but I know I do. I keep a default view, I keep a collection of groups that I use for other views, but I also like to view everything instead of group-by-group.

http://www.cothlamadh.net/~signe/code/ljviews.pl.147.diff

Just changed two lines from "if ($filter)" to "if (defined $filter)"


To generate a diff of this commit:
cvs rdiff -r1.46 -r1.47 livejournal/cgi-bin/ljviews.pl
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/ljviews.pl.diff?r1=1.46&r2=1.47

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 20:00:14 UTC 2002

Modified Files:
---------------
livejournal/cgi-bin: bmlp.pl

Log Message:
------------
I broke ?uselang= in the last commit. (thanks, mart)

Also: be aware that this entire file will shortly be deleted, so
don't get too distraught that I'm continuing to update it, even
as much as it sucks. (globals all over the place, etc.)
I just need to keep it alive and consistent with the mod_perl BML
behavior untli we make the switch shortly here.


To generate a diff of this commit:
cvs rdiff -r1.28 -r1.29 livejournal/cgi-bin/bmlp.pl
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/bmlp.pl.diff?r1=1.28&r2=1.29

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 21:40:40 UTC 2002

Modified Files:
---------------
livejournal/cgi-bin: console.pl ljprotocol.pl

Log Message:
------------
fix warnings... masking earlier decls in same scope


To generate a diff of this commit:
cvs rdiff -r1.22 -r1.23 livejournal/cgi-bin/console.pl
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/console.pl.diff?r1=1.22&r2=1.23
cvs rdiff -r1.94 -r1.95 livejournal/cgi-bin/ljprotocol.pl
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/ljprotocol.pl.diff?r1=1.94&r2=1.95

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 22:38:24 UTC 2002

Modified Files:
---------------
livejournal/cgi-bin: modperl.pl
livejournal/cgi-bin/Apache: LiveJournal.pm

Log Message:
------------
add mod_perl /interface/* and /cgi-bin/log.cgi support


To generate a diff of this commit:
cvs rdiff -r1.1 -r1.2 livejournal/cgi-bin/modperl.pl
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/modperl.pl.diff?r1=1.1&r2=1.2
cvs rdiff -r1.6 -r1.7 livejournal/cgi-bin/Apache/LiveJournal.pm
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/Apache/LiveJournal.pm.diff?r1=1.6&r2=1.7

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 22:39:33 UTC 2002

Modified Files:
---------------
livejournal/cgi-bin/Apache: BML.pm

Log Message:
------------
load the BML config file earlier, before Apache forks, so loaded modules
from VarInitScript are shared in memory across all children.

requires httpd.conf change:

# BML support
PerlSetEnv BMLConfig $LJHOME/cgi-bin/bmlp.cfg
PerlModule Apache::BML
[Files ~ "\.bml$"]
SetHandler perl-script
PerlHandler Apache::BML
[/Files]


To generate a diff of this commit:
cvs rdiff -r1.11 -r1.12 livejournal/cgi-bin/Apache/BML.pm
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/Apache/BML.pm.diff?r1=1.11&r2=1.12

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Thu May 9 23:25:40 UTC 2002

Modified Files:
---------------
livejournal/bin/upgrading: update-db.pl

Log Message:
------------
give user note on next step, since it's new, and people don't like
reading docs, and this isn't documented yet anyway. ;)


To generate a diff of this commit:
cvs rdiff -r1.16 -r1.17 livejournal/bin/upgrading/update-db.pl
http://cvs.livejournal.org/browse.cgi/livejournal/bin/upgrading/update-db.pl.diff?r1=1.16&r2=1.17

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Fri May 10 00:09:48 UTC 2002

Modified Files:
---------------
livejournal/htdocs/friends: graph.bml

Log Message:
------------
with mod_perl BML now we can use PATH_INFO in BML! hooray.

so now we generate the graphviz dot files here, not in some ugly
404 handler.


To generate a diff of this commit:
cvs rdiff -r1.2 -r1.3 livejournal/htdocs/friends/graph.bml
http://cvs.livejournal.org/browse.cgi/livejournal/htdocs/friends/graph.bml.diff?r1=1.2&r2=1.3

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Fri May 10 00:10:11 UTC 2002

Modified Files:
---------------
livejournal/cgi-bin/Apache: LiveJournal.pm

Log Message:
------------
do the resource redirection. no more 404notfound.cgi necessary now.


To generate a diff of this commit:
cvs rdiff -r1.8 -r1.9 livejournal/cgi-bin/Apache/LiveJournal.pm
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/Apache/LiveJournal.pm.diff?r1=1.8&r2=1.9

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Fri May 10 00:18:27 UTC 2002

Modified Files:
---------------
livejournal/doc: INSTALL.apache.txt INSTALL.txt

Log Message:
------------
change install documentation to remove all mention of fastcgi and replace
with mod_perl instructions (which are tons easier)

opi, be sure to update your manual.


To generate a diff of this commit:
cvs rdiff -r1.8 -r1.9 livejournal/doc/INSTALL.apache.txt
http://cvs.livejournal.org/browse.cgi/livejournal/doc/INSTALL.apache.txt.diff?r1=1.8&r2=1.9
cvs rdiff -r1.14 -r1.15 livejournal/doc/INSTALL.txt
http://cvs.livejournal.org/browse.cgi/livejournal/doc/INSTALL.txt.diff?r1=1.14&r2=1.15

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Fri May 10 03:12:31 UTC 2002

Modified Files:
---------------
livejournal/cgi-bin/Apache: LiveJournal.pm

Log Message:
------------
* /confirm/ URL redirection

* minor speedup by declining *.bml URIs in trans handler immediately


To generate a diff of this commit:
cvs rdiff -r1.9 -r1.10 livejournal/cgi-bin/Apache/LiveJournal.pm
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/Apache/LiveJournal.pm.diff?r1=1.9&r2=1.10

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Fri May 10 03:46:44 UTC 2002

Removed Files:
-------------
livejournal/htdocs: datacache

Log Message:
------------
this was just an experiment at the time. we decided it was lame
or something, since we're not using it.


To generate a diff of this commit:
cvs rdiff -r1.2 -r0 livejournal/htdocs/datacache
http://cvs.livejournal.org/browse.cgi/livejournal/htdocs/datacache.diff?r1=1.2&r2=0

livejournal

Module Name: livejournal
Committed By: bradfitz
Date: Fri May 10 06:27:19 UTC 2002

Modified Files:
---------------
livejournal/cgi-bin: bmlp.cfg

Log Message:
------------
forgot to update this the other day.
needs absolute paths for mod_perl BML, which doesn't necessarily
run in cgi-bin dir


To generate a diff of this commit:
cvs rdiff -r1.4 -r1.5 livejournal/cgi-bin/bmlp.cfg
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/bmlp.cfg.diff?r1=1.4&r2=1.5

ljcom: performance, part 1

Module Name: ljcom
Committed By: bradfitz
Date: Fri May 10 06:30:54 UTC 2002

Modified Files:
---------------
ljcom/cgi-bin: lj-bml-local.pl
ljcom/cgi-bin/bml/scheme/dystopia: generic.look

Log Message:
------------
speed tweaks:

- don't use/run LOAD_PAGE_DATA, since dystopia doesn't need it

- replace one code blocks with a static string we define in lj-bml-local.pl

- mark many code blocks to-be-cached

- remove S flag from a number of blocks that weren't really static.
only worked before because BML did an extra pass. mod_perl BML is fixed.


To generate a diff of this commit:
cvs rdiff -r1.5 -r1.6 ljcom/cgi-bin/lj-bml-local.pl
http://cvs.livejournal.org/browse.cgi/ljcom/cgi-bin/lj-bml-local.pl.diff?r1=1.5&r2=1.6
cvs rdiff -r1.22 -r1.23 ljcom/cgi-bin/bml/scheme/dystopia/generic.look
http://cvs.livejournal.org/browse.cgi/ljcom/cgi-bin/bml/scheme/dystopia/generic.look.diff?r1=1.22&r2=1.23

livejournal: performance, part 2

Module Name: livejournal
Committed By: bradfitz
Date: Fri May 10 06:35:48 UTC 2002

Modified Files:
---------------
livejournal/cgi-bin: bmlp.pl lj-bml-init.pl
livejournal/cgi-bin/Apache: BML.pm
livejournal/htdocs: talkread.bml update.bml

Log Message:
------------
speed tweaks:

- mod_perl BML now does its recursion/expansion differently, which
is both correct and faster. we were doing extra work before.

- mod_perl BML can now cache common code blocks, to avoid re-evaling them.
keyed by md5 of code.

- talkread.bml & update.bml code blocks now have cache comment flag
in them, since those are most popular pages.

- new BML api: BML::noparse($ret) which returns $ret untouched,
and also signals to parent _CODE block not to try to BML-expand
the contents, for extra speed. in common spots (like the template),
this helps.

Altogether, along with the last patch, BML pages load 30%-100% quicker.

Profiling and debugging under mod_perl is wonderfully easy.

I <3 mod_perl.


To generate a diff of this commit:
cvs rdiff -r1.29 -r1.30 livejournal/cgi-bin/bmlp.pl
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/bmlp.pl.diff?r1=1.29&r2=1.30
cvs rdiff -r1.22 -r1.23 livejournal/cgi-bin/lj-bml-init.pl
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/lj-bml-init.pl.diff?r1=1.22&r2=1.23
cvs rdiff -r1.13 -r1.14 livejournal/cgi-bin/Apache/BML.pm
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/Apache/BML.pm.diff?r1=1.13&r2=1.14
cvs rdiff -r1.69 -r1.70 livejournal/htdocs/talkread.bml
http://cvs.livejournal.org/browse.cgi/livejournal/htdocs/talkread.bml.diff?r1=1.69&r2=1.70
cvs rdiff -r1.22 -r1.23 livejournal/htdocs/update.bml
http://cvs.livejournal.org/browse.cgi/livejournal/htdocs/update.bml.diff?r1=1.22&r2=1.23