Changes On Branch msw-hack
Not logged in

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

Changes In Branch msw-hack Excluding Merge-Ins

This is equivalent to a diff from 8d703ff956 to a67e2683ed

2011-09-08
13:02
Merge fixes and refactoring from symlinks branch. check-in: c05f6afaf2 user: dmitry tags: trunk
11:52
Merge latest trunk into symlinks branch. check-in: 981e5c62e3 user: dmitry tags: symlinks
2011-09-07
08:12
Make it easier to use Events as quick notes: Display the title just above the text on Event pages. If there's no title in the wiki text, use the comment as a title. Leaf check-in: 27a4518e13 user: ben tags: ben-minorchanges
03:51
begin work on ticket [bc0d0f5642eaf]: track success of (network) write operations and start bubbling that status up. To make it up to ultimately exit(EXIT_FAILURE) on errors, mkindex will need to be updated, too, as well as the signature from command implementing functions need to return int instead of void at some point. More to come. Leaf check-in: a67e2683ed user: martin.weber tags: msw-hack
2011-09-06
20:12
catch up with trunk. Remove C++ style comments from http_ssl.c. check-in: 0f1c41bc20 user: martin.weber tags: msw-hack
13:23
Close A and LI tags when displaying new and deleted files in timeline. check-in: 8d703ff956 user: dmitry tags: trunk
2011-09-04
01:28
Update the built-in SQLite to the latest 3.7.8-alpha version that contains the improved merge-sort logic. check-in: 0cf5416002 user: drh tags: trunk

Changes to src/http.c.

188
189
190
191
192
193
194
195

196

197
198
199
200
201
202
203
    transport_log(out);
    free(zOutFile);
  }

  /*
  ** Send the request to the server.
  */
  transport_send(&hdr);

  transport_send(&payload);

  blob_reset(&hdr);
  blob_reset(&payload);
  transport_flip();
  
  /*
  ** Read and interpret the server reply
  */







|
>
|
>







188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
    transport_log(out);
    free(zOutFile);
  }

  /*
  ** Send the request to the server.
  */
  if (transport_send(&hdr))
	goto write_err;
  if (transport_send(&payload))
	goto write_err;
  blob_reset(&hdr);
  blob_reset(&payload);
  transport_flip();
  
  /*
  ** Read and interpret the server reply
  */

Changes to src/http_ssl.c.

247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
    BIO_puts(mem, "\n\nSHA1 Fingerprint:\n\n ");
    if(X509_digest(cert, EVP_sha1(), md, &mdLength)){
      int j;
      for( j = 0; j < mdLength; ++j ) {
        BIO_printf(mem, " %02x", md[j]);
      }
    }
    BIO_write(mem, "", 1); // null-terminate mem buffer
    BIO_get_mem_data(mem, &desc);
    
    if( hasSavedCertificate ){
      warning = "WARNING: Certificate doesn't match the "
                "saved certificate for this host!";
    }
    prompt = mprintf("\nUnknown SSL certificate:\n\n%s\n\n%s\n"







|







247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
    BIO_puts(mem, "\n\nSHA1 Fingerprint:\n\n ");
    if(X509_digest(cert, EVP_sha1(), md, &mdLength)){
      int j;
      for( j = 0; j < mdLength; ++j ) {
        BIO_printf(mem, " %02x", md[j]);
      }
    }
    BIO_write(mem, "", 1); /* null-terminate mem buffer */
    BIO_get_mem_data(mem, &desc);
    
    if( hasSavedCertificate ){
      warning = "WARNING: Certificate doesn't match the "
                "saved certificate for this host!";
    }
    prompt = mprintf("\nUnknown SSL certificate:\n\n%s\n\n%s\n"
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
*/
void ssl_save_certificate(X509 *cert){
  BIO *mem;
  char *zCert, *zHost;

  mem = BIO_new(BIO_s_mem());
  PEM_write_bio_X509(mem, cert);
  BIO_write(mem, "", 1); // null-terminate mem buffer
  BIO_get_mem_data(mem, &zCert);
  zHost = mprintf("cert:%s", g.urlName);
  db_set(zHost, zCert, 1);
  free(zHost);
  BIO_free(mem);  
}








|







302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
*/
void ssl_save_certificate(X509 *cert){
  BIO *mem;
  char *zCert, *zHost;

  mem = BIO_new(BIO_s_mem());
  PEM_write_bio_X509(mem, cert);
  BIO_write(mem, "", 1); /* null-terminate mem buffer */
  BIO_get_mem_data(mem, &zCert);
  zHost = mprintf("cert:%s", g.urlName);
  db_set(zHost, zCert, 1);
  free(zHost);
  BIO_free(mem);  
}

Changes to src/http_transport.c.

257
258
259
260
261
262
263



264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281

282
283
284
285

286
287
288
289
290
291
292

293
294


295
296
297
298
299
300
301
    }
    transport.isOpen = 0;
  }
}

