Hex Artifact Content
Not logged in

Artifact 5eec8953fc0adc08cfa0cedd0910360c591615f3:

File src/shun.c part of check-in [7a2c37063a] - merge trunk into creole branch by bob on 2009-09-22 07:49:39. Also file src/shun.c part of check-in [50ab5c33e7] - Layout changes to the "shun" control page. by drh on 2009-08-26 20:24:58.

0000: 2f 2a 0a 2a 2a 20 43 6f 70 79 72 69 67 68 74 20  /*.** Copyright 
0010: 28 63 29 20 32 30 30 38 20 44 2e 20 52 69 63 68  (c) 2008 D. Rich
0020: 61 72 64 20 48 69 70 70 0a 2a 2a 0a 2a 2a 20 54  ard Hipp.**.** T
0030: 68 69 73 20 70 72 6f 67 72 61 6d 20 69 73 20 66  his program is f
0040: 72 65 65 20 73 6f 66 74 77 61 72 65 3b 20 79 6f  ree software; yo
0050: 75 20 63 61 6e 20 72 65 64 69 73 74 72 69 62 75  u can redistribu
0060: 74 65 20 69 74 20 61 6e 64 2f 6f 72 0a 2a 2a 20  te it and/or.** 
0070: 6d 6f 64 69 66 79 20 69 74 20 75 6e 64 65 72 20  modify it under 
0080: 74 68 65 20 74 65 72 6d 73 20 6f 66 20 74 68 65  the terms of the
0090: 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62   GNU General Pub
00a0: 6c 69 63 0a 2a 2a 20 4c 69 63 65 6e 73 65 20 76  lic.** License v
00b0: 65 72 73 69 6f 6e 20 32 20 61 73 20 70 75 62 6c  ersion 2 as publ
00c0: 69 73 68 65 64 20 62 79 20 74 68 65 20 46 72 65  ished by the Fre
00d0: 65 20 53 6f 66 74 77 61 72 65 20 46 6f 75 6e 64  e Software Found
00e0: 61 74 69 6f 6e 2e 0a 2a 2a 0a 2a 2a 20 54 68 69  ation..**.** Thi
00f0: 73 20 70 72 6f 67 72 61 6d 20 69 73 20 64 69 73  s program is dis
0100: 74 72 69 62 75 74 65 64 20 69 6e 20 74 68 65 20  tributed in the 
0110: 68 6f 70 65 20 74 68 61 74 20 69 74 20 77 69 6c  hope that it wil
0120: 6c 20 62 65 20 75 73 65 66 75 6c 2c 0a 2a 2a 20  l be useful,.** 
0130: 62 75 74 20 57 49 54 48 4f 55 54 20 41 4e 59 20  but WITHOUT ANY 
0140: 57 41 52 52 41 4e 54 59 3b 20 77 69 74 68 6f 75  WARRANTY; withou
0150: 74 20 65 76 65 6e 20 74 68 65 20 69 6d 70 6c 69  t even the impli
0160: 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 0a 2a  ed warranty of.*
0170: 2a 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54  * MERCHANTABILIT
0180: 59 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52  Y or FITNESS FOR
0190: 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55   A PARTICULAR PU
01a0: 52 50 4f 53 45 2e 20 20 53 65 65 20 74 68 65 20  RPOSE.  See the 
01b0: 47 4e 55 0a 2a 2a 20 47 65 6e 65 72 61 6c 20 50  GNU.** General P
01c0: 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 66 6f  ublic License fo
01d0: 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0a  r more details..
01e0: 2a 2a 20 0a 2a 2a 20 59 6f 75 20 73 68 6f 75 6c  ** .** You shoul
01f0: 64 20 68 61 76 65 20 72 65 63 65 69 76 65 64 20  d have received 
0200: 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 47 4e  a copy of the GN
0210: 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63  U General Public
0220: 0a 2a 2a 20 4c 69 63 65 6e 73 65 20 61 6c 6f 6e  .** License alon
0230: 67 20 77 69 74 68 20 74 68 69 73 20 6c 69 62 72  g with this libr
0240: 61 72 79 3b 20 69 66 20 6e 6f 74 2c 20 77 72 69  ary; if not, wri
0250: 74 65 20 74 6f 20 74 68 65 0a 2a 2a 20 46 72 65  te to the.** Fre
0260: 65 20 53 6f 66 74 77 61 72 65 20 46 6f 75 6e 64  e Software Found
0270: 61 74 69 6f 6e 2c 20 49 6e 63 2e 2c 20 35 39 20  ation, Inc., 59 
0280: 54 65 6d 70 6c 65 20 50 6c 61 63 65 20 2d 20 53  Temple Place - S
0290: 75 69 74 65 20 33 33 30 2c 0a 2a 2a 20 42 6f 73  uite 330,.** Bos
02a0: 74 6f 6e 2c 20 4d 41 20 20 30 32 31 31 31 2d 31  ton, MA  02111-1
02b0: 33 30 37 2c 20 55 53 41 2e 0a 2a 2a 0a 2a 2a 20  307, USA..**.** 
02c0: 41 75 74 68 6f 72 20 63 6f 6e 74 61 63 74 20 69  Author contact i
02d0: 6e 66 6f 72 6d 61 74 69 6f 6e 3a 0a 2a 2a 20 20  nformation:.**  
02e0: 20 64 72 68 40 68 77 61 63 69 2e 63 6f 6d 0a 2a   drh@hwaci.com.*
02f0: 2a 20 20 20 68 74 74 70 3a 2f 2f 77 77 77 2e 68  *   http://www.h
0300: 77 61 63 69 2e 63 6f 6d 2f 64 72 68 2f 0a 2a 2a  waci.com/drh/.**
0310: 0a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  .***************
0320: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0330: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0340: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0350: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0360: 0a 2a 2a 0a 2a 2a 20 54 68 69 73 20 66 69 6c 65  .**.** This file
0370: 20 63 6f 6e 74 61 69 6e 73 20 63 6f 64 65 20 75   contains code u
0380: 73 65 64 20 74 6f 20 6d 61 6e 61 67 65 20 53 48  sed to manage SH
0390: 55 4e 20 74 61 62 6c 65 20 6f 66 20 74 68 65 20  UN table of the 
03a0: 72 65 70 6f 73 69 74 6f 72 79 0a 2a 2f 0a 23 69  repository.*/.#i
03b0: 6e 63 6c 75 64 65 20 22 63 6f 6e 66 69 67 2e 68  nclude "config.h
03c0: 22 0a 23 69 6e 63 6c 75 64 65 20 22 73 68 75 6e  ".#include "shun
03d0: 2e 68 22 0a 23 69 6e 63 6c 75 64 65 20 3c 61 73  .h".#include <as
03e0: 73 65 72 74 2e 68 3e 0a 0a 2f 2a 0a 2a 2a 20 52  sert.h>../*.** R
03f0: 65 74 75 72 6e 20 74 72 75 65 20 69 66 20 74 68  eturn true if th
0400: 65 20 67 69 76 65 6e 20 61 72 74 69 66 61 63 74  e given artifact
0410: 20 49 44 20 73 68 6f 75 6c 64 20 62 65 20 73 68   ID should be sh
0420: 75 6e 6e 65 64 2e 0a 2a 2f 0a 69 6e 74 20 75 75  unned..*/.int uu
0430: 69 64 5f 69 73 5f 73 68 75 6e 6e 65 64 28 63 6f  id_is_shunned(co
0440: 6e 73 74 20 63 68 61 72 20 2a 7a 55 75 69 64 29  nst char *zUuid)
0450: 7b 0a 20 20 73 74 61 74 69 63 20 53 74 6d 74 20  {.  static Stmt 
0460: 71 3b 0a 20 20 69 6e 74 20 72 63 3b 0a 20 20 69  q;.  int rc;.  i
0470: 66 28 20 7a 55 75 69 64 3d 3d 30 20 7c 7c 20 7a  f( zUuid==0 || z
0480: 55 75 69 64 5b 30 5d 3d 3d 30 20 29 20 72 65 74  Uuid[0]==0 ) ret
0490: 75 72 6e 20 30 3b 0a 20 20 64 62 5f 73 74 61 74  urn 0;.  db_stat
04a0: 69 63 5f 70 72 65 70 61 72 65 28 26 71 2c 20 22  ic_prepare(&q, "
04b0: 53 45 4c 45 43 54 20 31 20 46 52 4f 4d 20 73 68  SELECT 1 FROM sh
04c0: 75 6e 20 57 48 45 52 45 20 75 75 69 64 3d 3a 75  un WHERE uuid=:u
04d0: 75 69 64 22 29 3b 0a 20 20 64 62 5f 62 69 6e 64  uid");.  db_bind
04e0: 5f 74 65 78 74 28 26 71 2c 20 22 3a 75 75 69 64  _text(&q, ":uuid
04f0: 22 2c 20 7a 55 75 69 64 29 3b 0a 20 20 72 63 20  ", zUuid);.  rc 
0500: 3d 20 64 62 5f 73 74 65 70 28 26 71 29 3b 0a 20  = db_step(&q);. 
0510: 20 64 62 5f 72 65 73 65 74 28 26 71 29 3b 0a 20   db_reset(&q);. 
0520: 20 72 65 74 75 72 6e 20 72 63 3d 3d 53 51 4c 49   return rc==SQLI
0530: 54 45 5f 52 4f 57 3b 0a 7d 0a 0a 2f 2a 0a 2a 2a  TE_ROW;.}../*.**
0540: 20 57 45 42 50 41 47 45 3a 20 73 68 75 6e 0a 2a   WEBPAGE: shun.*
0550: 2f 0a 76 6f 69 64 20 73 68 75 6e 5f 70 61 67 65  /.void shun_page
0560: 28 76 6f 69 64 29 7b 0a 20 20 53 74 6d 74 20 71  (void){.  Stmt q
0570: 3b 0a 20 20 69 6e 74 20 63 6e 74 20 3d 20 30 3b  ;.  int cnt = 0;
0580: 0a 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 7a  .  const char *z
0590: 55 75 69 64 20 3d 20 50 28 22 75 75 69 64 22 29  Uuid = P("uuid")
05a0: 3b 0a 20 20 69 6e 74 20 6e 55 75 69 64 3b 0a 20  ;.  int nUuid;. 
05b0: 20 63 68 61 72 20 7a 43 61 6e 6f 6e 69 63 61 6c   char zCanonical
05c0: 5b 55 55 49 44 5f 53 49 5a 45 2b 31 5d 3b 0a 0a  [UUID_SIZE+1];..
05d0: 20 20 6c 6f 67 69 6e 5f 63 68 65 63 6b 5f 63 72    login_check_cr
05e0: 65 64 65 6e 74 69 61 6c 73 28 29 3b 0a 20 20 69  edentials();.  i
05f0: 66 28 20 21 67 2e 6f 6b 41 64 6d 69 6e 20 29 7b  f( !g.okAdmin ){
0600: 0a 20 20 20 20 6c 6f 67 69 6e 5f 6e 65 65 64 65  .    login_neede
0610: 64 28 29 3b 0a 20 20 7d 0a 20 20 69 66 28 20 50  d();.  }.  if( P
0620: 28 22 72 65 62 75 69 6c 64 22 29 20 29 7b 0a 20  ("rebuild") ){. 
0630: 20 20 20 64 62 5f 63 6c 6f 73 65 28 29 3b 0a 20     db_close();. 
0640: 20 20 20 64 62 5f 6f 70 65 6e 5f 72 65 70 6f 73     db_open_repos
0650: 69 74 6f 72 79 28 67 2e 7a 52 65 70 6f 73 69 74  itory(g.zReposit
0660: 6f 72 79 4e 61 6d 65 29 3b 0a 20 20 20 20 64 62  oryName);.    db
0670: 5f 62 65 67 69 6e 5f 74 72 61 6e 73 61 63 74 69  _begin_transacti
0680: 6f 6e 28 29 3b 0a 20 20 20 20 72 65 62 75 69 6c  on();.    rebuil
0690: 64 5f 64 62 28 30 2c 30 29 3b 0a 20 20 20 20 64  d_db(0,0);.    d
06a0: 62 5f 65 6e 64 5f 74 72 61 6e 73 61 63 74 69 6f  b_end_transactio
06b0: 6e 28 30 29 3b 0a 20 20 7d 0a 20 20 69 66 28 20  n(0);.  }.  if( 
06c0: 7a 55 75 69 64 20 29 7b 0a 20 20 20 20 6e 55 75  zUuid ){.    nUu
06d0: 69 64 20 3d 20 73 74 72 6c 65 6e 28 7a 55 75 69  id = strlen(zUui
06e0: 64 29 3b 0a 20 20 20 20 69 66 28 20 6e 55 75 69  d);.    if( nUui
06f0: 64 21 3d 34 30 20 7c 7c 20 21 76 61 6c 69 64 61  d!=40 || !valida
0700: 74 65 31 36 28 7a 55 75 69 64 2c 20 6e 55 75 69  te16(zUuid, nUui
0710: 64 29 20 29 7b 0a 20 20 20 20 20 20 7a 55 75 69  d) ){.      zUui
0720: 64 20 3d 20 30 3b 0a 20 20 20 20 7d 65 6c 73 65  d = 0;.    }else
0730: 7b 0a 20 20 20 20 20 20 6d 65 6d 63 70 79 28 7a  {.      memcpy(z
0740: 43 61 6e 6f 6e 69 63 61 6c 2c 20 7a 55 75 69 64  Canonical, zUuid
0750: 2c 20 55 55 49 44 5f 53 49 5a 45 2b 31 29 3b 0a  , UUID_SIZE+1);.
0760: 20 20 20 20 20 20 63 61 6e 6f 6e 69 63 61 6c 31        canonical1
0770: 36 28 7a 43 61 6e 6f 6e 69 63 61 6c 2c 20 55 55  6(zCanonical, UU
0780: 49 44 5f 53 49 5a 45 29 3b 0a 20 20 20 20 20 20  ID_SIZE);.      
0790: 7a 55 75 69 64 20 3d 20 7a 43 61 6e 6f 6e 69 63  zUuid = zCanonic
07a0: 61 6c 3b 0a 20 20 20 20 7d 0a 20 20 7d 0a 20 20  al;.    }.  }.  
07b0: 73 74 79 6c 65 5f 68 65 61 64 65 72 28 22 53 68  style_header("Sh
07c0: 75 6e 6e 65 64 20 41 72 74 69 66 61 63 74 73 22  unned Artifacts"
07d0: 29 3b 0a 20 20 69 66 28 20 7a 55 75 69 64 20 26  );.  if( zUuid &
07e0: 26 20 50 28 22 73 75 62 22 29 20 29 7b 0a 20 20  & P("sub") ){.  
07f0: 20 20 6c 6f 67 69 6e 5f 76 65 72 69 66 79 5f 63    login_verify_c
0800: 73 72 66 5f 73 65 63 72 65 74 28 29 3b 0a 20 20  srf_secret();.  
0810: 20 20 64 62 5f 6d 75 6c 74 69 5f 65 78 65 63 28    db_multi_exec(
0820: 22 44 45 4c 45 54 45 20 46 52 4f 4d 20 73 68 75  "DELETE FROM shu
0830: 6e 20 57 48 45 52 45 20 75 75 69 64 3d 27 25 73  n WHERE uuid='%s
0840: 27 22 2c 20 7a 55 75 69 64 29 3b 0a 20 20 20 20  '", zUuid);.    
0850: 69 66 28 20 64 62 5f 65 78 69 73 74 73 28 22 53  if( db_exists("S
0860: 45 4c 45 43 54 20 31 20 46 52 4f 4d 20 62 6c 6f  ELECT 1 FROM blo
0870: 62 20 57 48 45 52 45 20 75 75 69 64 3d 27 25 73  b WHERE uuid='%s
0880: 27 22 2c 20 7a 55 75 69 64 29 20 29 7b 0a 20 20  '", zUuid) ){.  
0890: 20 20 20 20 40 20 3c 70 3e 3c 66 6f 6e 74 20 63      @ <p><font c
08a0: 6f 6c 6f 72 3d 22 62 6c 75 65 22 3e 41 72 74 69  olor="blue">Arti
08b0: 66 61 63 74 20 0a 20 20 20 20 20 20 40 20 3c 61  fact .      @ <a
08c0: 20 68 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 73   href="%s(g.zBas
08d0: 65 55 52 4c 29 2f 61 72 74 69 66 61 63 74 2f 25  eURL)/artifact/%
08e0: 73 28 7a 55 75 69 64 29 22 3e 25 73 28 7a 55 75  s(zUuid)">%s(zUu
08f0: 69 64 29 3c 2f 61 3e 20 69 73 20 6e 6f 0a 20 20  id)</a> is no.  
0900: 20 20 20 20 40 20 6c 6f 6e 67 65 72 20 62 65 69      @ longer bei
0910: 6e 67 20 73 68 75 6e 6e 65 64 2e 3c 2f 66 6f 6e  ng shunned.</fon
0920: 74 3e 3c 2f 70 3e 0a 20 20 20 20 7d 65 6c 73 65  t></p>.    }else
0930: 7b 0a 20 20 20 20 20 20 40 20 3c 70 3e 3c 66 6f  {.      @ <p><fo
0940: 6e 74 20 63 6f 6c 6f 72 3d 22 62 6c 75 65 22 3e  nt color="blue">
0950: 41 72 74 69 66 61 63 74 20 25 73 28 7a 55 75 69  Artifact %s(zUui
0960: 64 29 3c 2f 61 3e 20 77 69 6c 6c 20 6e 6f 20 6c  d)</a> will no l
0970: 6f 6e 67 65 72 0a 20 20 20 20 20 20 40 20 62 65  onger.      @ be
0980: 20 73 68 75 6e 6e 65 64 2e 20 20 42 75 74 20 69   shunned.  But i
0990: 74 20 64 6f 65 73 20 6e 6f 74 20 65 78 69 73 74  t does not exist
09a0: 20 69 6e 20 74 68 65 20 72 65 70 6f 73 69 74 6f   in the reposito
09b0: 72 79 2e 20 20 49 74 0a 20 20 20 20 20 20 40 20  ry.  It.      @ 
09c0: 6d 61 79 20 62 65 20 6e 65 63 65 73 73 61 72 79  may be necessary
09d0: 20 74 6f 20 72 65 62 75 69 6c 64 20 74 68 65 20   to rebuild the 
09e0: 72 65 70 6f 73 69 74 6f 72 79 20 75 73 69 6e 67  repository using
09f0: 20 74 68 65 0a 20 20 20 20 20 20 40 20 3c 62 3e   the.      @ <b>
0a00: 66 6f 73 73 69 6c 20 72 65 62 75 69 6c 64 3c 2f  fossil rebuild</
0a10: 62 3e 20 63 6f 6d 6d 61 6e 64 2d 6c 69 6e 65 20  b> command-line 
0a20: 62 65 66 6f 72 65 20 74 68 65 20 61 72 74 69 66  before the artif
0a30: 61 63 74 20 63 6f 6e 74 65 6e 74 0a 20 20 20 20  act content.    
0a40: 20 20 40 20 63 61 6e 20 70 75 6c 6c 65 64 20 69    @ can pulled i
0a50: 6e 20 66 72 6f 6d 20 6f 74 68 65 72 20 72 65 73  n from other res
0a60: 70 6f 73 69 74 6f 72 69 65 73 2e 3c 2f 66 6f 6e  positories.</fon
0a70: 74 3e 3c 2f 70 3e 0a 20 20 20 20 7d 0a 20 20 7d  t></p>.    }.  }
0a80: 0a 20 20 69 66 28 20 7a 55 75 69 64 20 26 26 20  .  if( zUuid && 
0a90: 50 28 22 61 64 64 22 29 20 29 7b 0a 20 20 20 20  P("add") ){.    
0aa0: 6c 6f 67 69 6e 5f 76 65 72 69 66 79 5f 63 73 72  login_verify_csr
0ab0: 66 5f 73 65 63 72 65 74 28 29 3b 0a 20 20 20 20  f_secret();.    
0ac0: 64 62 5f 6d 75 6c 74 69 5f 65 78 65 63 28 22 49  db_multi_exec("I
0ad0: 4e 53 45 52 54 20 4f 52 20 49 47 4e 4f 52 45 20  NSERT OR IGNORE 
0ae0: 49 4e 54 4f 20 73 68 75 6e 20 56 41 4c 55 45 53  INTO shun VALUES
0af0: 28 27 25 73 27 29 22 2c 20 7a 55 75 69 64 29 3b  ('%s')", zUuid);
0b00: 0a 20 20 20 20 40 20 3c 70 3e 3c 66 6f 6e 74 20  .    @ <p><font 
0b10: 63 6f 6c 6f 72 3d 22 62 6c 75 65 22 3e 41 72 74  color="blue">Art
0b20: 69 66 61 63 74 0a 20 20 20 20 40 20 3c 61 20 68  ifact.    @ <a h
0b30: 72 65 66 3d 22 25 73 28 67 2e 7a 42 61 73 65 55  ref="%s(g.zBaseU
0b40: 52 4c 29 2f 61 72 74 69 66 61 63 74 2f 25 73 28  RL)/artifact/%s(
0b50: 7a 55 75 69 64 29 22 3e 25 73 28 7a 55 75 69 64  zUuid)">%s(zUuid
0b60: 29 3c 2f 61 3e 20 68 61 73 20 62 65 65 6e 0a 20  )</a> has been. 
0b70: 20 20 20 40 20 73 68 75 6e 6e 65 64 2e 20 20 49     @ shunned.  I
0b80: 74 20 77 69 6c 6c 20 6e 6f 20 6c 6f 6e 67 65 72  t will no longer
0b90: 20 62 65 20 70 75 73 68 65 64 2e 0a 20 20 20 20   be pushed..    
0ba0: 40 20 49 74 20 77 69 6c 6c 20 62 65 20 72 65 6d  @ It will be rem
0bb0: 6f 76 65 64 20 66 72 6f 6d 20 74 68 65 20 72 65  oved from the re
0bc0: 70 6f 73 69 74 6f 72 79 20 74 68 65 20 6e 65 78  pository the nex
0bd0: 74 20 74 69 6d 65 20 74 68 65 20 72 65 73 70 6f  t time the respo
0be0: 73 69 74 6f 72 79 0a 20 20 20 20 40 20 69 73 20  sitory.    @ is 
0bf0: 72 65 62 75 69 6c 74 20 75 73 69 6e 67 20 74 68  rebuilt using th
0c00: 65 20 3c 62 3e 66 6f 73 73 69 6c 20 72 65 62 75  e <b>fossil rebu
0c10: 69 6c 64 3c 2f 62 3e 20 63 6f 6d 6d 61 6e 64 2d  ild</b> command-
0c20: 6c 69 6e 65 3c 2f 66 6f 6e 74 3e 3c 2f 70 3e 0a  line</font></p>.
0c30: 20 20 7d 0a 20 20 40 20 3c 70 3e 41 20 73 68 75    }.  @ <p>A shu
0c40: 6e 6e 65 64 20 61 72 74 69 66 61 63 74 20 77 69  nned artifact wi
0c50: 6c 6c 20 6e 6f 74 20 62 65 20 70 75 73 68 65 64  ll not be pushed
0c60: 20 6e 6f 72 20 61 63 63 65 70 74 65 64 20 69 6e   nor accepted in
0c70: 20 61 20 70 75 6c 6c 20 61 6e 64 20 74 68 65 0a   a pull and the.
0c80: 20 20 40 20 61 72 74 69 66 61 63 74 20 63 6f 6e    @ artifact con
0c90: 74 65 6e 74 20 77 69 6c 6c 20 62 65 20 70 75 72  tent will be pur
0ca0: 67 65 64 20 66 72 6f 6d 20 74 68 65 20 72 65 70  ged from the rep
0cb0: 6f 73 69 74 6f 72 79 20 74 68 65 20 6e 65 78 74  ository the next
0cc0: 20 74 69 6d 65 20 74 68 65 0a 20 20 40 20 72 65   time the.  @ re
0cd0: 70 6f 73 69 74 6f 72 79 20 69 73 20 72 65 62 75  pository is rebu
0ce0: 69 6c 74 2e 20 20 41 20 6c 69 73 74 20 6f 66 20  ilt.  A list of 
0cf0: 73 68 75 6e 6e 65 64 20 61 72 74 69 66 61 63 74  shunned artifact
0d00: 73 20 63 61 6e 20 62 65 20 73 65 65 6e 20 61 74  s can be seen at
0d10: 20 74 68 65 0a 20 20 40 20 62 6f 74 74 6f 6d 20   the.  @ bottom 
0d20: 6f 66 20 74 68 69 73 20 70 61 67 65 2e 3c 2f 70  of this page.</p
0d30: 3e 0a 20 20 40 20 0a 20 20 40 20 3c 61 20 6e 61  >.  @ .  @ <a na
0d40: 6d 65 3d 22 61 64 64 73 68 75 6e 22 3e 3c 2f 61  me="addshun"></a
0d50: 3e 0a 20 20 40 20 3c 70 3e 54 6f 20 73 68 75 6e  >.  @ <p>To shun
0d60: 20 61 6e 20 61 72 74 69 66 61 63 74 2c 20 65 6e   an artifact, en
0d70: 74 65 72 20 69 74 73 20 61 72 74 69 66 61 63 74  ter its artifact
0d80: 20 49 44 20 28 74 68 65 20 34 30 2d 63 68 61 72   ID (the 40-char
0d90: 61 63 74 65 72 20 53 48 41 31 0a 20 20 40 20 68  acter SHA1.  @ h
0da0: 61 73 68 20 6f 66 20 74 68 65 20 61 72 74 69 66  ash of the artif
0db0: 61 63 74 29 20 69 6e 20 74 68 65 0a 20 20 40 20  act) in the.  @ 
0dc0: 66 6f 6c 6c 6f 77 69 6e 67 20 62 6f 78 20 61 6e  following box an
0dd0: 64 20 70 72 65 73 73 20 74 68 65 20 22 53 68 75  d press the "Shu
0de0: 6e 22 20 62 75 74 74 6f 6e 2e 20 20 54 68 69 73  n" button.  This
0df0: 20 77 69 6c 6c 20 63 61 75 73 65 20 74 68 65 20   will cause the 
0e00: 61 72 74 69 66 61 63 74 0a 20 20 40 20 74 6f 20  artifact.  @ to 
0e10: 62 65 20 72 65 6d 6f 76 65 64 20 66 72 6f 6d 20  be removed from 
0e20: 74 68 65 20 72 65 70 6f 73 69 74 6f 72 79 20 61  the repository a
0e30: 6e 64 20 77 69 6c 6c 20 70 72 65 76 65 6e 74 20  nd will prevent 
0e40: 74 68 65 20 61 72 74 69 66 61 63 74 20 66 72 6f  the artifact fro
0e50: 6d 20 62 65 69 6e 67 0a 20 20 40 20 72 65 61 64  m being.  @ read
0e60: 64 65 64 20 74 6f 20 74 68 65 20 72 65 70 6f 73  ded to the repos
0e70: 69 74 6f 72 79 20 62 79 20 73 75 62 73 65 71 75  itory by subsequ
0e80: 65 6e 74 20 73 79 6e 63 20 6f 70 65 72 61 74 69  ent sync operati
0e90: 6f 6e 2e 3c 2f 70 3e 0a 20 20 40 0a 20 20 40 20  on.</p>.  @.  @ 
0ea0: 3c 70 3e 4e 6f 74 65 20 74 68 61 74 20 79 6f 75  <p>Note that you
0eb0: 20 6d 75 73 74 20 65 6e 74 65 72 20 74 68 65 20   must enter the 
0ec0: 66 75 6c 6c 20 34 30 2d 63 68 61 72 61 63 74 65  full 40-characte
0ed0: 72 20 61 72 74 69 66 61 63 74 20 49 44 2c 20 6e  r artifact ID, n
0ee0: 6f 74 0a 20 20 40 20 61 6e 20 61 62 62 72 65 76  ot.  @ an abbrev
0ef0: 69 61 74 69 6f 6e 20 6f 72 20 61 20 73 79 6d 62  iation or a symb
0f00: 6f 6c 69 63 20 74 61 67 2e 3c 2f 70 3e 0a 20 20  olic tag.</p>.  
0f10: 40 0a 20 20 40 20 3c 70 3e 57 61 72 6e 69 6e 67  @.  @ <p>Warning
0f20: 3a 20 20 53 68 75 6e 6e 69 6e 67 20 73 68 6f 75  :  Shunning shou
0f30: 6c 64 20 6f 6e 6c 79 20 62 65 20 75 73 65 64 20  ld only be used 
0f40: 74 6f 20 72 65 6d 6f 76 65 20 69 6e 61 70 70 72  to remove inappr
0f50: 6f 70 72 69 61 74 65 20 63 6f 6e 74 65 6e 74 0a  opriate content.
0f60: 20 20 40 20 66 72 6f 6d 20 74 68 65 20 72 65 70    @ from the rep
0f70: 6f 73 69 74 6f 72 79 2e 20 20 49 6e 61 70 70 72  ository.  Inappr
0f80: 6f 70 72 69 61 74 65 20 63 6f 6e 74 65 6e 74 20  opriate content 
0f90: 69 6e 63 6c 75 64 65 73 20 73 75 63 68 20 74 68  includes such th
0fa0: 69 6e 67 73 20 61 73 0a 20 20 40 20 73 70 61 6d  ings as.  @ spam
0fb0: 20 61 64 64 65 64 20 74 6f 20 57 69 6b 69 2c 20   added to Wiki, 
0fc0: 66 69 6c 65 73 20 74 68 61 74 20 76 69 6f 6c 61  files that viola
0fd0: 74 65 20 63 6f 70 79 72 69 67 68 74 20 6f 72 20  te copyright or 
0fe0: 70 61 74 65 6e 74 20 61 67 72 65 65 6d 65 6e 74  patent agreement
0ff0: 73 2c 0a 20 20 40 20 6f 72 20 61 72 74 69 66 61  s,.  @ or artifa
1000: 63 74 73 20 74 68 61 74 20 62 79 20 64 65 73 69  cts that by desi
1010: 67 6e 20 6f 72 20 61 63 63 69 64 65 6e 74 20 69  gn or accident i
1020: 6e 74 65 72 66 65 72 65 20 77 69 74 68 20 74 68  nterfere with th
1030: 65 20 70 72 6f 63 65 73 73 69 6e 67 0a 20 20 40  e processing.  @
1040: 20 6f 66 20 74 68 65 20 72 65 70 6f 73 69 74 6f   of the reposito
1050: 72 79 2e 20 20 44 6f 20 6e 6f 74 20 73 68 75 6e  ry.  Do not shun
1060: 20 61 72 74 69 66 61 63 74 73 20 6d 65 72 65 6c   artifacts merel
1070: 79 20 74 6f 20 72 65 6d 6f 76 65 20 74 68 65 6d  y to remove them
1080: 20 66 72 6f 6d 0a 20 20 40 20 73 69 67 68 74 20   from.  @ sight 
1090: 2d 20 73 65 74 20 74 68 65 20 22 68 69 64 64 65  - set the "hidde
10a0: 6e 22 20 74 61 67 20 6f 6e 20 73 75 63 68 20 61  n" tag on such a
10b0: 72 74 69 66 61 63 74 73 20 69 6e 73 74 65 61 64  rtifacts instead
10c0: 2e 3c 2f 70 3e 0a 20 20 40 20 0a 20 20 40 20 3c  .</p>.  @ .  @ <
10d0: 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 40 20  blockquote>.  @ 
10e0: 3c 66 6f 72 6d 20 6d 65 74 68 6f 64 3d 22 50 4f  <form method="PO
10f0: 53 54 22 20 61 63 74 69 6f 6e 3d 22 25 73 28 67  ST" action="%s(g
1100: 2e 7a 42 61 73 65 55 52 4c 29 2f 25 73 28 67 2e  .zBaseURL)/%s(g.
1110: 7a 50 61 74 68 29 22 3e 0a 20 20 6c 6f 67 69 6e  zPath)">.  login
1120: 5f 69 6e 73 65 72 74 5f 63 73 72 66 5f 73 65 63  _insert_csrf_sec
1130: 72 65 74 28 29 3b 0a 20 20 40 20 3c 69 6e 70 75  ret();.  @ <inpu
1140: 74 20 74 79 70 65 3d 22 74 65 78 74 22 20 6e 61  t type="text" na
1150: 6d 65 3d 22 75 75 69 64 22 20 76 61 6c 75 65 3d  me="uuid" value=
1160: 22 25 68 28 50 44 28 22 73 68 75 6e 22 2c 22 22  "%h(PD("shun",""
1170: 29 29 22 20 73 69 7a 65 3d 22 35 30 22 3e 0a 20  ))" size="50">. 
1180: 20 40 20 3c 69 6e 70 75 74 20 74 79 70 65 3d 22   @ <input type="
1190: 73 75 62 6d 69 74 22 20 6e 61 6d 65 3d 22 61 64  submit" name="ad
11a0: 64 22 20 76 61 6c 75 65 3d 22 53 68 75 6e 22 3e  d" value="Shun">
11b0: 0a 20 20 40 20 3c 2f 66 6f 72 6d 3e 0a 20 20 40  .  @ </form>.  @
11c0: 20 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20   </blockquote>. 
11d0: 20 40 0a 20 20 40 20 3c 70 3e 45 6e 74 65 72 20   @.  @ <p>Enter 
11e0: 74 68 65 20 55 55 49 44 20 6f 66 20 61 20 70 72  the UUID of a pr
11f0: 65 76 69 6f 75 73 20 73 68 75 6e 6e 65 64 20 61  evious shunned a
1200: 72 74 69 66 61 63 74 20 74 6f 20 63 61 75 73 65  rtifact to cause
1210: 20 69 74 20 74 6f 20 62 65 0a 20 20 40 20 61 63   it to be.  @ ac
1220: 63 65 70 74 65 64 20 61 67 61 69 6e 20 69 6e 20  cepted again in 
1230: 74 68 65 20 72 65 70 6f 73 69 74 6f 72 79 2e 20  the repository. 
1240: 20 54 68 65 20 61 72 74 69 66 61 63 74 20 63 6f   The artifact co
1250: 6e 74 65 6e 74 20 69 73 20 6e 6f 74 0a 20 20 40  ntent is not.  @
1260: 20 72 65 73 74 6f 72 65 64 20 62 65 63 61 75 73   restored becaus
1270: 65 20 74 68 65 20 63 6f 6e 74 65 6e 74 20 69 73  e the content is
1280: 20 75 6e 6b 6e 6f 77 6e 2e 20 20 54 68 65 20 6f   unknown.  The o
1290: 6e 6c 79 20 63 68 61 6e 67 65 20 69 73 20 74 68  nly change is th
12a0: 61 74 0a 20 20 40 20 74 68 65 20 66 6f 72 6d 65  at.  @ the forme
12b0: 72 6c 79 20 73 68 75 6e 6e 65 64 20 61 72 74 69  rly shunned arti
12c0: 66 61 63 74 20 77 69 6c 6c 20 62 65 20 61 63 63  fact will be acc
12d0: 65 70 74 65 64 20 6f 6e 20 73 75 62 73 65 71 75  epted on subsequ
12e0: 65 6e 74 20 73 79 6e 63 0a 20 20 40 20 6f 70 65  ent sync.  @ ope
12f0: 72 61 74 69 6f 6e 73 2e 3c 2f 70 3e 0a 20 20 40  rations.</p>.  @
1300: 0a 20 20 40 20 3c 62 6c 6f 63 6b 71 75 6f 74 65  .  @ <blockquote
1310: 3e 0a 20 20 40 20 3c 66 6f 72 6d 20 6d 65 74 68  >.  @ <form meth
1320: 6f 64 3d 22 50 4f 53 54 22 20 61 63 74 69 6f 6e  od="POST" action
1330: 3d 22 25 73 28 67 2e 7a 42 61 73 65 55 52 4c 29  ="%s(g.zBaseURL)
1340: 2f 25 73 28 67 2e 7a 50 61 74 68 29 22 3e 0a 20  /%s(g.zPath)">. 
1350: 20 6c 6f 67 69 6e 5f 69 6e 73 65 72 74 5f 63 73   login_insert_cs
1360: 72 66 5f 73 65 63 72 65 74 28 29 3b 0a 20 20 40  rf_secret();.  @
1370: 20 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 74 65   <input type="te
1380: 78 74 22 20 6e 61 6d 65 3d 22 75 75 69 64 22 20  xt" name="uuid" 
1390: 73 69 7a 65 3d 22 35 30 22 3e 0a 20 20 40 20 3c  size="50">.  @ <
13a0: 69 6e 70 75 74 20 74 79 70 65 3d 22 73 75 62 6d  input type="subm
13b0: 69 74 22 20 6e 61 6d 65 3d 22 73 75 62 22 20 76  it" name="sub" v
13c0: 61 6c 75 65 3d 22 41 63 63 65 70 74 22 3e 0a 20  alue="Accept">. 
13d0: 20 40 20 3c 2f 66 6f 72 6d 3e 0a 20 20 40 20 3c   @ </form>.  @ <
13e0: 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 40  /blockquote>.  @
13f0: 0a 20 20 40 20 3c 70 3e 50 72 65 73 73 20 74 68  .  @ <p>Press th
1400: 65 20 52 65 62 75 69 6c 64 20 62 75 74 74 6f 6e  e Rebuild button
1410: 20 62 65 6c 6f 77 20 74 6f 20 72 65 62 75 69 6c   below to rebuil
1420: 64 20 74 68 65 20 72 65 73 70 6f 73 69 74 6f 72  d the respositor
1430: 79 2e 20 20 54 68 65 0a 20 20 40 20 63 6f 6e 74  y.  The.  @ cont
1440: 65 6e 74 20 6f 66 20 6e 65 77 6c 79 20 73 68 75  ent of newly shu
1450: 6e 6e 65 64 20 61 72 74 69 66 61 63 74 73 20 69  nned artifacts i
1460: 73 20 6e 6f 74 20 70 75 72 67 65 64 20 75 6e 74  s not purged unt
1470: 69 6c 20 74 68 65 20 72 65 70 6f 73 69 74 6f 72  il the repositor
1480: 79 0a 20 20 40 20 69 73 20 72 65 62 75 69 6c 74  y.  @ is rebuilt
1490: 2e 20 20 4f 6e 20 6c 61 72 67 65 72 20 72 65 70  .  On larger rep
14a0: 6f 73 69 74 6f 72 69 65 73 2c 20 74 68 65 20 72  ositories, the r
14b0: 65 62 75 69 6c 64 20 6d 61 79 20 74 61 6b 65 20  ebuild may take 
14c0: 6d 69 6e 75 74 65 20 6f 72 0a 20 20 40 20 74 77  minute or.  @ tw
14d0: 6f 2c 20 73 6f 20 62 65 20 70 61 74 69 65 6e 74  o, so be patient
14e0: 20 61 66 74 65 72 20 70 72 65 73 73 69 6e 67 20   after pressing 
14f0: 74 68 65 20 62 75 74 74 6f 6e 2e 3c 2f 70 3e 0a  the button.</p>.
1500: 20 20 40 0a 20 20 40 20 3c 62 6c 6f 63 6b 71 75    @.  @ <blockqu
1510: 6f 74 65 3e 0a 20 20 40 20 3c 66 6f 72 6d 20 6d  ote>.  @ <form m
1520: 65 74 68 6f 64 3d 22 50 4f 53 54 22 20 61 63 74  ethod="POST" act
1530: 69 6f 6e 3d 22 25 73 28 67 2e 7a 42 61 73 65 55  ion="%s(g.zBaseU
1540: 52 4c 29 2f 25 73 28 67 2e 7a 50 61 74 68 29 22  RL)/%s(g.zPath)"
1550: 3e 0a 20 20 6c 6f 67 69 6e 5f 69 6e 73 65 72 74  >.  login_insert
1560: 5f 63 73 72 66 5f 73 65 63 72 65 74 28 29 3b 0a  _csrf_secret();.
1570: 20 20 40 20 3c 69 6e 70 75 74 20 74 79 70 65 3d    @ <input type=
1580: 22 73 75 62 6d 69 74 22 20 6e 61 6d 65 3d 22 72  "submit" name="r
1590: 65 62 75 69 6c 64 22 20 76 61 6c 75 65 3d 22 52  ebuild" value="R
15a0: 65 62 75 69 6c 64 22 3e 0a 20 20 40 20 3c 2f 66  ebuild">.  @ </f
15b0: 6f 72 6d 3e 0a 20 20 40 20 3c 2f 62 6c 6f 63 6b  orm>.  @ </block
15c0: 71 75 6f 74 65 3e 0a 20 20 40 20 0a 20 20 40 20  quote>.  @ .  @ 
15d0: 3c 68 72 3e 3c 70 3e 53 68 75 6e 6e 65 64 20 41  <hr><p>Shunned A
15e0: 72 74 69 66 61 63 74 73 3a 3c 2f 70 3e 0a 20 20  rtifacts:</p>.  
15f0: 40 20 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20  @ <blockquote>. 
1600: 20 64 62 5f 70 72 65 70 61 72 65 28 26 71 2c 20   db_prepare(&q, 
1610: 0a 20 20 20 20 20 22 53 45 4c 45 43 54 20 75 75  .     "SELECT uu
1620: 69 64 2c 20 45 58 49 53 54 53 28 53 45 4c 45 43  id, EXISTS(SELEC
1630: 54 20 31 20 46 52 4f 4d 20 62 6c 6f 62 20 57 48  T 1 FROM blob WH
1640: 45 52 45 20 62 6c 6f 62 2e 75 75 69 64 3d 73 68  ERE blob.uuid=sh
1650: 75 6e 2e 75 75 69 64 29 22 0a 20 20 20 20 20 22  un.uuid)".     "
1660: 20 20 46 52 4f 4d 20 73 68 75 6e 20 4f 52 44 45    FROM shun ORDE
1670: 52 20 42 59 20 75 75 69 64 22 29 3b 0a 20 20 77  R BY uuid");.  w
1680: 68 69 6c 65 28 20 64 62 5f 73 74 65 70 28 26 71  hile( db_step(&q
1690: 29 3d 3d 53 51 4c 49 54 45 5f 52 4f 57 20 29 7b  )==SQLITE_ROW ){
16a0: 0a 20 20 20 20 63 6f 6e 73 74 20 63 68 61 72 20  .    const char 
16b0: 2a 7a 55 75 69 64 20 3d 20 64 62 5f 63 6f 6c 75  *zUuid = db_colu
16c0: 6d 6e 5f 74 65 78 74 28 26 71 2c 20 30 29 3b 0a  mn_text(&q, 0);.
16d0: 20 20 20 20 69 6e 74 20 73 74 69 6c 6c 45 78 69      int stillExi
16e0: 73 74 73 20 3d 20 64 62 5f 63 6f 6c 75 6d 6e 5f  sts = db_column_
16f0: 69 6e 74 28 26 71 2c 20 31 29 3b 0a 20 20 20 20  int(&q, 1);.    
1700: 63 6e 74 2b 2b 3b 0a 20 20 20 20 69 66 28 20 73  cnt++;.    if( s
1710: 74 69 6c 6c 45 78 69 73 74 73 20 29 7b 0a 20 20  tillExists ){.  
1720: 20 20 20 20 40 20 3c 62 3e 3c 61 20 68 72 65 66      @ <b><a href
1730: 3d 22 25 73 28 67 2e 7a 42 61 73 65 55 52 4c 29  ="%s(g.zBaseURL)
1740: 2f 61 72 74 69 66 61 63 74 2f 25 73 28 7a 55 75  /artifact/%s(zUu
1750: 69 64 29 22 3e 25 73 28 7a 55 75 69 64 29 3c 2f  id)">%s(zUuid)</
1760: 61 3e 3c 2f 62 3e 3c 62 72 3e 0a 20 20 20 20 7d  a></b><br>.    }
1770: 65 6c 73 65 7b 0a 20 20 20 20 20 20 40 20 3c 62  else{.      @ <b
1780: 3e 25 73 28 7a 55 75 69 64 29 3c 2f 62 3e 3c 62  >%s(zUuid)</b><b
1790: 72 3e 0a 20 20 20 20 7d 0a 20 20 7d 0a 20 20 69  r>.    }.  }.  i
17a0: 66 28 20 63 6e 74 3d 3d 30 20 29 7b 0a 20 20 20  f( cnt==0 ){.   
17b0: 20 40 20 3c 69 3e 6e 6f 20 61 72 74 69 66 61 63   @ <i>no artifac
17c0: 74 73 20 61 72 65 20 73 68 75 6e 6e 65 64 20 6f  ts are shunned o
17d0: 6e 20 74 68 69 73 20 73 65 72 76 65 72 3c 2f 69  n this server</i
17e0: 3e 0a 20 20 7d 0a 20 20 64 62 5f 66 69 6e 61 6c  >.  }.  db_final
17f0: 69 7a 65 28 26 71 29 3b 0a 20 20 40 20 3c 2f 62  ize(&q);.  @ </b
1800: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 20 20 73 74 79  lockquote>.  sty
1810: 6c 65 5f 66 6f 6f 74 65 72 28 29 3b 0a 7d 0a 0a  le_footer();.}..
1820: 2f 2a 0a 2a 2a 20 52 65 6d 6f 76 65 20 66 72 6f  /*.** Remove fro
1830: 6d 20 74 68 65 20 42 4c 4f 42 20 74 61 62 6c 65  m the BLOB table
1840: 20 61 6c 6c 20 61 72 74 69 66 61 63 74 73 20 74   all artifacts t
1850: 68 61 74 20 61 72 65 20 69 6e 20 74 68 65 20 53  hat are in the S
1860: 48 55 4e 20 74 61 62 6c 65 2e 0a 2a 2f 0a 76 6f  HUN table..*/.vo
1870: 69 64 20 73 68 75 6e 5f 61 72 74 69 66 61 63 74  id shun_artifact
1880: 73 28 76 6f 69 64 29 7b 0a 20 20 53 74 6d 74 20  s(void){.  Stmt 
1890: 71 3b 0a 20 20 64 62 5f 6d 75 6c 74 69 5f 65 78  q;.  db_multi_ex
18a0: 65 63 28 0a 20 20 20 20 20 22 43 52 45 41 54 45  ec(.     "CREATE
18b0: 20 54 45 4d 50 20 54 41 42 4c 45 20 74 6f 73 68   TEMP TABLE tosh
18c0: 75 6e 28 72 69 64 20 49 4e 54 45 47 45 52 20 50  un(rid INTEGER P
18d0: 52 49 4d 41 52 59 20 4b 45 59 29 3b 22 0a 20 20  RIMARY KEY);".  
18e0: 20 20 20 22 49 4e 53 45 52 54 20 49 4e 54 4f 20     "INSERT INTO 
18f0: 74 6f 73 68 75 6e 20 53 45 4c 45 43 54 20 72 69  toshun SELECT ri
1900: 64 20 46 52 4f 4d 20 62 6c 6f 62 2c 20 73 68 75  d FROM blob, shu
1910: 6e 20 57 48 45 52 45 20 62 6c 6f 62 2e 75 75 69  n WHERE blob.uui
1920: 64 3d 73 68 75 6e 2e 75 75 69 64 3b 22 0a 20 20  d=shun.uuid;".  
1930: 29 3b 0a 20 20 64 62 5f 70 72 65 70 61 72 65 28  );.  db_prepare(
1940: 26 71 2c 0a 20 20 20 20 20 22 53 45 4c 45 43 54  &q,.     "SELECT
1950: 20 72 69 64 20 46 52 4f 4d 20 64 65 6c 74 61 20   rid FROM delta 
1960: 57 48 45 52 45 20 73 72 63 69 64 20 49 4e 20 74  WHERE srcid IN t
1970: 6f 73 68 75 6e 22 0a 20 20 29 3b 0a 20 20 77 68  oshun".  );.  wh
1980: 69 6c 65 28 20 64 62 5f 73 74 65 70 28 26 71 29  ile( db_step(&q)
1990: 3d 3d 53 51 4c 49 54 45 5f 52 4f 57 20 29 7b 0a  ==SQLITE_ROW ){.
19a0: 20 20 20 20 69 6e 74 20 73 72 63 69 64 20 3d 20      int srcid = 
19b0: 64 62 5f 63 6f 6c 75 6d 6e 5f 69 6e 74 28 26 71  db_column_int(&q
19c0: 2c 20 30 29 3b 0a 20 20 20 20 63 6f 6e 74 65 6e  , 0);.    conten
19d0: 74 5f 75 6e 64 65 6c 74 61 28 73 72 63 69 64 29  t_undelta(srcid)
19e0: 3b 0a 20 20 7d 0a 20 20 64 62 5f 66 69 6e 61 6c  ;.  }.  db_final
19f0: 69 7a 65 28 26 71 29 3b 0a 20 20 64 62 5f 6d 75  ize(&q);.  db_mu
1a00: 6c 74 69 5f 65 78 65 63 28 0a 20 20 20 20 20 22  lti_exec(.     "
1a10: 44 45 4c 45 54 45 20 46 52 4f 4d 20 64 65 6c 74  DELETE FROM delt
1a20: 61 20 57 48 45 52 45 20 72 69 64 20 49 4e 20 74  a WHERE rid IN t
1a30: 6f 73 68 75 6e 3b 22 0a 20 20 20 20 20 22 44 45  oshun;".     "DE
1a40: 4c 45 54 45 20 46 52 4f 4d 20 62 6c 6f 62 20 57  LETE FROM blob W
1a50: 48 45 52 45 20 72 69 64 20 49 4e 20 74 6f 73 68  HERE rid IN tosh
1a60: 75 6e 3b 22 0a 20 20 20 20 20 22 44 52 4f 50 20  un;".     "DROP 
1a70: 54 41 42 4c 45 20 74 6f 73 68 75 6e 3b 22 0a 20  TABLE toshun;". 
1a80: 20 20 20 20 22 44 45 4c 45 54 45 20 46 52 4f 4d      "DELETE FROM
1a90: 20 70 72 69 76 61 74 65 20 22 0a 20 20 20 20 20   private ".     
1aa0: 22 20 57 48 45 52 45 20 4e 4f 54 20 45 58 49 53  " WHERE NOT EXIS
1ab0: 54 53 20 28 53 45 4c 45 43 54 20 31 20 46 52 4f  TS (SELECT 1 FRO
1ac0: 4d 20 62 6c 6f 62 20 57 48 45 52 45 20 72 69 64  M blob WHERE rid
1ad0: 3d 70 72 69 76 61 74 65 2e 72 69 64 29 3b 22 0a  =private.rid);".
1ae0: 20 20 29 3b 0a 7d 0a 0a 2f 2a 0a 2a 2a 20 57 45    );.}../*.** WE
1af0: 42 50 41 47 45 3a 20 72 63 76 66 72 6f 6d 6c 69  BPAGE: rcvfromli
1b00: 73 74 0a 2a 2a 0a 2a 2a 20 53 68 6f 77 20 61 20  st.**.** Show a 
1b10: 6c 69 73 74 69 6e 67 20 6f 66 20 52 43 56 46 52  listing of RCVFR
1b20: 4f 4d 20 74 61 62 6c 65 20 65 6e 74 72 69 65 73  OM table entries
1b30: 2e 0a 2a 2f 0a 76 6f 69 64 20 72 63 76 66 72 6f  ..*/.void rcvfro
1b40: 6d 6c 69 73 74 5f 70 61 67 65 28 76 6f 69 64 29  mlist_page(void)
1b50: 7b 0a 20 20 69 6e 74 20 6f 66 73 74 20 3d 20 61  {.  int ofst = a
1b60: 74 6f 69 28 50 44 28 22 6f 66 73 74 22 2c 22 30  toi(PD("ofst","0
1b70: 22 29 29 3b 0a 20 20 69 6e 74 20 63 6e 74 3b 0a  "));.  int cnt;.
1b80: 20 20 53 74 6d 74 20 71 3b 0a 0a 20 20 6c 6f 67    Stmt q;..  log
1b90: 69 6e 5f 63 68 65 63 6b 5f 63 72 65 64 65 6e 74  in_check_credent
1ba0: 69 61 6c 73 28 29 3b 0a 20 20 69 66 28 20 21 67  ials();.  if( !g
1bb0: 2e 6f 6b 41 64 6d 69 6e 20 29 7b 0a 20 20 20 20  .okAdmin ){.    
1bc0: 6c 6f 67 69 6e 5f 6e 65 65 64 65 64 28 29 3b 0a  login_needed();.
1bd0: 20 20 7d 0a 20 20 73 74 79 6c 65 5f 68 65 61 64    }.  style_head
1be0: 65 72 28 22 43 6f 6e 74 65 6e 74 20 53 6f 75 72  er("Content Sour
1bf0: 63 65 73 22 29 3b 0a 20 20 69 66 28 20 6f 66 73  ces");.  if( ofs
1c00: 74 3e 30 20 29 7b 0a 20 20 20 20 73 74 79 6c 65  t>0 ){.    style
1c10: 5f 73 75 62 6d 65 6e 75 5f 65 6c 65 6d 65 6e 74  _submenu_element
1c20: 28 22 4c 61 74 65 72 22 2c 20 22 4c 61 74 65 72  ("Later", "Later
1c30: 22 2c 20 22 72 63 76 66 72 6f 6d 6c 69 73 74 3f  ", "rcvfromlist?
1c40: 6f 66 73 74 3d 25 64 22 2c 0a 20 20 20 20 20 20  ofst=%d",.      
1c50: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1c60: 20 20 20 20 20 6f 66 73 74 3e 33 30 20 3f 20 6f       ofst>30 ? o
1c70: 66 73 74 2d 33 30 20 3a 20 30 29 3b 0a 20 20 7d  fst-30 : 0);.  }
1c80: 0a 20 20 64 62 5f 70 72 65 70 61 72 65 28 26 71  .  db_prepare(&q
1c90: 2c 20 0a 20 20 20 20 22 53 45 4c 45 43 54 20 72  , .    "SELECT r
1ca0: 63 76 69 64 2c 20 6c 6f 67 69 6e 2c 20 64 61 74  cvid, login, dat
1cb0: 65 74 69 6d 65 28 72 63 76 66 72 6f 6d 2e 6d 74  etime(rcvfrom.mt
1cc0: 69 6d 65 29 2c 20 72 63 76 66 72 6f 6d 2e 69 70  ime), rcvfrom.ip
1cd0: 61 64 64 72 22 0a 20 20 20 20 22 20 20 46 52 4f  addr".    "  FRO
1ce0: 4d 20 72 63 76 66 72 6f 6d 20 4c 45 46 54 20 4a  M rcvfrom LEFT J
1cf0: 4f 49 4e 20 75 73 65 72 20 55 53 49 4e 47 28 75  OIN user USING(u
1d00: 69 64 29 22 0a 20 20 20 20 22 20 4f 52 44 45 52  id)".    " ORDER
1d10: 20 42 59 20 72 63 76 69 64 20 44 45 53 43 20 4c   BY rcvid DESC L
1d20: 49 4d 49 54 20 33 31 20 4f 46 46 53 45 54 20 25  IMIT 31 OFFSET %
1d30: 64 22 2c 0a 20 20 20 20 6f 66 73 74 0a 20 20 29  d",.    ofst.  )
1d40: 3b 0a 20 20 40 20 3c 70 3e 57 68 65 6e 65 76 65  ;.  @ <p>Wheneve
1d50: 72 20 6e 65 77 20 61 72 74 69 66 61 63 74 73 20  r new artifacts 
1d60: 61 72 65 20 61 64 64 65 64 20 74 6f 20 74 68 65  are added to the
1d70: 20 72 65 70 6f 73 69 74 6f 72 79 2c 20 65 69 74   repository, eit
1d80: 68 65 72 20 62 79 0a 20 20 40 20 70 75 73 68 20  her by.  @ push 
1d90: 6f 72 20 75 73 69 6e 67 20 74 68 65 20 77 65 62  or using the web
1da0: 20 69 6e 74 65 72 66 61 63 65 2c 20 61 6e 20 65   interface, an e
1db0: 6e 74 72 79 20 69 73 20 6d 61 64 65 20 69 6e 20  ntry is made in 
1dc0: 74 68 65 20 52 43 56 46 52 4f 4d 20 74 61 62 6c  the RCVFROM tabl
1dd0: 65 0a 20 20 40 20 74 6f 20 72 65 63 6f 72 64 20  e.  @ to record 
1de0: 74 68 65 20 73 6f 75 72 63 65 20 6f 66 20 74 68  the source of th
1df0: 61 74 20 61 72 74 69 66 61 63 74 2e 20 20 54 68  at artifact.  Th
1e00: 69 73 20 6c 6f 67 20 66 61 63 69 6c 69 74 61 74  is log facilitat
1e10: 65 73 0a 20 20 40 20 66 69 6e 64 69 6e 67 20 61  es.  @ finding a
1e20: 6e 64 20 66 69 78 69 6e 67 20 61 74 74 65 6d 70  nd fixing attemp
1e30: 74 73 20 74 6f 20 69 6e 6a 65 63 74 20 69 6c 6c  ts to inject ill
1e40: 69 63 69 74 20 63 6f 6e 74 65 6e 74 20 69 6e 74  icit content int
1e50: 6f 20 74 68 65 0a 20 20 40 20 72 65 70 6f 73 69  o the.  @ reposi
1e60: 74 6f 72 79 2e 3c 2f 70 3e 0a 20 20 40 0a 20 20  tory.</p>.  @.  
1e70: 40 20 3c 70 3e 43 6c 69 63 6b 20 6f 6e 20 74 68  @ <p>Click on th
1e80: 65 20 22 72 63 76 69 64 22 20 74 6f 20 73 68 6f  e "rcvid" to sho
1e90: 77 20 61 20 6c 69 73 74 20 6f 66 20 73 70 65 63  w a list of spec
1ea0: 69 66 69 63 20 61 72 74 69 66 61 63 74 73 20 72  ific artifacts r
1eb0: 65 63 65 69 76 65 64 0a 20 20 40 20 62 79 20 61  eceived.  @ by a
1ec0: 20 74 72 61 6e 73 61 63 74 69 6f 6e 2e 20 20 41   transaction.  A
1ed0: 66 74 65 72 20 69 64 65 6e 74 69 66 79 69 6e 67  fter identifying
1ee0: 20 69 6c 6c 69 63 69 74 20 61 72 74 69 66 61 63   illicit artifac
1ef0: 74 73 2c 20 72 65 6d 6f 76 65 20 74 68 65 6d 0a  ts, remove them.
1f00: 20 20 40 20 75 73 69 6e 67 20 74 68 65 20 22 53    @ using the "S
1f10: 68 75 6e 22 20 66 65 61 74 75 72 65 2e 3c 2f 70  hun" feature.</p
1f20: 3e 0a 20 20 40 0a 20 20 40 20 3c 74 61 62 6c 65  >.  @.  @ <table
1f30: 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 30 20 63   cellpadding=0 c
1f40: 65 6c 6c 73 70 61 63 69 6e 67 3d 30 20 62 6f 72  ellspacing=0 bor
1f50: 64 65 72 3d 30 3e 0a 20 20 40 20 3c 74 72 3e 3c  der=0>.  @ <tr><
1f60: 74 68 3e 72 63 76 69 64 3c 2f 74 68 3e 3c 74 68  th>rcvid</th><th
1f70: 20 77 69 64 74 68 3d 31 35 3e 0a 20 20 40 20 20   width=15>.  @  
1f80: 20 20 20 3c 74 68 3e 44 61 74 65 3c 2f 74 68 3e     <th>Date</th>
1f90: 3c 74 68 20 77 69 64 74 68 3d 31 35 3e 3c 74 68  <th width=15><th
1fa0: 3e 55 73 65 72 3c 2f 74 68 3e 0a 20 20 40 20 20  >User</th>.  @  
1fb0: 20 20 20 3c 74 68 20 77 69 64 74 68 3d 31 35 3e     <th width=15>
1fc0: 3c 74 68 3e 49 50 26 6e 62 73 70 3b 41 64 64 72  <th>IP&nbsp;Addr
1fd0: 65 73 73 3c 2f 74 68 3e 3c 2f 74 72 3e 0a 20 20  ess</th></tr>.  
1fe0: 63 6e 74 20 3d 20 30 3b 0a 20 20 77 68 69 6c 65  cnt = 0;.  while
1ff0: 28 20 64 62 5f 73 74 65 70 28 26 71 29 3d 3d 53  ( db_step(&q)==S
2000: 51 4c 49 54 45 5f 52 4f 57 20 29 7b 0a 20 20 20  QLITE_ROW ){.   
2010: 20 69 6e 74 20 72 63 76 69 64 20 3d 20 64 62 5f   int rcvid = db_
2020: 63 6f 6c 75 6d 6e 5f 69 6e 74 28 26 71 2c 20 30  column_int(&q, 0
2030: 29 3b 0a 20 20 20 20 63 6f 6e 73 74 20 63 68 61  );.    const cha
2040: 72 20 2a 7a 55 73 65 72 20 3d 20 64 62 5f 63 6f  r *zUser = db_co
2050: 6c 75 6d 6e 5f 74 65 78 74 28 26 71 2c 20 31 29  lumn_text(&q, 1)
2060: 3b 0a 20 20 20 20 63 6f 6e 73 74 20 63 68 61 72  ;.    const char
2070: 20 2a 7a 44 61 74 65 20 3d 20 64 62 5f 63 6f 6c   *zDate = db_col
2080: 75 6d 6e 5f 74 65 78 74 28 26 71 2c 20 32 29 3b  umn_text(&q, 2);
2090: 0a 20 20 20 20 63 6f 6e 73 74 20 63 68 61 72 20  .    const char 
20a0: 2a 7a 49 70 41 64 64 72 20 3d 20 64 62 5f 63 6f  *zIpAddr = db_co
20b0: 6c 75 6d 6e 5f 74 65 78 74 28 26 71 2c 20 33 29  lumn_text(&q, 3)
20c0: 3b 0a 20 20 20 20 69 66 28 20 63 6e 74 3d 3d 33  ;.    if( cnt==3
20d0: 30 20 29 7b 0a 20 20 20 20 20 20 73 74 79 6c 65  0 ){.      style
20e0: 5f 73 75 62 6d 65 6e 75 5f 65 6c 65 6d 65 6e 74  _submenu_element
20f0: 28 22 45 61 72 6c 69 65 72 22 2c 20 22 45 61 72  ("Earlier", "Ear
2100: 6c 69 65 72 22 2c 0a 20 20 20 20 20 20 20 20 20  lier",.         
2110: 22 72 63 76 66 72 6f 6d 6c 69 73 74 3f 6f 66 73  "rcvfromlist?ofs
2120: 74 3d 25 64 22 2c 20 6f 66 73 74 2b 33 30 29 3b  t=%d", ofst+30);
2130: 0a 20 20 20 20 7d 65 6c 73 65 7b 0a 20 20 20 20  .    }else{.    
2140: 20 20 63 6e 74 2b 2b 3b 0a 20 20 20 20 20 20 40    cnt++;.      @
2150: 20 3c 74 72 3e 0a 20 20 20 20 20 20 40 20 3c 74   <tr>.      @ <t
2160: 64 3e 3c 61 20 68 72 65 66 3d 22 72 63 76 66 72  d><a href="rcvfr
2170: 6f 6d 3f 72 63 76 69 64 3d 25 64 28 72 63 76 69  om?rcvid=%d(rcvi
2180: 64 29 22 3e 25 64 28 72 63 76 69 64 29 3c 2f 61  d)">%d(rcvid)</a
2190: 3e 3c 2f 74 64 3e 3c 74 64 3e 0a 20 20 20 20 20  ></td><td>.     
21a0: 20 40 20 3c 74 64 3e 25 73 28 7a 44 61 74 65 29   @ <td>%s(zDate)
21b0: 3c 2f 74 64 3e 3c 74 64 3e 0a 20 20 20 20 20 20  </td><td>.      
21c0: 40 20 3c 74 64 3e 25 68 28 7a 55 73 65 72 29 3c  @ <td>%h(zUser)<
21d0: 2f 74 64 3e 3c 74 64 3e 0a 20 20 20 20 20 20 40  /td><td>.      @
21e0: 20 3c 74 64 3e 26 6e 62 73 70 3b 25 73 28 7a 49   <td>&nbsp;%s(zI
21f0: 70 41 64 64 72 29 26 6e 62 73 70 3c 2f 74 64 3e  pAddr)&nbsp</td>
2200: 0a 20 20 20 20 20 20 40 20 3c 2f 74 72 3e 0a 20  .      @ </tr>. 
2210: 20 20 20 7d 0a 20 20 7d 0a 20 20 64 62 5f 66 69     }.  }.  db_fi
2220: 6e 61 6c 69 7a 65 28 26 71 29 3b 0a 20 20 40 20  nalize(&q);.  @ 
2230: 3c 2f 74 61 62 6c 65 3e 0a 20 20 73 74 79 6c 65  </table>.  style
2240: 5f 66 6f 6f 74 65 72 28 29 3b 0a 7d 0a 0a 2f 2a  _footer();.}../*
2250: 0a 2a 2a 20 57 45 42 50 41 47 45 3a 20 72 63 76  .** WEBPAGE: rcv
2260: 66 72 6f 6d 0a 2a 2a 0a 2a 2a 20 53 68 6f 77 20  from.**.** Show 
2270: 61 20 73 69 6e 67 6c 65 20 52 43 56 46 52 4f 4d  a single RCVFROM
2280: 20 74 61 62 6c 65 20 65 6e 74 72 79 2e 0a 2a 2f   table entry..*/
2290: 0a 76 6f 69 64 20 72 63 76 66 72 6f 6d 5f 70 61  .void rcvfrom_pa
22a0: 67 65 28 76 6f 69 64 29 7b 0a 20 20 69 6e 74 20  ge(void){.  int 
22b0: 72 63 76 69 64 20 3d 20 61 74 6f 69 28 50 44 28  rcvid = atoi(PD(
22c0: 22 72 63 76 69 64 22 2c 22 30 22 29 29 3b 0a 20  "rcvid","0"));. 
22d0: 20 53 74 6d 74 20 71 3b 0a 0a 20 20 6c 6f 67 69   Stmt q;..  logi
22e0: 6e 5f 63 68 65 63 6b 5f 63 72 65 64 65 6e 74 69  n_check_credenti
22f0: 61 6c 73 28 29 3b 0a 20 20 69 66 28 20 21 67 2e  als();.  if( !g.
2300: 6f 6b 41 64 6d 69 6e 20 29 7b 0a 20 20 20 20 6c  okAdmin ){.    l
2310: 6f 67 69 6e 5f 6e 65 65 64 65 64 28 29 3b 0a 20  ogin_needed();. 
2320: 20 7d 0a 20 20 73 74 79 6c 65 5f 68 65 61 64 65   }.  style_heade
2330: 72 28 22 43 6f 6e 74 65 6e 74 20 53 6f 75 72 63  r("Content Sourc
2340: 65 20 25 64 22 2c 20 72 63 76 69 64 29 3b 0a 20  e %d", rcvid);. 
2350: 20 64 62 5f 70 72 65 70 61 72 65 28 26 71 2c 20   db_prepare(&q, 
2360: 0a 20 20 20 20 22 53 45 4c 45 43 54 20 6c 6f 67  .    "SELECT log
2370: 69 6e 2c 20 64 61 74 65 74 69 6d 65 28 72 63 76  in, datetime(rcv
2380: 66 72 6f 6d 2e 6d 74 69 6d 65 29 2c 20 72 63 76  from.mtime), rcv
2390: 66 72 6f 6d 2e 69 70 61 64 64 72 22 0a 20 20 20  from.ipaddr".   
23a0: 20 22 20 20 46 52 4f 4d 20 72 63 76 66 72 6f 6d   "  FROM rcvfrom
23b0: 20 4c 45 46 54 20 4a 4f 49 4e 20 75 73 65 72 20   LEFT JOIN user 
23c0: 55 53 49 4e 47 28 75 69 64 29 22 0a 20 20 20 20  USING(uid)".    
23d0: 22 20 57 48 45 52 45 20 72 63 76 69 64 3d 25 64  " WHERE rcvid=%d
23e0: 22 2c 0a 20 20 20 20 72 63 76 69 64 0a 20 20 29  ",.    rcvid.  )
23f0: 3b 0a 20 20 40 20 3c 74 61 62 6c 65 20 63 65 6c  ;.  @ <table cel
2400: 6c 73 70 61 63 69 6e 67 3d 31 35 20 63 65 6c 6c  lspacing=15 cell
2410: 70 61 64 64 69 6e 67 3d 30 20 62 6f 72 64 65 72  padding=0 border
2420: 3d 30 3e 0a 20 20 40 20 3c 74 72 3e 3c 74 64 20  =0>.  @ <tr><td 
2430: 76 61 6c 69 67 6e 3d 22 74 6f 70 22 20 61 6c 69  valign="top" ali
2440: 67 6e 3d 22 72 69 67 68 74 22 3e 3c 62 3e 72 63  gn="right"><b>rc
2450: 76 69 64 3a 3c 2f 62 3e 3c 2f 74 64 3e 0a 20 20  vid:</b></td>.  
2460: 40 20 3c 74 64 20 76 61 6c 69 67 6e 3d 22 74 6f  @ <td valign="to
2470: 70 22 3e 25 64 28 72 63 76 69 64 29 3c 2f 74 64  p">%d(rcvid)</td
2480: 3e 3c 2f 74 72 3e 0a 20 20 69 66 28 20 64 62 5f  ></tr>.  if( db_
2490: 73 74 65 70 28 26 71 29 3d 3d 53 51 4c 49 54 45  step(&q)==SQLITE
24a0: 5f 52 4f 57 20 29 7b 0a 20 20 20 20 63 6f 6e 73  _ROW ){.    cons
24b0: 74 20 63 68 61 72 20 2a 7a 55 73 65 72 20 3d 20  t char *zUser = 
24c0: 64 62 5f 63 6f 6c 75 6d 6e 5f 74 65 78 74 28 26  db_column_text(&
24d0: 71 2c 20 30 29 3b 0a 20 20 20 20 63 6f 6e 73 74  q, 0);.    const
24e0: 20 63 68 61 72 20 2a 7a 44 61 74 65 20 3d 20 64   char *zDate = d
24f0: 62 5f 63 6f 6c 75 6d 6e 5f 74 65 78 74 28 26 71  b_column_text(&q
2500: 2c 20 31 29 3b 0a 20 20 20 20 63 6f 6e 73 74 20  , 1);.    const 
2510: 63 68 61 72 20 2a 7a 49 70 41 64 64 72 20 3d 20  char *zIpAddr = 
2520: 64 62 5f 63 6f 6c 75 6d 6e 5f 74 65 78 74 28 26  db_column_text(&
2530: 71 2c 20 32 29 3b 0a 20 20 20 20 40 20 3c 74 72  q, 2);.    @ <tr
2540: 3e 3c 74 64 20 76 61 6c 69 67 6e 3d 22 74 6f 70  ><td valign="top
2550: 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e  " align="right">
2560: 3c 62 3e 55 73 65 72 3a 3c 2f 62 3e 3c 2f 74 64  <b>User:</b></td
2570: 3e 0a 20 20 20 20 40 20 3c 74 64 20 76 61 6c 69  >.    @ <td vali
2580: 67 6e 3d 22 74 6f 70 22 3e 25 73 28 7a 55 73 65  gn="top">%s(zUse
2590: 72 29 3c 2f 74 64 3e 3c 2f 74 72 3e 0a 20 20 20  r)</td></tr>.   
25a0: 20 40 20 3c 74 72 3e 3c 74 64 20 76 61 6c 69 67   @ <tr><td valig
25b0: 6e 3d 22 74 6f 70 22 20 61 6c 69 67 6e 3d 22 72  n="top" align="r
25c0: 69 67 68 74 22 3e 3c 62 3e 44 61 74 65 3a 3c 2f  ight"><b>Date:</
25d0: 62 3e 3c 2f 74 64 3e 0a 20 20 20 20 40 20 3c 74  b></td>.    @ <t
25e0: 64 20 76 61 6c 69 67 6e 3d 22 74 6f 70 22 3e 25  d valign="top">%
25f0: 73 28 7a 44 61 74 65 29 3c 2f 74 64 3e 3c 2f 74  s(zDate)</td></t
2600: 72 3e 0a 20 20 20 20 40 20 3c 74 72 3e 3c 74 64  r>.    @ <tr><td
2610: 20 76 61 6c 69 67 6e 3d 22 74 6f 70 22 20 61 6c   valign="top" al
2620: 69 67 6e 3d 22 72 69 67 68 74 22 3e 3c 62 3e 49  ign="right"><b>I
2630: 50 26 6e 62 73 70 3b 41 64 64 72 65 73 73 3a 3c  P&nbsp;Address:<
2640: 2f 62 3e 3c 2f 74 64 3e 0a 20 20 20 20 40 20 3c  /b></td>.    @ <
2650: 74 64 20 76 61 6c 69 67 6e 3d 22 74 6f 70 22 3e  td valign="top">
2660: 25 73 28 7a 49 70 41 64 64 72 29 3c 2f 74 64 3e  %s(zIpAddr)</td>
2670: 3c 2f 74 72 3e 0a 20 20 7d 0a 20 20 64 62 5f 66  </tr>.  }.  db_f
2680: 69 6e 61 6c 69 7a 65 28 26 71 29 3b 0a 20 20 64  inalize(&q);.  d
2690: 62 5f 70 72 65 70 61 72 65 28 26 71 2c 0a 20 20  b_prepare(&q,.  
26a0: 20 20 22 53 45 4c 45 43 54 20 72 69 64 2c 20 75    "SELECT rid, u
26b0: 75 69 64 2c 20 73 69 7a 65 20 46 52 4f 4d 20 62  uid, size FROM b
26c0: 6c 6f 62 20 57 48 45 52 45 20 72 63 76 69 64 3d  lob WHERE rcvid=
26d0: 25 64 22 2c 20 72 63 76 69 64 0a 20 20 29 3b 0a  %d", rcvid.  );.
26e0: 20 20 40 20 3c 74 72 3e 3c 74 64 20 76 61 6c 69    @ <tr><td vali
26f0: 67 6e 3d 22 74 6f 70 22 20 61 6c 69 67 6e 3d 22  gn="top" align="
2700: 72 69 67 68 74 22 3e 3c 62 3e 41 72 74 69 66 61  right"><b>Artifa
2710: 63 74 73 3a 3c 2f 62 3e 3c 2f 74 64 3e 0a 20 20  cts:</b></td>.  
2720: 40 20 3c 74 64 20 76 61 6c 69 67 6e 3d 22 74 6f  @ <td valign="to
2730: 70 22 3e 0a 20 20 77 68 69 6c 65 28 20 64 62 5f  p">.  while( db_
2740: 73 74 65 70 28 26 71 29 3d 3d 53 51 4c 49 54 45  step(&q)==SQLITE
2750: 5f 52 4f 57 20 29 7b 0a 20 20 20 20 69 6e 74 20  _ROW ){.    int 
2760: 72 69 64 20 3d 20 64 62 5f 63 6f 6c 75 6d 6e 5f  rid = db_column_
2770: 69 6e 74 28 26 71 2c 20 30 29 3b 0a 20 20 20 20  int(&q, 0);.    
2780: 63 6f 6e 73 74 20 63 68 61 72 20 2a 7a 55 75 69  const char *zUui
2790: 64 20 3d 20 64 62 5f 63 6f 6c 75 6d 6e 5f 74 65  d = db_column_te
27a0: 78 74 28 26 71 2c 20 31 29 3b 0a 20 20 20 20 69  xt(&q, 1);.    i
27b0: 6e 74 20 73 69 7a 65 20 3d 20 64 62 5f 63 6f 6c  nt size = db_col
27c0: 75 6d 6e 5f 69 6e 74 28 26 71 2c 20 32 29 3b 0a  umn_int(&q, 2);.
27d0: 20 20 20 20 40 20 3c 61 20 68 72 65 66 3d 22 25      @ <a href="%
27e0: 73 28 67 2e 7a 42 61 73 65 55 52 4c 29 2f 69 6e  s(g.zBaseURL)/in
27f0: 66 6f 2f 25 73 28 7a 55 75 69 64 29 22 3e 25 73  fo/%s(zUuid)">%s
2800: 28 7a 55 75 69 64 29 3c 2f 61 3e 0a 20 20 20 20  (zUuid)</a>.    
2810: 40 20 28 72 69 64 3a 20 25 64 28 72 69 64 29 2c  @ (rid: %d(rid),
2820: 20 73 69 7a 65 3a 20 25 64 28 73 69 7a 65 29 29   size: %d(size))
2830: 3c 62 72 3e 0a 20 20 7d 0a 20 20 40 20 3c 2f 74  <br>.  }.  @ </t
2840: 64 3e 3c 2f 74 72 3e 0a 20 20 40 20 3c 2f 74 61  d></tr>.  @ </ta
2850: 62 6c 65 3e 0a 7d 0a                             ble>.}.