Changes On Branch ssl
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch ssl Excluding Merge-Ins

This is equivalent to a diff from f51bd59613 to 8c23a947eb

2010-05-16
19:36
Merge support for HTTPS back into trunk. (It got lost during the conversion from GPL to BSD.) check-in: 68fa646f49 user: drh tags: trunk
2010-02-08
21:18
Merge the SSL branch into the trunk. check-in: b05cb4a0e1 user: drh tags: trunk
18:47
fossil rm can now remove entire directories. check-in: 6dbd362de9 user: jeremy_c tags: trunk
18:16
Merge recent changes into the dual-license branch. check-in: 14c19fbc1c user: drh tags: clear-title
18:12
Merge all the latest trunk changes into the SSL branch. Closed-Leaf check-in: 8c23a947eb user: drh tags: ssl
18:08
Check the graph for resize events every second and rerender the graph if a resize has occurred. This fixes display problems on Safari and also keeps the graph consistent with resized browser windows. check-in: f51bd59613 user: drh tags: trunk
16:58
Fix a bug in timeline graph generation. check-in: 399d1ca000 user: drh tags: trunk
2010-01-24
22:35
Pull in the latest changes from trunk. check-in: 97311bd9d5 user: drh tags: ssl

Changes to Makefile.

    13     13   #
    14     14   BCC = gcc -g -O2
    15     15   
    16     16   #### The suffix to add to executable files.  ".exe" for windows.
    17     17   #    Nothing for unix.
    18     18   #
    19     19   E =
           20  +
           21  +#### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
           22  +#
           23  +FOSSIL_ENABLE_SSL=1
    20     24   
    21     25   #### C Compile and options for use in building executables that 
    22     26   #    will run on the target platform.  This is usually the same
    23     27   #    as BCC, unless you are cross-compiling.  This C compiler builds
    24     28   #    the finished binary for fossil.  The BCC compiler above is used
    25     29   #    for building intermediate code-generator tools.
    26     30   #
    27     31   #TCC = gcc -O6
    28     32   #TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
    29     33   TCC = gcc -g -Os -Wall
           34  +
           35  +# With HTTPS support
           36  +ifdef FOSSIL_ENABLE_SSL
           37  +TCC += -DFOSSIL_ENABLE_SSL=1
           38  +endif
    30     39   
    31     40   #### Extra arguments for linking the finished binary.  Fossil needs
    32     41   #    to link against the Z-Lib compression library.  There are no
    33     42   #    other dependencies.  We sometimes add the -static option here
    34     43   #    so that we can build a static executable that will run in a
    35     44   #    chroot jail.
    36     45   #
    37     46   LIB = -lz $(LDFLAGS)
    38     47   # If you're on OpenSolaris:
    39     48   # LIB += lsocket
    40     49   # Solaris 10 needs:
    41     50   # LIB += -lsocket -lnsl
    42     51   # My assumption is that the Sol10 flags will work for Sol8/9 and possibly 11.
    43         -
           52  +# 
           53  +# OpenSSL:
           54  +ifdef FOSSIL_ENABLE_SSL
           55  +LIB += -lcrypto -lssl
           56  +endif
    44     57   
    45     58   #### Tcl shell for use in running the fossil testsuite.
    46     59   #
    47     60   TCLSH = tclsh
    48     61   
    49     62   #### Include a configuration file that can override any one of these settings.
    50     63   #
    51     64   -include config.mak
    52     65   
    53     66   # You should not need to change anything below this line
    54     67   ###############################################################################
    55     68   include $(SRCDIR)/main.mk

