Ignore:
Timestamp:
Jul 29, 2000, 4:10:09 PM (25 years ago)
Author:
bird
Message:

Added the CVS Id keyword to the header.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wininet/ftp.c

    r2624 r3898  
    1 /*
     1/* $Id: ftp.c,v 1.2 2000-07-29 14:10:08 bird Exp $
     2 *
    23 * WININET - Ftp implementation
    34 *
     
    4041typedef enum {
    4142  /* FTP commands with arguments. */
    42   FTP_CMD_ACCT, 
    43   FTP_CMD_CWD, 
    44   FTP_CMD_DELE, 
    45   FTP_CMD_MKD, 
    46   FTP_CMD_PASS, 
    47   FTP_CMD_PORT, 
    48   FTP_CMD_RETR, 
    49   FTP_CMD_RMD, 
    50   FTP_CMD_RNFR, 
    51   FTP_CMD_RNTO, 
    52   FTP_CMD_STOR, 
    53   FTP_CMD_TYPE, 
    54   FTP_CMD_USER, 
     43  FTP_CMD_ACCT,
     44  FTP_CMD_CWD,
     45  FTP_CMD_DELE,
     46  FTP_CMD_MKD,
     47  FTP_CMD_PASS,
     48  FTP_CMD_PORT,
     49  FTP_CMD_RETR,
     50  FTP_CMD_RMD,
     51  FTP_CMD_RNFR,
     52  FTP_CMD_RNTO,
     53  FTP_CMD_STOR,
     54  FTP_CMD_TYPE,
     55  FTP_CMD_USER,
    5556
    5657  /* FTP commands without arguments. */
     
    5859  FTP_CMD_LIST,
    5960  FTP_CMD_NLST,
    60   FTP_CMD_PWD, 
     61  FTP_CMD_PWD,
    6162  FTP_CMD_QUIT,
    62 } FTP_COMMAND; 
     63} FTP_COMMAND;
    6364
    6465static const char *szFtpCommands[] = {
     
    147148
    148149                /* Accept connection from ftp server */
    149                 if (FTP_InitDataSocket(lpwfs, &nDataSocket)) 
     150                if (FTP_InitDataSocket(lpwfs, &nDataSocket))
    150151                {
    151152                        FTP_SendData(lpwfs, nDataSocket, hFile);
     
    159160        {
    160161                INTERNET_ASYNC_RESULT iar;
    161                
     162
    162163                iar.dwResult = (DWORD)bSuccess;
    163164                iar.dwError = nRC;
     
    217218        {
    218219                INTERNET_ASYNC_RESULT iar;
    219                
     220
    220221                iar.dwResult = (DWORD)bSuccess;
    221222                iar.dwError = nRC;
     
    348349 *
    349350 */
    350 BOOLAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDirectory, 
     351BOOLAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDirectory,
    351352        LPDWORD lpdwCurrentDirectory)
    352353{
     
    401402        {
    402403                INTERNET_ASYNC_RESULT iar;
    403                
     404
    404405                iar.dwResult = (DWORD)bSuccess;
    405406                iar.dwError = bSuccess ? ERROR_SUCCESS : ERROR_SUCCESS;
     
    450451        }
    451452
    452         /* Accept connection from server */ 
    453         if (nSuccess && FTP_InitDataSocket(lpwfs, &nDataSocket)) 
     453        /* Accept connection from server */
     454        if (nSuccess && FTP_InitDataSocket(lpwfs, &nDataSocket))
    454455        {
    455456                hFile = HeapAlloc(GetProcessHeap(), 0, sizeof(WININETFILE));
     
    492493
    493494        /* Ensure we can write to lpszNewfile by opening it */
    494         hFile = CreateFileA(lpszNewFile, GENERIC_WRITE, 0, 0, fFailIfExists ? 
     495        hFile = CreateFileA(lpszNewFile, GENERIC_WRITE, 0, 0, fFailIfExists ?
    495496                CREATE_NEW : CREATE_ALWAYS, dwLocalFlagsAttribute, 0);
    496497        if (INVALID_HANDLE_VALUE == hFile)
     
    505506
    506507                /* Accept connection from ftp server */
    507                 if (FTP_InitDataSocket(lpwfs, &nDataSocket)) 
     508                if (FTP_InitDataSocket(lpwfs, &nDataSocket))
    508509                {
    509510                        int nResCode;
     
    523524
    524525        if (hFile)
    525                 CloseHandle(hFile);   
     526                CloseHandle(hFile);
    526527        return bSuccess;
    527528}
     
    539540 */
    540541
    541 HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName, 
     542HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
    542543        INTERNET_PORT nServerPort, LPCSTR lpszUserName,
    543544        LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext)
     
    583584        if (!result)
    584585        {
    585                 TRACE("Connected to server\n"); 
     586                TRACE("Connected to server\n");
    586587                lpwfs = HeapAlloc(GetProcessHeap(), 0, sizeof(WININETFTPSESSIONA));
    587588                if (NULL == lpwfs)
     
    654655        {
    655656                INTERNET_ASYNC_RESULT iar;
    656                
     657
    657658                iar.dwResult = (DWORD)lpwfs;
    658659                iar.dwError = bSuccess ? ERROR_SUCCESS : ERROR_INTERNET_CANNOT_CONNECT;
     
    735736            return FALSE;
    736737        }
    737         sprintf(buf, "%s%s%s%s", szFtpCommands[ftpCmd], bParamHasLen ? " " : "", 
     738        sprintf(buf, "%s%s%s%s", szFtpCommands[ftpCmd], bParamHasLen ? " " : "",
    738739                bParamHasLen ? lpszParam : "", szCRLF);
    739740
     
    787788                nRecv = 0;
    788789        }
    789                    
     790
    790791        if (nRecv > 0)
    791792        {
     
    820821        if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_PASS, lpwfs->lpszPassword))
    821822            goto lend;
    822            
     823
    823824        nResCode = FTP_ReceiveResponse(lpwfs->sndSocket, lpwfs->lpszResponseBuffer, MAX_REPLY_LEN);
    824825        if (nResCode)
     
    844845 *           FTP_SendAccount (internal)
    845846 *
    846  * 
     847 *
    847848 *
    848849 * RETURNS
     
    943944        lpwfs->lstnSocketAddress.sin_family = AF_INET;
    944945        lpwfs->lstnSocketAddress.sin_port = htons((u_short) 0);
    945         lpwfs->lstnSocketAddress.sin_addr.s_addr = htonl(INADDR_ANY); 
     946        lpwfs->lstnSocketAddress.sin_addr.s_addr = htonl(INADDR_ANY);
    946947        if (SOCKET_ERROR == bind(lpwfs->lstnSocket,&lpwfs->lstnSocketAddress, sizeof(struct sockaddr_in)))
    947948        {
     
    10611062 *           FTP_InitDataSocket (internal)
    10621063 *
    1063  * 
     1064 *
    10641065 *
    10651066 * RETURNS
     
    11281129                }
    11291130
    1130                 nLen = DATA_PACKET_SIZE < nBytesToSend ? 
     1131                nLen = DATA_PACKET_SIZE < nBytesToSend ?
    11311132                    DATA_PACKET_SIZE : nBytesToSend;
    11321133                nRC  = send(nDataSocket, lpszBuffer, nLen, 0);
     
    11451146/*
    11461147                        TRACE( "%d bytes of %d bytes (%d%%) in %d min %d sec estimated remainig time %d sec\t\t\r",
    1147                                 nTotalSent, fi.nFileSizeLow, nTotalSent*100/st.st_size, nSeconds / 60, 
     1148                                nTotalSent, fi.nFileSizeLow, nTotalSent*100/st.st_size, nSeconds / 60,
    11481149                                nSeconds % 60, (st.st_size - nTotalSent) * nSeconds / nTotalSent );
    11491150*/
     
    12691270                        if (nRC == 0)
    12701271                                goto recv_end;
    1271                         WriteFile(hFile, lpszBuffer, nRC, &nBytesWritten, NULL); 
     1272                        WriteFile(hFile, lpszBuffer, nRC, &nBytesWritten, NULL);
    12721273                        nBytesReceived += nRC;
    12731274                }
    12741275
    1275                 TRACE("%d bytes of %ld (%ld%%)\r", nBytesReceived, nBytes, 
     1276                TRACE("%d bytes of %ld (%ld%%)\r", nBytesReceived, nBytes,
    12761277                  nBytesReceived * 100 / nBytes);
    12771278        }
     
    13311332BOOL FTP_CloseFindNextHandle(LPWININETFINDNEXTA lpwfn)
    13321333{
    1333     int i; 
     1334    int i;
    13341335
    13351336    for (i = 0; i < lpwfn->size; i++)
     
    13671368        {
    13681369                DWORD access = mktime(&lpafp->tmLastModified);
    1369                
     1370
    13701371                /* Not all fields are filled in */
    13711372                lpFindFileData->ftLastAccessTime.dwHighDateTime = HIWORD(access);
     
    13841385                    lpwfn->lpafp = lpafp;
    13851386                }
    1386         } 
     1387        }
    13871388
    13881389        return (HINTERNET)lpwfn;
     
    14511452
    14521453                        sizeFilePropArray *= 2;
    1453                         tmpafp = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *lpafp, 
     1454                        tmpafp = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *lpafp,
    14541455                                sizeof(FILEPROPERTIESA)*sizeFilePropArray);
    14551456                        if (NULL == tmpafp)
     
    15421543                        LPFILEPROPERTIESA tmpafp;
    15431544
    1544                         tmpafp = HeapReAlloc(GetProcessHeap(), 0, *lpafp, 
     1545                        tmpafp = HeapReAlloc(GetProcessHeap(), 0, *lpafp,
    15451546                                sizeof(FILEPROPERTIESA)*indexFilePropArray);
    15461547                        if (NULL == tmpafp)
     
    15541555        }
    15551556
    1556 lend:   
     1557lend:
    15571558  return bSuccess;
    15581559}
Note: See TracChangeset for help on using the changeset viewer.