Fossil

Diff
Login

Diff

Differences From Artifact [0e1aa871ca]:

To Artifact [c1b226ecc2]:


777
778
779
780
781
782
783
784
785


786
787
788
789
790
791
792
777
778
779
780
781
782
783


784
785
786
787
788
789
790
791
792







-
-
+
+







  page_xfer();
  printf("%s\n", cgi_extract_content(&notUsed));
}

/*
** Format strings for progress reporting.
*/
static const char zLabel[] = "%-10s %10s %10s %10s %10s %10s\n";
static const char zValue[] = "\r%-10s %10d %10d %10d %10d %10d\n";
static const char zLabelFormat[] = "%-10s %10s %10s %10s %10s\n";
static const char zValueFormat[] = "\r%-10s %10d %10d %10d %10d\n";


/*
** Sync to the host identified in g.urlName and g.urlPath.  This
** routine is called by the client.
**
** Records are pushed to the server if pushFlag is true.  Records
838
839
840
841
842
843
844
845

846
847
848
849
850
851
852
838
839
840
841
842
843
844

845
846
847
848
849
850
851
852







-
+







    blob_appendf(&send, "pull %s %s\n", zSCode, zPCode);
    nCard++;
  }
  if( pushFlag ){
    blob_appendf(&send, "push %s %s\n", zSCode, zPCode);
    nCard++;
  }
  printf(zLabel, "", "Bytes", "Cards", "Artifacts", "Deltas", "Dangling");
  printf(zLabelFormat, "", "Bytes", "Cards", "Artifacts", "Deltas");

  while( go ){
    int newPhantom = 0;

    /* Send make the most recently received cookie.  Let the server
    ** figure out if this is a cookie that it cares about.
    */
864
865
866
867
868
869
870
871

872
873

874
875
876
877
878
879
880
864
865
866
867
868
869
870

871
872

873
874
875
876
877
878
879
880







-
+

-
+







    if( pushFlag ){
      send_unsent(&xfer);
      nCard += send_unclustered(&xfer);
    }

    /* Exchange messages with the server */
    nFileSend = xfer.nFileSent + xfer.nDeltaSent;
    printf(zValue, "Send:",
    printf(zValueFormat, "Send:",
            blob_size(&send), nCard+xfer.nGimmeSent+xfer.nIGotSent,
            xfer.nFileSent, xfer.nDeltaSent, 0);
            xfer.nFileSent, xfer.nDeltaSent);
#if 0
    printf("Sent:      %10d bytes, %5d cards, %5d files (%d+%d)\n",
            blob_size(&send), nCard+xfer.nGimmeSent+xfer.nIGotSent,
            nFileSend, xfer.nFileSent, xfer.nDeltaSent);
#endif
    nCard = 0;
    xfer.nFileSent = 0;
1025
1026
1027
1028
1029
1030
1031
1032

1033
1034

1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1025
1026
1027
1028
1029
1030
1031

1032
1033

1034






1035
1036
1037
1038
1039
1040
1041







-
+

-
+
-
-
-
-
-
-








      if( blob_size(&xfer.err) ){
        fossil_fatal("%b", &xfer.err);
      }
      blobarray_reset(xfer.aToken, xfer.nToken);
      blob_reset(&xfer.line);
    }
    printf(zValue, "Received:",
    printf(zValueFormat, "Received:",
            blob_size(&recv), nCard,
            xfer.nFileRcvd, xfer.nDeltaRcvd, xfer.nDanglingFile);
            xfer.nFileRcvd, xfer.nDeltaRcvd + xfer.nDanglingFile);
#if 0
    printf("\rReceived:  %10d bytes, %5d cards, %5d files (%d+%d+%d)\n",
            blob_size(&recv), nCard,
            xfer.nFileRcvd + xfer.nDeltaRcvd + xfer.nDanglingFile,
            xfer.nFileRcvd, xfer.nDeltaRcvd, xfer.nDanglingFile);
#endif
    blob_reset(&recv);
    nCycle++;
    go = 0;

    /* If we received one or more files on the previous exchange but
    ** there are still phantoms, then go another round.
    */