Changeset 14389 for titan/plugins/networkbrowser
- Timestamp:
- 03/02/12 23:11:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/networkbrowser/networkbrowser.h
r14388 r14389 311 311 sharedir = ostrcat(sharedir, "/sharedir", 1, 0); 312 312 } else if ( mode == 2 ){ 313 sharedir = ostrcat(sharedir, "sharedir", 1, 0); 313 // work 314 // sharedir = ostrcat(sharedir, "sharedir", 1, 0); 314 315 } 315 316 } … … 324 325 } 325 326 } 326 if (ipaddresse == NULL){ 327 ipaddresse = ostrcat(ipaddresse, "192.168.0.1", 1, 0); 328 } 329 if (username == NULL){ 327 if (ipaddresse == NULL) 328 ipaddresse = ostrcat(ipaddresse, "192.168.178.1", 1, 0); 329 if (ftpport == NULL) 330 ftpport = ostrcat(ftpport, "21", 1, 0); 331 if (username == NULL) 330 332 username = ostrcat(username, "username", 1, 0); 331 } 332 if (password == NULL){ 333 if (password == NULL) 333 334 password = ostrcat(password, "password", 1, 0); 334 } 335 if (protocol == NULL){ 335 if (protocol == NULL) 336 336 protocol = ostrcat(protocol, "udp", 1, 0); 337 } 338 if (rsize == NULL){ 337 if (rsize == NULL) 339 338 rsize = ostrcat(rsize, "32768", 1, 0); 340 } 341 if (wsize == NULL){ 339 if (wsize == NULL) 342 340 wsize = ostrcat(wsize, "32768", 1, 0); 343 } 344 if (options == NULL){ 341 if (options == NULL) 345 342 options = ostrcat(options, "rw,nolock", 1, 0); 346 } 347 if (hddreplacement == NULL){ 343 if (hddreplacement == NULL) 348 344 hddreplacement = ostrcat(hddreplacement, "0", 1, 0); 349 } 350 if (options1 == NULL){ 345 if (options1 == NULL) 351 346 options1 = ostrcat(options1, "allow_other", 1, 0); 352 } 353 if (options2 == NULL){ 347 if (options2 == NULL) 354 348 options2 = ostrcat(options2, "nonempty", 1, 0); 355 } 356 if (proxy == NULL){ 349 if (proxy == NULL) 357 350 proxy = ostrcat(proxy, "socks5", 1, 0); 358 } 359 if (proxyip == NULL){ 360 proxyip = ostrcat(proxyip, "proxyip", 1, 0); 361 } 362 if (proxyport == NULL){ 363 proxyport = ostrcat(proxyport, "proxyport", 1, 0); 364 } 365 if (proxyuser == NULL){ 351 if (proxyip == NULL) 352 proxyip = ostrcat(proxyip, "12.23.45.67", 1, 0); 353 if (proxyport == NULL) 354 proxyport = ostrcat(proxyport, "8080", 1, 0); 355 if (proxyuser == NULL) 366 356 proxyuser = ostrcat(proxyuser, "proxyuser", 1, 0); 367 } 368 if (proxypass == NULL){ 357 if (proxypass == NULL) 369 358 proxypass = ostrcat(proxypass, "proxypass", 1, 0); 370 } 371 if (ssl == NULL){ 359 if (ssl == NULL) 372 360 ssl = ostrcat(ssl, "ssl_try", 1, 0); 373 } 374 if (proxyauth == NULL){ 361 if (proxyauth == NULL) 375 362 proxyauth = ostrcat(proxyauth, "0", 1, 0); 376 } 377 if (userauth == NULL){ 363 if (userauth == NULL) 378 364 userauth = ostrcat(userauth, "0", 1, 0); 379 } 380 if (usessl == NULL){ 365 if (usessl == NULL) 381 366 usessl = ostrcat(usessl, "0", 1, 0); 382 } 383 if (useproxy == NULL){ 367 if (useproxy == NULL) 384 368 useproxy = ostrcat(useproxy, "0", 1, 0); 385 }386 369 387 370 tmp_wsize = ostrcat(tmp_wsize, wsize, 1, 0); … … 500 483 setchoiceboxselection(skin_userauth, userauth); 501 484 502 addchoicebox(skin_proxyauth, "0", "0");485 addchoicebox(skin_proxyauth, "0", _("no")); 503 486 addchoicebox(skin_proxyauth, "1", _("yes")); 504 487 setchoiceboxselection(skin_proxyauth, proxyauth); … … 1423 1406 tmpstr5 = ostrcat("", tmp_check, 0, 0); 1424 1407 ret5 = strsplit(tmpstr5, "\\:", &count5); 1425 tmp_proxyip = ostrcat("", (&ret5[0])->part, 0, 0); 1426 tmp_proxyport = ostrcat("", (&ret5[1])->part, 0, 0); 1408 if(count5 > 0) 1409 tmp_proxyip = ostrcat("", (&ret5[0])->part, 0, 0); 1410 if(count5 > 1) 1411 tmp_proxyport = ostrcat("", (&ret5[1])->part, 0, 0); 1427 1412 free(ret5); ret5 = NULL; 1428 1413 … … 1474 1459 tmp_options2 = ostrcat("", (&ret3[7])->part, 0, 0); 1475 1460 1476 if(string_find(",nonempty,ssl_try",(&ret2[1])->part)){ 1477 tmp_ssl = ostrcat("", (&ret3[8])->part, 0, 0); 1461 if(count2 > 1 && string_find(",nonempty,ssl_try",(&ret2[1])->part)){ 1462 if(count3 > 8) 1463 tmp_ssl = ostrcat("", (&ret3[8])->part, 0, 0); 1478 1464 tmp_usessl = ostrcat("", "1", 0, 0); 1479 } else if(string_find(",nonempty,ssl_control",(&ret2[1])->part)){ 1480 tmp_ssl = ostrcat("", (&ret3[8])->part, 0, 0); 1465 } else if(count2 > 1 && string_find(",nonempty,ssl_control",(&ret2[1])->part)){ 1466 if(count3 > 8) 1467 tmp_ssl = ostrcat("", (&ret3[8])->part, 0, 0); 1481 1468 tmp_usessl = ostrcat("", "1", 0, 0); 1482 } else if(string_find(",nonempty,ssl",(&ret2[1])->part)){ 1483 tmp_ssl = ostrcat("", (&ret3[8])->part, 0, 0); 1469 } else if(count2 > 1 && string_find(",nonempty,ssl",(&ret2[1])->part)){ 1470 if(count3 > 8) 1471 tmp_ssl = ostrcat("", (&ret3[8])->part, 0, 0); 1484 1472 tmp_usessl = ostrcat("", "1", 0, 0); 1485 1473 } … … 1488 1476 } 1489 1477 1490 if( string_find("@",(&ret2[2])->part)){1478 if(count2 > 2 && string_find("@",(&ret2[2])->part)){ 1491 1479 tmp_userauth = ostrcat("", "1", 0, 0); 1492 1480 debug(70, "foundf ftpuser with userauth"); … … 1500 1488 tmpstr9 = ostrcat("", (&ret8[0])->part, 0, 0); 1501 1489 ret9 = strsplit(tmpstr9, "/\\:", &count9); 1502 tmp_user = ostrcat("", (&ret9[1])->part, 0, 0); 1503 tmp_pass = ostrcat("", (&ret9[2])->part, 0, 0); 1490 if(count9 > 1) 1491 tmp_user = ostrcat("", (&ret9[1])->part, 0, 0); 1492 if(count9 > 2) 1493 tmp_pass = ostrcat("", (&ret9[2])->part, 0, 0); 1504 1494 1505 1495 tmp_check = ostrcat("", (&ret8[1])->part, 0, 0); … … 1508 1498 tmpstr10 = ostrcat("", tmp_check, 0, 0); 1509 1499 ret10 = strsplit(tmpstr10, "\\:", &count10); 1510 tmp_ipaddresse = ostrcat("", (&ret10[0])->part, 0, 0); 1500 if(count10 > 0) 1501 tmp_ipaddresse = ostrcat("", (&ret10[0])->part, 0, 0); 1511 1502 1512 1503 struct splitstr* ret11 = NULL; … … 1514 1505 tmpstr11 = ostrcat("", (&ret10[1])->part, 0, 0); 1515 1506 ret11 = strsplit(tmpstr11, "/", &count11); 1516 tmp_ftpport = ostrcat("", (&ret11[0])->part, 0, 0); 1517 tmp_sharedir = ostrcat("", (&ret11[1])->part, 0, 0); 1507 if(count11 > 0) 1508 tmp_ftpport = ostrcat("", (&ret11[0])->part, 0, 0); 1509 if(count11 > 1) 1510 tmp_sharedir = ostrcat("", (&ret11[1])->part, 0, 0); 1518 1511 1519 1512 free(ret9); ret9 = NULL; … … 1521 1514 free(ret11); ret11 = NULL; 1522 1515 } else { 1523 debug(70, "found fftpuser without userauth");1516 debug(70, "found ftpuser without userauth"); 1524 1517 struct splitstr* ret12 = NULL; 1525 1518 int count12 = 0; 1526 1519 tmpstr12 = ostrcat("", (&ret2[2])->part, 0, 0); 1527 ret12= strsplit(tmpstr12, "/\\:", &count12); 1528 1529 tmp_ipaddresse = ostrcat("", (&ret12[1])->part, 0, 0); 1530 tmp_ftpport = ostrcat("", (&ret12[2])->part, 0, 0); 1531 tmp_sharedir = ostrcat("", (&ret12[3])->part, 0, 0); 1520 ret12= strsplit(tmpstr12, "/\\:", &count12);; 1521 if(count12 > 1) 1522 tmp_ipaddresse = ostrcat("", (&ret12[1])->part, 0, 0); 1523 if(count12 > 2) 1524 tmp_ftpport = ostrcat("", (&ret12[2])->part, 0, 0); 1525 if(count12 > 3) 1526 tmp_sharedir = ostrcat("", (&ret12[3])->part, 0, 0); 1532 1527 free(ret12); ret12 = NULL; 1533 1528 } … … 1535 1530 tmp_sharename = ostrcat("", (&ret2[0])->part, 0, 0); 1536 1531 1537 if( ostrcmp((&ret2[0])->part, input_sharename) == 0){1532 if(count2 > 0 && ostrcmp((&ret2[0])->part, input_sharename) == 0){ 1538 1533 update = 0; 1539 1534 } else { … … 1546 1541 sharelist = ostrcat(sharelist, " (", 1, 0); 1547 1542 sharelist = ostrcat(sharelist, tmp_ipaddresse, 1, 0); 1548 sharelist = ostrcat(sharelist, ": /", 1, 0); 1543 sharelist = ostrcat(sharelist, ":", 1, 0); 1544 sharelist = ostrcat(sharelist, tmp_ftpport, 1, 0); 1545 sharelist = ostrcat(sharelist, "/", 1, 0); 1549 1546 sharelist = ostrcat(sharelist, tmp_sharedir, 1, 0); 1550 1547 sharelist = ostrcat(sharelist, ")\n", 1, 0);
Note: See TracChangeset
for help on using the changeset viewer.