Fossil

Diff
Login

Differences From Artifact [9a2f4ed6dd]:

To Artifact [b2f0d4e0e0]:


89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
89
90
91
92
93
94
95

96
97
98
99
100
101
102

103
104
105
106
107
108
109







-







-







** SSH initialization of the transport layer
*/
int transport_ssh_open(void){
  /* For SSH we need to create and run SSH fossil http 
  ** to talk to the remote machine.
  */
  static int fPrintSshCmd = 1;  /* Print SSH command only once */
  const char *zSshFossilCmd;    /* Path to fossil on remote host */
  const char *zSsh;  /* The base SSH command */
  Blob zCmd;         /* The SSH command */
  char *zHost;       /* The host name to contact */
  int n;             /* Size of prefix string */

  socket_ssh_resolve_addr();
  zSsh = db_get("ssh-command", zDefaultSshCmd);
  zSshFossilCmd = db_get("ssh-fossil", "fossil");
  blob_init(&zCmd, zSsh, -1);
  if( g.urlPort!=g.urlDfltPort && g.urlPort ){
#ifdef __MINGW32__
    blob_appendf(&zCmd, " -P %d", g.urlPort);
#else
    blob_appendf(&zCmd, " -p %d", g.urlPort);
#endif
119
120
121
122
123
124
125
126

127
128
129
130

131
132
133
134
135
136
137
138
117
118
119
120
121
122
123

124




125

126
127
128
129
130
131
132







-
+
-
-
-
-
+
-







  }else{
    zHost = mprintf("%s", g.urlName);
  }
  n = blob_size(&zCmd);
  blob_append(&zCmd, " ", 1);
  shell_escape(&zCmd, zHost);
  blob_append(&zCmd, " ", 1);
  shell_escape(&zCmd, mprintf("%s", zSshFossilCmd));
  shell_escape(&zCmd, mprintf("%s", g.urlFossil));
  if( url_ssh_use_http() ){
    blob_append(&zCmd, " http", 5);
  }else{
    blob_append(&zCmd, " test-http", 10);
  blob_append(&zCmd, " test-http", 10);
  }
  if( g.urlPath && g.urlPath[0] ){
    blob_append(&zCmd, " ", 1);
    shell_escape(&zCmd, mprintf("%s", g.urlPath));
  }
  if( fPrintSshCmd ){
    fossil_print("%s\n", blob_str(&zCmd)+n);  /* Show tail of SSH command */
    fPrintSshCmd = 0;