Artifact Content
Not logged in

Artifact e3d3a3ce3ffabb76a7cc2e3782e7749540e57496

Ticket change [e3d3a3ce3f] - Fixed ticket c62fac40af: Edit CSS/HTML in Setup adds extra CR/LF, wrong http Content-length plus 1 other change by drh on 2008-11-20 00:36:37.

D 2008-11-20T00:36:37
J comment While\sediting\sCSS\sand\sHTML\sin\sFossil\sSetup,\sextra\sCR/LF\spairs\sare\sadded\sto\sthe\stext\sbox\sand\sthe\scalculation\sof\sthe\shttp\sContent-length\sheader\sis\swrong\s(as\sif\sthose\sextra\sCR/LF\spairs\sweren't\sadded),\sso\ssome\scontent\sis\sdropped\sat\sthe\send\sof\sthe\swebpage.\sI'm\snot\ssure\swhat's\sthe\scause,\sit\smight\sbe\san\sapache-CGI\sproblem.\r\n\r\nEnvironment:\sRunning\sFossil\sversion\s[b3ee50c946]\s2008-07-15\s19:03:42\son\sWindows\sas\sCGI\shandler\sunder\sApache/2.2.6\s(Win32),\sServer\sbuilt:\sSep\s5\s2007\s08:58:56.\r\n\r\nObserved\swith\sFirefox\sand\sIE7\son\sWindows.\r\n\r\nThe\slocal\sfossil\sserver\shttp://127.0.0.1:8080/setup_editcss\sworks\sas\sexpected.\r\n\r\nI'm\snot\ssure\sthis\sis\srelated,\sbut\sfor\smany\sfossil\sgenerated\spages,\sthe\sapache\shttpd\serror\slog\sshows\slines\slike:\r\n\r\n[Tue\sSep\s02\s14:32:09\s2008]\s[error]\s[client\smy.ip.add.ress]\s,\sreferer:\shttp://sub.domain.tld/fossil/sqlite/setup_editcss\r\n\r\nbut\sthe\saccess\slog\sseems\sok:\r\n\r\nmy.ip.add.ress\s-\s-\s[02/Sep/2008:14:32:09\s+0200]\s"GET\s/fossil/sqlite/setup_editcss\sHTTP/1.1"\s200\s8802\r\n\r\nI\swould\slike\sto\stry\swith\sthe\smore\srecent\sFossil\sversion\s[4b56350ecb]\s2008-07-24\s15:08:13,\sbut\sit\sisn't\savailable\sfor\sdownload\sas\sa\sprebuild\sWin32\sbinary,\sand\sI\sdon't\shave\sa\sbuild\sinfrastructure\shere.\n\n<hr><i>anonymous\sadded\son\s2008-11-17\s22:04:21:</i><br>\nIt's\snot\sjust\sthe\sedit\sCSS\sin\ssetup\sthat\sshows\sit,\sother\spages\ssuffer\sas\swell,\se.g.\sTimeline.\sIt\sis\seasily\sdetected\sby\struncation\sof\sthe\sfossil\sstandard\sfooter.\r\n\r\nI\sdo\shave\sa\sbuild\sinfrastructure\snow\s(MSYS/MingW\son\sWindows),\sand\sI\sdid\sresearch\ssome\ssources,\sbut\sI\scan't\spoint\sat\sthe\sexact\serror.\n\n<hr><i>drh\sadded\son\s2008-11-18\s02:28:09:</i><br>\nThe\sfix\sin\scheck-in\s[f6a071cef1]\sworks\sfor\sme\son\sWinXP\srunning\sunder\sVMWare.\n\n<hr><i>anonymous\sadded\son\s2008-11-19\s23:52:05:</i><br>\nThanks\sfor\sthe\sfix,\sdrh.\s\r\n\r\n\s\s*\s\sBad\snews:\sI'm\safraid\sit\sdidn't\sreally\sfix\sit.\sThe\scontents\sof\sthe\sEditCSS\stextbox\sstill\shave\sextra\s\\r\s,\sso\sline\sspacing\sincreases\sby\sone\safter\severy\sedit.\r\n\r\n\s\s*\s\sGood\snews:\sstdout\scan\sbe\smade\sbinary\swith\ssetmode(),\swhich\sprevents\sthe\s\\n\sto\s\\r\\n\stranslation.\r\n\r\n<verbatim>\r\nPatches\sfor\smain.c:\r\n\r\n{line\s30,\sin\sheader\sincludes}\r\n=\s#include\s<time.h>\r\n+\s#ifdef\s__MINGW32__\r\n+\s/*\sDefine\sfile\smode\sconstants\s*/\r\n+\s#include\s<fcntl.h>\r\n+\s#endif\r\n\r\n{line\s615,\sin\scmd_cgi()\s}\r\n=\s\sg.httpOut\s=\sstdout;\r\n+\s#ifdef\s__MINGW32__\r\n+\s\s\s/*\sprevent\s\\n\sto\s\\r\s\\n\stranslation\son\sWindows\s*/\r\n+\s\s\ssetmode(\s_fileno(g.httpOut),\s_O_BINARY\s);\r\n+\s#endif\r\n\r\nThe\sworkaround\sin\scgi.c,\sfunction\scgi_reply()\s,\sis\sno\slonger\snecessary;\sthe\scontent-length\sheader\sis\svalid.\r\n</verbatim>\r\n\r\nFull\sdiffs\swill\sbe\sposted\son\sthe\sfossil-users\smailing\slist.\r\n\r\nEnvironment:\sWindows\sVista,\sApache\shttpd\s2.2.9,\smod_cgi,\sfossil\s[63886daad8]\s2008-11-18\s15:33:25\sUTC
J status Fixed
K c62fac40af0860d28ad287cb3f203581e00fc9c8
U drh
Z 0fb8d25ce4a6ed6d9b9317be7e60ff16