/*
** Send content over the wire.



*/
void transport_send(Blob *toSend){
  char *z = blob_buffer(toSend);
  int n = blob_size(toSend);
  transport.nSent += n;
  if( g.urlIsSsh ){
    int sent;
    sent = fwrite(z, 1, n, sshOut);
    fflush(sshOut);
    /* printf("sent %d of %d bytes\n", sent, n); fflush(stdout); */
  }else if( g.urlIsHttps ){
    #ifdef FOSSIL_ENABLE_SSL
    int sent;
    while( n>0 ){
      sent = ssl_send(0, z, n);
      /* printf("Sent %d of %d bytes\n", sent, n); fflush(stdout); */
      if( sent<=0 ) break;
      n -= sent;

    }    
    #endif
  }else if( g.urlIsFile ){
    fwrite(z, 1, n, transport.pFile);

  }else{
    int sent;
    while( n>0 ){
      sent = socket_send(0, z, n);
      /* printf("Sent %d of %d bytes\n", sent, n); fflush(stdout); */
      if( sent<=0 ) break;
      n -= sent;

    }
  }


}

/*
** This routine is called when the outbound message is complete and
** it is time to being recieving a reply.
*/
void transport_flip(void){







>
>
>

|


|

<
|

|








>



|
>







>


>
>







257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272

273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
    }
    transport.isOpen = 0;
  }
}

/*
** Send content over the wire.
** Returns whether sending was errant, i.e.,
** the count of bytes written onto the wire does
** not equal the size of the blob being sent.
*/
int transport_send(Blob *toSend){
  char *z = blob_buffer(toSend);
  int n = blob_size(toSend);
  size_t written = 0;
  if( g.urlIsSsh ){

    written = fwrite(z, 1, n, sshOut);
    fflush(sshOut);
    /* printf("sent %d of %d bytes\n", (unsigned long) written, n); fflush(stdout); */
  }else if( g.urlIsHttps ){
    #ifdef FOSSIL_ENABLE_SSL
    int sent;
    while( n>0 ){
      sent = ssl_send(0, z, n);
      /* printf("Sent %d of %d bytes\n", sent, n); fflush(stdout); */
      if( sent<=0 ) break;
      n -= sent;
      written += sent;
    }    
    #endif
  }else if( g.urlIsFile ){
    written = fwrite(z, 1, n, transport.pFile);
    /* printf("written %d of %d bytes\n", (unsigned long) written, n); fflush(stdout); */
  }else{
    int sent;
    while( n>0 ){
      sent = socket_send(0, z, n);
      /* printf("Sent %d of %d bytes\n", sent, n); fflush(stdout); */
      if( sent<=0 ) break;
      n -= sent;
      written += sent;
    }
  }
  transport.nSent += written;
  return (blob_size(toSend) != written);
}

/*
** This routine is called when the outbound message is complete and
** it is time to being recieving a reply.
*/
void transport_flip(void){

Changes to src/xfer.c.

1711
1712
1713
1714
1715
1716
1717
1718

1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729

    /* Stop the cycle if the server sends a "clone_seqno 0" card and
    ** we have gone at least two rounds.  Always go at least two rounds
    ** on a clone in order to be sure to retrieve the configuration
    ** information which is only sent on the second round.
    */
    if( cloneSeqno<=0 && nCycle>1 ) go = 0;   
  };

  transport_stats(&nSent, &nRcvd, 1);
  fossil_print("Total network traffic: %lld bytes sent, %lld bytes received\n",
               nSent, nRcvd);
  transport_close();
  transport_global_shutdown();
  db_multi_exec("DROP TABLE onremote");
  manifest_crosslink_end();
  content_enable_dephantomize(1);
  db_end_transaction(0);
  return nErr;
}







<
>











1711
1712
1713
1714
1715
1716
1717

1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729

    /* Stop the cycle if the server sends a "clone_seqno 0" card and
    ** we have gone at least two rounds.  Always go at least two rounds
    ** on a clone in order to be sure to retrieve the configuration
    ** information which is only sent on the second round.
    */
    if( cloneSeqno<=0 && nCycle>1 ) go = 0;   

  }
  transport_stats(&nSent, &nRcvd, 1);
  fossil_print("Total network traffic: %lld bytes sent, %lld bytes received\n",
               nSent, nRcvd);
  transport_close();
  transport_global_shutdown();
  db_multi_exec("DROP TABLE onremote");
  manifest_crosslink_end();
  content_enable_dephantomize(1);
  db_end_transaction(0);
  return nErr;
}