Changeset 2476
- Timestamp:
- 08/19/07 14:23:50 (1 year ago)
- Files:
-
- plugins/opie-sync/src/opie-sync (modified) (1 diff)
- plugins/opie-sync/src/opie_comms.c (modified) (21 diffs)
- plugins/opie-sync/src/opie_sync.c (modified) (6 diffs)
- plugins/opie-sync/src/opie_sync.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/opie-sync/src/opie-sync
r2440 r2476 3 3 <username>root</username> 4 4 <password>rootme</password> 5 < url>192.168.0.202</url>5 <hostname>192.168.0.202</hostname> 6 6 <device>opie</device> 7 7 <port>4242</port> plugins/opie-sync/src/opie_comms.c
r2474 r2476 554 554 CURLcode res; 555 555 556 if (env-> url&& env->username && env->password )556 if (env->host && env->username && env->password ) 557 557 { 558 558 char* separator_path; … … 576 576 env->username, 577 577 env->password, 578 env-> url,578 env->host, 579 579 env->device_port, 580 580 separator_path, … … 645 645 gchar **direntries; 646 646 647 if (env-> url&& env->username && env->password )647 if (env->host && env->username && env->password ) 648 648 { 649 649 char* separator_path; … … 666 666 env->username, 667 667 env->password, 668 env-> url,668 env->host, 669 669 env->device_port, 670 670 separator_path); … … 753 753 char *ftpurl; 754 754 755 if (env-> url&& env->username && env->password )755 if (env->host && env->username && env->password ) 756 756 { 757 757 if ( env->use_qcop ) … … 788 788 env->username, 789 789 env->password, 790 env-> url,790 env->host, 791 791 env->device_port, 792 792 separator_path); … … 803 803 env->username, 804 804 env->password, 805 env-> url,805 env->host, 806 806 env->device_port, 807 807 separator_path, … … 971 971 char* separator_path; 972 972 973 if (env-> url&& env->username && env->password )973 if (env->host && env->username && env->password ) 974 974 { 975 975 if ( env->use_qcop ) … … 991 991 env->username, 992 992 env->password, 993 env-> url,993 env->host, 994 994 env->device_port, 995 995 separator_path, … … 1054 1054 TempFile *tmpfile = NULL; 1055 1055 1056 if(env-> url&& env->device_port && env->username) {1056 if(env->host && env->device_port && env->username) { 1057 1057 /* We have to close the temp file, because we want 1058 1058 scp to be able to write to it */ … … 1066 1066 scpcommand = g_strdup_printf("ssh -o BatchMode=yes %s@%s \"ls %s > /dev/null\"", 1067 1067 env->username, 1068 env-> url,1068 env->host, 1069 1069 remotefile); 1070 1070 … … 1083 1083 scpcommand = g_strdup_printf("scp -q -B %s@%s:%s %s", 1084 1084 env->username, 1085 env-> url,1085 env->host, 1086 1086 remotefile, 1087 1087 tmpfile->filename); … … 1170 1170 scpcommand = g_strdup_printf("ssh -o BatchMode=yes %s@%s \"mkdir -p %s\"", 1171 1171 env->username, 1172 env-> url,1172 env->host, 1173 1173 dirname); 1174 1174 g_free(dirname); … … 1187 1187 tmpfile->filename, 1188 1188 env->username, 1189 env-> url,1189 env->host, 1190 1190 remotefile); 1191 1191 … … 1234 1234 int scpretval, scpexitstatus; 1235 1235 1236 if(env-> url&& env->device_port && env->username) {1236 if(env->host && env->device_port && env->username) { 1237 1237 char* separator_path; 1238 1238 if ( env->use_qcop ) … … 1268 1268 scpcommand = g_strdup_printf("ssh -o BatchMode=yes %s@%s \"ls %s*.txt > /dev/null\"", 1269 1269 env->username, 1270 env-> url,1270 env->host, 1271 1271 separator_path); 1272 1272 … … 1285 1285 scpcommand = g_strdup_printf("scp -p -q -B %s@%s:%s*.txt %s", 1286 1286 env->username, 1287 env-> url,1287 env->host, 1288 1288 separator_path, 1289 1289 temppath); … … 1333 1333 char *separator_path = NULL; 1334 1334 1335 if(env-> url&& env->device_port && env->username) {1335 if(env->host && env->device_port && env->username) { 1336 1336 if ( env->use_qcop ) 1337 1337 { … … 1370 1370 scpcommand = g_strdup_printf("ssh -o BatchMode=yes %s@%s \"mkdir -p %s\"", 1371 1371 env->username, 1372 env-> url,1372 env->host, 1373 1373 separator_path); 1374 1374 … … 1387 1387 temppath, 1388 1388 env->username, 1389 env-> url,1389 env->host, 1390 1390 separator_path); 1391 1391 … … 1425 1425 scpcommand = g_strdup_printf("ssh -o BatchMode=yes %s@%s \"cd %s && rm -f %s\"", 1426 1426 env->username, 1427 env-> url,1427 env->host, 1428 1428 separator_path, 1429 1429 deletedfiles->str); plugins/opie-sync/src/opie_sync.c
r2472 r2476 54 54 env->username = g_strdup("root"); 55 55 env->password = g_strdup("rootme"); 56 env-> url= g_strdup("192.168.0.202");56 env->host = g_strdup("192.168.0.202"); 57 57 env->device_type = OPIE_SYNC_OPIE; 58 58 env->conn_type = OPIE_CONN_FTP; … … 93 93 g_free(env->password); 94 94 env->password = g_strdup(str); 95 } else if (!xmlStrcmp(cur->name, (const xmlChar *)"hostname")) { 96 g_free(env->host); 97 env->host = g_strdup(str); 95 98 } else if (!xmlStrcmp(cur->name, (const xmlChar *)"url")) { 96 g_free(env->url); 97 env->url = g_strdup(str); 99 osync_trace(TRACE_INTERNAL, "The 'url' configuration parameter is deprecated - please use 'hostname' instead"); 100 g_free(env->host); 101 env->host = g_strdup(str); 98 102 } else if (!xmlStrcmp(cur->name, (const xmlChar *)"port")) { 99 103 env->device_port = atoi(str); … … 159 163 /* Connect to QCopBridgeServer to lock GUI and get root path */ 160 164 osync_trace(TRACE_INTERNAL, "qcop_connect"); 161 env->qcopconn = qcop_connect(env-> url,165 env->qcopconn = qcop_connect(env->host, 162 166 env->username, 163 167 env->password); … … 257 261 char *errmsg; 258 262 device_disconnect(env->plugin_env, &error); 259 errmsg = g_strdup_printf("Failed to load data from device %s", env->plugin_env-> url);263 errmsg = g_strdup_printf("Failed to load data from device %s", env->plugin_env->host); 260 264 osync_error_set(&error, OSYNC_ERROR_GENERIC, errmsg); 261 265 g_free(errmsg); … … 522 526 if ( !opie_put_sink(env) ) { 523 527 osync_trace( TRACE_INTERNAL, "opie_connect_and_put failed" ); 524 char *errmsg = g_strdup_printf( "Failed to send data to device %s", env->plugin_env-> url); /* FIXME specify which data */528 char *errmsg = g_strdup_printf( "Failed to send data to device %s", env->plugin_env->host ); /* FIXME specify which data */ 525 529 osync_error_set(&error, OSYNC_ERROR_GENERIC, errmsg); 526 530 g_free(errmsg); … … 669 673 g_free(env->username); 670 674 g_free(env->password); 671 g_free(env-> url);675 g_free(env->host); 672 676 g_free(env->localdir); 673 677 g_free(env); plugins/opie-sync/src/opie_sync.h
r2472 r2476 62 62 gchar* username; 63 63 gchar* password; 64 gchar* url;64 gchar* host; 65 65 unsigned int device_port; 66 66 OPIE_CONN_TYPE conn_type;