Changes to Makefile.w32.

    13     13   #
    14     14   BCC = gcc -g -O2
    15     15   
    16     16   #### The suffix to add to executable files.  ".exe" for windows.
    17     17   #    Nothing for unix.
    18     18   #
    19     19   E = .exe
           20  +
           21  +#### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
           22  +#
           23  +# FOSSIL_ENABLE_SSL=1
    20     24   
    21     25   #### C Compile and options for use in building executables that 
    22     26   #    will run on the target platform.  This is usually the same
    23     27   #    as BCC, unless you are cross-compiling.  This C compiler builds
    24     28   #    the finished binary for fossil.  The BCC compiler above is used
    25     29   #    for building intermediate code-generator tools.
    26     30   #
    27     31   #TCC = gcc -O6
    28     32   #TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
    29     33   #TCC = gcc -g -Os -Wall
    30     34   #TCC = gcc -g -Os -Wall -DFOSSIL_I18N=0 -L/usr/local/lib -I/usr/local/include
    31     35   TCC = gcc -Os -Wall -DFOSSIL_I18N=0 -L/mingw/lib -I/mingw/include
           36  +
           37  +# With HTTPS support
           38  +ifdef FOSSIL_ENABLE_SSL
           39  +TCC += -DFOSSIL_ENABLE_SSL=1
           40  +endif
    32     41   
    33     42   #### Extra arguments for linking the finished binary.  Fossil needs
    34     43   #    to link against the Z-Lib compression library.  There are no
    35     44   #    other dependencies.  We sometimes add the -static option here
    36     45   #    so that we can build a static executable that will run in a
    37     46   #    chroot jail.
    38     47   #
    39     48   #LIB = -lz
    40     49   #LIB = -lz -lws2_32
    41     50   LIB = -lmingwex -lz -lws2_32
           51  +# OpenSSL:
           52  +ifdef FOSSIL_ENABLE_SSL
           53  +LIB += -lcrypto -lssl
           54  +endif
    42     55   
    43     56   #### Tcl shell for use in running the fossil testsuite.
    44     57   #
    45     58   TCLSH = tclsh
    46     59   
    47     60   #### Include a configuration file that can override any one of these settings.
    48     61   #
    49     62   -include config.w32
    50     63   
    51     64   # You should not need to change anything below this line
    52     65   ###############################################################################
    53     66   include $(SRCDIR)/main.mk

