Changeset 85673 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Aug 10, 2020 4:02:28 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139806
- Location:
- trunk/src/VBox/Runtime/tools
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/tools/Makefile.kmk
r84540 r85673 140 140 RTLdrFlt_SOURCES = RTLdrFlt.cpp 141 141 142 # RTF TPServer implements a simple FTP server.143 PROGRAMS += RTF TPServer144 RTF TPServer_TEMPLATE = VBoxR3Tool145 RTF TPServer_SOURCES = RTFTPServer.cpp142 # RTFtpServer implements a simple FTP server. 143 PROGRAMS += RTFtpServer 144 RTFtpServer_TEMPLATE = VBoxR3Tool 145 RTFtpServer_SOURCES = RTFtpServer.cpp 146 146 147 147 # RTGzip - our gzip clone (for testing the gzip/gunzip streaming code) -
trunk/src/VBox/Runtime/tools/RTFtpServer.cpp
r85672 r85673 2 2 /** @file 3 3 * IPRT - Utility for running a (simple) FTP server. 4 * 5 * Use this setup to best see what's going on: 6 * VBOX_LOG=rt_ftp=~0 7 * VBOX_LOG_DEST="nofile stderr" 8 * VBOX_LOG_FLAGS="unbuffered enabled thread msprog" 9 * 4 10 */ 5 11 … … 25 31 */ 26 32 27 /*28 * Use this setup to best see what's going on:29 *30 * VBOX_LOG=rt_ftp=~031 * VBOX_LOG_DEST="nofile stderr"32 * VBOX_LOG_FLAGS="unbuffered enabled thread msprog"33 *34 */35 36 33 37 34 /********************************************************************************************************************************* … … 111 108 /** Set by the signal handler when the FTP server shall be terminated. */ 112 109 static volatile bool g_fCanceled = false; 113 static FTPSERVERDATA g_F TPServerData;110 static FTPSERVERDATA g_FtpServerData; 114 111 115 112 … … 512 509 uint16_t uPort = 2121; 513 510 514 RT_ZERO(g_F TPServerData);511 RT_ZERO(g_FtpServerData); 515 512 516 513 /* … … 546 543 547 544 case 'r': 548 RTStrCopy(g_F TPServerData.szPathRootAbs, sizeof(g_FTPServerData.szPathRootAbs), ValueUnion.psz);545 RTStrCopy(g_FtpServerData.szPathRootAbs, sizeof(g_FtpServerData.szPathRootAbs), ValueUnion.psz); 549 546 break; 550 547 … … 581 578 } 582 579 583 if (!strlen(g_F TPServerData.szPathRootAbs))580 if (!strlen(g_FtpServerData.szPathRootAbs)) 584 581 { 585 582 /* By default use the current directory as serving root directory. */ 586 rc = RTPathGetCurrent(g_F TPServerData.szPathRootAbs, sizeof(g_FTPServerData.szPathRootAbs));583 rc = RTPathGetCurrent(g_FtpServerData.szPathRootAbs, sizeof(g_FtpServerData.szPathRootAbs)); 587 584 if (RT_FAILURE(rc)) 588 585 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Retrieving current directory failed: %Rrc", rc); … … 590 587 591 588 /* Initialize CWD. */ 592 RTStrPrintf2(g_F TPServerData.szCWD, sizeof(g_FTPServerData.szCWD), "/");589 RTStrPrintf2(g_FtpServerData.szCWD, sizeof(g_FtpServerData.szCWD), "/"); 593 590 594 591 /* Install signal handler. */ … … 619 616 RTFTPSERVER hFTPServer; 620 617 rc = RTFtpServerCreate(&hFTPServer, szAddress, uPort, &Callbacks, 621 &g_F TPServerData, sizeof(g_FTPServerData));618 &g_FtpServerData, sizeof(g_FtpServerData)); 622 619 if (RT_SUCCESS(rc)) 623 620 { 624 621 RTPrintf("Starting FTP server at %s:%RU16 ...\n", szAddress, uPort); 625 RTPrintf("Root directory is '%s'\n", g_F TPServerData.szPathRootAbs);622 RTPrintf("Root directory is '%s'\n", g_FtpServerData.szPathRootAbs); 626 623 627 624 RTPrintf("Running FTP server ...\n");
Note:
See TracChangeset
for help on using the changeset viewer.