Added src/http_ssl.c.

            1  +/*
            2  +** Copyright (c) 2009 D. Richard Hipp
            3  +**
            4  +** This program is free software; you can redistribute it and/or
            5  +** modify it under the terms of the GNU General Public
            6  +** License version 2 as published by the Free Software Foundation.
            7  +**
            8  +** This program is distributed in the hope that it will be useful,
            9  +** but WITHOUT ANY WARRANTY; without even the implied warranty of
           10  +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
           11  +** General Public License for more details.
           12  +** 
           13  +** You should have received a copy of the GNU General Public
           14  +** License along with this library; if not, write to the
           15  +** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
           16  +** Boston, MA  02111-1307, USA.
           17  +**
           18  +** Author contact information:
           19  +**   drh@hwaci.com
           20  +**   http://www.hwaci.com/drh/
           21  +**
           22  +*******************************************************************************
           23  +**
           24  +** This file manages low-level SSL communications.
           25  +**
           26  +** This file implements a singleton.  A single SSL connection may be active
           27  +** at a time.  State information is stored in static variables.  The identity
           28  +** of the server is held in global variables that are set by url_parse().
           29  +**
           30  +** SSL support is abstracted out into this module because Fossil can
           31  +** be compiled without SSL support (which requires OpenSSL library)
           32  +*/
           33  +
           34  +#include "config.h"
           35  +
           36  +#ifdef FOSSIL_ENABLE_SSL
           37  +
           38  +#include <openssl/bio.h>
           39  +#include <openssl/ssl.h>
           40  +#include <openssl/err.h>
           41  +
           42  +#include "http_ssl.h"
           43  +#include <assert.h>
           44  +#include <sys/types.h>
           45  +
           46  +/*
           47  +** There can only be a single OpenSSL IO connection open at a time.
           48  +** State information about that IO is stored in the following
           49  +** local variables:
           50  +*/
           51  +static int sslIsInit = 0;    /* True after global initialization */
           52  +static BIO *iBio;            /* OpenSSL I/O abstraction */
           53  +static char *sslErrMsg = 0;  /* Text of most recent OpenSSL error */
           54  +static SSL_CTX *sslCtx;      /* SSL context */
           55  +static SSL *ssl;
           56  +
           57  +
           58  +/*
           59  +** Clear the SSL error message
           60  +*/
           61  +static void ssl_clear_errmsg(void){
           62  +  free(sslErrMsg);
           63  +  sslErrMsg = 0;
           64  +}
           65  +
           66  +/*
           67  +** Set the SSL error message.
           68  +*/
           69  +void ssl_set_errmsg(char *zFormat, ...){
           70  +  va_list ap;
           71  +  ssl_clear_errmsg();
           72  +  va_start(ap, zFormat);
           73  +  sslErrMsg = vmprintf(zFormat, ap);
           74  +  va_end(ap);
           75  +}
           76  +
           77  +/*
           78  +** Return the current SSL error message
           79  +*/
           80  +const char *ssl_errmsg(void){
           81  +  return sslErrMsg;
           82  +}
           83  +
           84  +/*
           85  +** Call this routine once before any other use of the SSL interface.
           86  +** This routine does initial configuration of the SSL module.
           87  +*/
           88  +void ssl_global_init(void){
           89  +  if( sslIsInit==0 ){
           90  +    SSL_library_init();
           91  +    SSL_load_error_strings();
           92  +    ERR_load_BIO_strings();
           93  +    OpenSSL_add_all_algorithms();    
           94  +    sslCtx = SSL_CTX_new(SSLv23_client_method());
           95  +    sslIsInit = 1;
           96  +  }
           97  +}
           98  +
           99  +/*
          100  +** Call this routine to shutdown the SSL module prior to program exit.
          101  +*/
          102  +void ssl_global_shutdown(void){
          103  +  if( sslIsInit ){
          104  +    SSL_CTX_free(sslCtx);
          105  +    ssl_clear_errmsg();
          106  +    sslIsInit = 0;
          107  +  }
          108  +}
          109  +
          110  +/*
          111  +** Close the currently open SSL connection.  If no connection is open, 
          112  +** this routine is a no-op.
          113  +*/
          114  +void ssl_close(void){
          115  +  if( iBio!=NULL ){
          116  +    BIO_reset(iBio);
          117  +    BIO_free_all(iBio);
          118  +  }
          119  +}
          120  +
          121  +/*
          122  +** Open an SSL connection.  The identify of the server is determined
          123  +** by global varibles that are set using url_parse():
          124  +**
          125  +**    g.urlName       Name of the server.  Ex: www.fossil-scm.org
          126  +**    g.urlPort       TCP/IP port to use.  Ex: 80
          127  +**
          128  +** Return the number of errors.
          129  +*/
          130  +int ssl_open(void){
          131  +  X509 *cert;
          132  +  int hasSavedCertificate = 0;
          133  +
          134  +  ssl_global_init();
          135  +
          136  +  /* Get certificate for current server from global config and
          137  +   * (if we have it in config) add it to certificate store.
          138  +   */
          139  +  cert = ssl_get_certificate();
          140  +  if ( cert!=NULL ){
          141  +    X509_STORE_add_cert(SSL_CTX_get_cert_store(sslCtx), cert);
          142  +    X509_free(cert);
          143  +    hasSavedCertificate = 1;
          144  +  }
          145  +
          146  +  iBio = BIO_new_ssl_connect(sslCtx);
          147  +  BIO_get_ssl(iBio, &ssl);
          148  +  SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
          149  +  if( iBio==NULL ) {
          150  +    ssl_set_errmsg("SSL: cannot open SSL (%s)", 
          151  +                    ERR_reason_error_string(ERR_get_error()));
          152  +    return 1;    
          153  +  }
          154  +  
          155  +  char *connStr = mprintf("%s:%d", g.urlName, g.urlPort);
          156  +  BIO_set_conn_hostname(iBio, connStr);
          157  +  free(connStr);
          158  +  
          159  +  if( BIO_do_connect(iBio)<=0 ){
          160  +    ssl_set_errmsg("SSL: cannot connect to host %s:%d (%s)", 
          161  +        g.urlName, g.urlPort, ERR_reason_error_string(ERR_get_error()));
          162  +    ssl_close();
          163  +    return 1;
          164  +  }
          165  +  
          166  +  if( BIO_do_handshake(iBio)<=0 ) {
          167  +    ssl_set_errmsg("Error establishing SSL connection %s:%d (%s)", 
          168  +        g.urlName, g.urlPort, ERR_reason_error_string(ERR_get_error()));
          169  +    ssl_close();
          170  +    return 1;
          171  +  }
          172  +  /* Check if certificate is valid */
          173  +  cert = SSL_get_peer_certificate(ssl);
          174  +
          175  +  if ( cert==NULL ){
          176  +    ssl_set_errmsg("No SSL certificate was presented by the peer");
          177  +    ssl_close();
          178  +    return 1;
          179  +  }
          180  +
          181  +  if( SSL_get_verify_result(ssl) != X509_V_OK ){
          182  +    char *desc, *prompt;
          183  +    BIO *mem;
          184  +    
          185  +    mem = BIO_new(BIO_s_mem());
          186  +    X509_NAME_print_ex(mem, X509_get_subject_name(cert), 2, XN_FLAG_MULTILINE);
          187  +    BIO_puts(mem, "\n\nIssued By:\n\n");
          188  +    X509_NAME_print_ex(mem, X509_get_issuer_name(cert), 2, XN_FLAG_MULTILINE);
          189  +    BIO_write(mem, "", 1); // null-terminate mem buffer
          190  +    BIO_get_mem_data(mem, &desc);
          191  +    
          192  +    char *warning = "";
          193  +    if( hasSavedCertificate ){
          194  +      warning = "WARNING: Certificate doesn't match the "
          195  +                "saved certificate for this host!";
          196  +    }
          197  +    prompt = mprintf("\nUnknown SSL certificate:\n\n%s\n\n%s\n"
          198  +                     "Accept certificate [a=always/y/N]? ", desc, warning);
          199  +    BIO_free(mem);
          200  +
          201  +    Blob ans;
          202  +    blob_zero(&ans);
          203  +    prompt_user(prompt, &ans);
          204  +    free(prompt);
          205  +    if( blob_str(&ans)[0]!='y' && blob_str(&ans)[0]!='a' ) {
          206  +      X509_free(cert);
          207  +      ssl_set_errmsg("SSL certificate declined");
          208  +      ssl_close();
          209  +      return 1;
          210  +    }
          211  +    if( blob_str(&ans)[0]=='a' ) {
          212  +      ssl_save_certificate(cert);
          213  +    }
          214  +  }
          215  +  X509_free(cert);
          216  +  return 0;
          217  +}
          218  +
          219  +/*
          220  +** Save certificate to global config.
          221  +*/
          222  +void ssl_save_certificate(X509 *cert){
          223  +  BIO *mem;
          224  +  char *zCert, *zHost;
          225  +
          226  +  mem = BIO_new(BIO_s_mem());
          227  +  PEM_write_bio_X509(mem, cert);
          228  +  BIO_write(mem, "", 1); // null-terminate mem buffer
          229  +  BIO_get_mem_data(mem, &zCert);
          230  +  zHost = mprintf("cert:%s", g.urlName);
          231  +  db_set(zHost, zCert, 1);
          232  +  free(zHost);
          233  +  BIO_free(mem);  
          234  +}
          235  +
          236  +/*
          237  +** Get certificate for g.urlName from global config.
          238  +** Return NULL if no certificate found.
          239  +*/
          240  +X509 *ssl_get_certificate(void){
          241  +  char *zHost, *zCert;
          242  +  BIO *mem;
          243  +  X509 *cert;
          244  +
          245  +  zHost = mprintf("cert:%s", g.urlName);
          246  +  zCert = db_get(zHost, NULL);
          247  +  free(zHost);
          248  +  if ( zCert==NULL )
          249  +    return NULL;
          250  +  mem = BIO_new(BIO_s_mem());
          251  +  BIO_puts(mem, zCert);
          252  +  cert = PEM_read_bio_X509(mem, NULL, 0, NULL);
          253  +  free(zCert);
          254  +  BIO_free(mem);  
          255  +  return cert;
          256  +}
          257  +
          258  +/*
          259  +** Send content out over the SSL connection.
          260  +*/
          261  +size_t ssl_send(void *NotUsed, void *pContent, size_t N){
          262  +  size_t sent;
          263  +  size_t total = 0;
          264  +  while( N>0 ){
          265  +    sent = BIO_write(iBio, pContent, N);
          266  +    if( sent<=0 ) break;
          267  +    total += sent;
          268  +    N -= sent;
          269  +    pContent = (void*)&((char*)pContent)[sent];
          270  +  }
          271  +  return total;
          272  +}
          273  +
          274  +/*
          275  +** Receive content back from the SSL connection.
          276  +*/
          277  +size_t ssl_receive(void *NotUsed, void *pContent, size_t N){
          278  +  size_t got;
          279  +  size_t total = 0;
          280  +  while( N>0 ){
          281  +    got = BIO_read(iBio, pContent, N);
          282  +    if( got<=0 ) break;
          283  +    total += got;
          284  +    N -= got;
          285  +    pContent = (void*)&((char*)pContent)[got];
          286  +  }
          287  +  return total;
          288  +}
          289  +
          290  +#endif /* FOSSIL_ENABLE_SSL */

Changes to src/http_transport.c.

    47     47     0, 0, 0, 0, 0, 0, 0
    48     48   };
    49     49   
    50     50   /*
    51     51   ** Return the current transport error message.
    52     52   */
    53     53   const char *transport_errmsg(void){
           54  +  #ifdef FOSSIL_ENABLE_SSL
           55  +  if( g.urlIsHttps ){
           56  +    return ssl_errmsg();
           57  +  }
           58  +  #endif
    54     59     return socket_errmsg();
    55     60   }
    56     61   
    57     62   /*
    58     63   ** Retrieve send/receive counts from the transport layer.  If "resetFlag"
    59     64   ** is true, then reset the counts.
    60     65   */
................................................................................
    77     82   **
    78     83   ** Return the number of errors.
    79     84   */
    80     85   int transport_open(void){
    81     86     int rc = 0;
    82     87     if( transport.isOpen==0 ){
    83     88       if( g.urlIsHttps ){
    84         -      socket_set_errmsg("HTTPS: is not yet implemented");
           89  +      #ifdef FOSSIL_ENABLE_SSL
           90  +      rc = ssl_open();
           91  +      if( rc==0 ) transport.isOpen = 1;
           92  +      #else
           93  +      socket_set_errmsg("HTTPS: Fossil has been compiled without SSL support");
    85     94         rc = 1;
           95  +      #endif
    86     96       }else if( g.urlIsFile ){
    87     97         sqlite3_uint64 iRandId;
    88     98         sqlite3_randomness(sizeof(iRandId), &iRandId);
    89     99         transport.zOutFile = mprintf("%s-%llu-out.http", 
    90    100                                          g.zRepositoryName, iRandId);
    91    101         transport.zInFile = mprintf("%s-%llu-in.http", 
    92    102                                          g.zRepositoryName, iRandId);
................................................................................
   110    120     if( transport.isOpen ){
   111    121       free(transport.pBuf);
   112    122       transport.pBuf = 0;
   113    123       transport.nAlloc = 0;
   114    124       transport.nUsed = 0;
   115    125       transport.iCursor = 0;
   116    126       if( g.urlIsHttps ){
   117         -      /* TBD */
          127  +      #ifdef FOSSIL_ENABLE_SSL
          128  +      ssl_close();
          129  +      #endif
   118    130       }else if( g.urlIsFile ){
   119    131         if( transport.pFile ){ 
   120    132           fclose(transport.pFile);
   121    133           transport.pFile = 0;
   122    134         }
   123    135         unlink(transport.zInFile);
   124    136         unlink(transport.zOutFile);
................................................................................
   135    147   ** Send content over the wire.
   136    148   */
   137    149   void transport_send(Blob *toSend){
   138    150     char *z = blob_buffer(toSend);
   139    151     int n = blob_size(toSend);
   140    152     transport.nSent += n;
   141    153     if( g.urlIsHttps ){
   142         -    /* TBD */
          154  +    #ifdef FOSSIL_ENABLE_SSL
          155  +    int sent;
          156  +    while( n>0 ){
          157  +      sent = ssl_send(0, z, n);
          158  +      /* printf("Sent %d of %d bytes\n", sent, n); fflush(stdout); */
          159  +      if( sent<=0 ) break;
          160  +      n -= sent;
          161  +    }    
          162  +    #endif
   143    163     }else if( g.urlIsFile ){
   144    164       fwrite(z, 1, n, transport.pFile);
   145    165     }else{
   146    166       int sent;
   147    167       while( n>0 ){
   148    168         sent = socket_send(0, z, n);
   149    169         /* printf("Sent %d of %d bytes\n", sent, n); fflush(stdout); */
................................................................................
   202    222       N -= toMove;
   203    223       zBuf += toMove;
   204    224       nByte += toMove;
   205    225     }
   206    226     if( N>0 ){
   207    227       int got;
   208    228       if( g.urlIsHttps ){
   209         -      /* TBD */
          229  +      #ifdef FOSSIL_ENABLE_SSL
          230  +      got = ssl_receive(0, zBuf, N);
          231  +      /* printf("received %d of %d bytes\n", got, N); fflush(stdout); */
          232  +      #else
   210    233         got = 0;
          234  +      #endif
   211    235       }else if( g.urlIsFile ){
   212    236         got = fread(zBuf, 1, N, transport.pFile);
   213    237       }else{
   214    238         got = socket_receive(0, zBuf, N);
   215    239         /* printf("received %d of %d bytes\n", got, N); fflush(stdout); */
   216    240       }
   217    241       if( got>0 ){
................................................................................
   291    315         break;
   292    316       }
   293    317       i++;
   294    318     }
   295    319     /* printf("Got line: [%s]\n", &transport.pBuf[iStart]); */
   296    320     return &transport.pBuf[iStart];
   297    321   }
          322  +
          323  +void transport_global_shutdown(void){
          324  +  if( g.urlIsHttps ){
          325  +    #ifdef FOSSIL_ENABLE_SSL
          326  +    ssl_global_shutdown();
          327  +    #endif
          328  +  }else{
          329  +    socket_global_shutdown();
          330  +  }
          331  +}

Changes to src/main.mk.

    38     38     $(SRCDIR)/doc.c \
    39     39     $(SRCDIR)/encode.c \
    40     40     $(SRCDIR)/file.c \
    41     41     $(SRCDIR)/finfo.c \
    42     42     $(SRCDIR)/graph.c \
    43     43     $(SRCDIR)/http.c \
    44     44     $(SRCDIR)/http_socket.c \
           45  +  $(SRCDIR)/http_ssl.c \
    45     46     $(SRCDIR)/http_transport.c \
    46     47     $(SRCDIR)/info.c \
    47     48     $(SRCDIR)/login.c \
    48     49     $(SRCDIR)/main.c \
    49     50     $(SRCDIR)/manifest.c \
    50     51     $(SRCDIR)/md5.c \
    51     52     $(SRCDIR)/merge.c \
................................................................................
   110    111     doc_.c \
   111    112     encode_.c \
   112    113     file_.c \
   113    114     finfo_.c \
   114    115     graph_.c \
   115    116     http_.c \
   116    117     http_socket_.c \
          118  +  http_ssl_.c \
   117    119     http_transport_.c \
   118    120     info_.c \
   119    121     login_.c \
   120    122     main_.c \
   121    123     manifest_.c \
   122    124     md5_.c \
   123    125     merge_.c \
................................................................................
   182    184     doc.o \
   183    185     encode.o \
   184    186     file.o \
   185    187     finfo.o \
   186    188     graph.o \
   187    189     http.o \
   188    190     http_socket.o \
          191  +  http_ssl.o \
   189    192     http_transport.o \
   190    193     info.o \
   191    194     login.o \
   192    195     main.o \
   193    196     manifest.o \
   194    197     md5.o \
   195    198     merge.o \
................................................................................
   265    268   #
   266    269   $(SRCDIR)/../manifest:	
   267    270   	# noop
   268    271   
   269    272   clean:	
   270    273   	rm -f *.o *_.c $(APPNAME) VERSION.h
   271    274   	rm -f translate makeheaders mkindex page_index.h headers
   272         -	rm -f add.h allrepo.h bag.h blob.h branch.h browse.h captcha.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h construct.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h file.h finfo.h graph.h http.h http_socket.h http_transport.h info.h login.h main.h manifest.h md5.h merge.h merge3.h name.h pivot.h pqueue.h printf.h rebuild.h report.h rss.h rstats.h schema.h search.h setup.h sha1.h shun.h skins.h stat.h style.h sync.h tag.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h
          275  +	rm -f add.h allrepo.h bag.h blob.h branch.h browse.h captcha.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h construct.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h file.h finfo.h graph.h http.h http_socket.h http_ssl.h http_transport.h info.h login.h main.h manifest.h md5.h merge.h merge3.h name.h pivot.h pqueue.h printf.h rebuild.h report.h rss.h rstats.h schema.h search.h setup.h sha1.h shun.h skins.h stat.h style.h sync.h tag.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h
   273    276   
   274    277   page_index.h: $(TRANS_SRC) mkindex
   275    278   	./mkindex $(TRANS_SRC) >$@
   276    279   headers:	page_index.h makeheaders VERSION.h
   277         -	./makeheaders  add_.c:add.h allrepo_.c:allrepo.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h file_.c:file.h finfo_.c:finfo.h graph_.c:graph.h http_.c:http.h http_socket_.c:http_socket.h http_transport_.c:http_transport.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h rstats_.c:rstats.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h
          280  +	./makeheaders  add_.c:add.h allrepo_.c:allrepo.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h construct_.c:construct.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h file_.c:file.h finfo_.c:finfo.h graph_.c:graph.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h rstats_.c:rstats.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h
   278    281   	touch headers
   279    282   headers: Makefile
   280    283   Makefile:
   281    284   add_.c:	$(SRCDIR)/add.c translate
   282    285   	./translate $(SRCDIR)/add.c >add_.c
   283    286   
   284    287   add.o:	add_.c add.h  $(SRCDIR)/config.h
................................................................................
   477    480   http_socket_.c:	$(SRCDIR)/http_socket.c translate
   478    481   	./translate $(SRCDIR)/http_socket.c >http_socket_.c
   479    482   
   480    483   http_socket.o:	http_socket_.c http_socket.h  $(SRCDIR)/config.h
   481    484   	$(XTCC) -o http_socket.o -c http_socket_.c
   482    485   
   483    486   http_socket.h:	headers
          487  +http_ssl_.c:	$(SRCDIR)/http_ssl.c translate
          488  +	./translate $(SRCDIR)/http_ssl.c >http_ssl_.c
          489  +
          490  +http_ssl.o:	http_ssl_.c http_ssl.h  $(SRCDIR)/config.h
          491  +	$(XTCC) -o http_ssl.o -c http_ssl_.c
          492  +
          493  +http_ssl.h:	headers
   484    494   http_transport_.c:	$(SRCDIR)/http_transport.c translate
   485    495   	./translate $(SRCDIR)/http_transport.c >http_transport_.c
   486    496   
   487    497   http_transport.o:	http_transport_.c http_transport.h  $(SRCDIR)/config.h
   488    498   	$(XTCC) -o http_transport.o -c http_transport_.c
   489    499   
   490    500   http_transport.h:	headers

Changes to src/makemake.tcl.

    73     73     verify
    74     74     vfile
    75     75     wiki
    76     76     wikiformat
    77     77     winhttp
    78     78     xfer
    79     79     zip
           80  +  http_ssl
    80     81   }
    81     82   
    82     83   # Name of the final application
    83     84   #
    84     85   set name fossil
    85     86   
    86     87   puts {# DO NOT EDIT

Changes to src/xfer.c.

  1313   1313       /* If this is a clone, the go at least two rounds */
  1314   1314       if( cloneFlag && nCycle==1 ) go = 1;
  1315   1315     };
  1316   1316     transport_stats(&nSent, &nRcvd, 1);
  1317   1317     printf("Total network traffic: %d bytes sent, %d bytes received\n",
  1318   1318            nSent, nRcvd);
  1319   1319     transport_close();
  1320         -  socket_global_shutdown();
         1320  +  transport_global_shutdown();
  1321   1321     db_multi_exec("DROP TABLE onremote");
  1322   1322     manifest_crosslink_end();
  1323   1323     db_end_transaction(0);
  1324   1324   }