Commit c275724c authored by Ulrich Czekalla's avatar Ulrich Czekalla Committed by Alexandre Julliard

HTTP protocol now supported, InternetCrackUrl fixed, lots of other

fixes.
parent a831f2a1
...@@ -8,6 +8,7 @@ SOVERSION = 1.0 ...@@ -8,6 +8,7 @@ SOVERSION = 1.0
SPEC_SRCS = wininet.spec SPEC_SRCS = wininet.spec
C_SRCS = \ C_SRCS = \
http.c \
internet.c \ internet.c \
ftp.c \ ftp.c \
utility.c \ utility.c \
......
...@@ -21,10 +21,13 @@ ...@@ -21,10 +21,13 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include "windows.h" #include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wininet.h" #include "wininet.h"
#include "winerror.h" #include "winerror.h"
#include "winsock.h" #include "winsock.h"
#include "heap.h"
#include "debugtools.h" #include "debugtools.h"
#include "internet.h" #include "internet.h"
...@@ -35,7 +38,6 @@ DEFAULT_DEBUG_CHANNEL(wininet); ...@@ -35,7 +38,6 @@ DEFAULT_DEBUG_CHANNEL(wininet);
#define DATA_PACKET_SIZE 0x2000 #define DATA_PACKET_SIZE 0x2000
#define szCRLF "\r\n" #define szCRLF "\r\n"
#define MAX_BACKLOG 5 #define MAX_BACKLOG 5
#define RESPONSE_TIMEOUT 30
typedef enum { typedef enum {
/* FTP commands with arguments. */ /* FTP commands with arguments. */
...@@ -103,7 +105,6 @@ BOOL FTP_ParsePermission(LPCSTR lpszPermission, LPFILEPROPERTIESA lpfp); ...@@ -103,7 +105,6 @@ BOOL FTP_ParsePermission(LPCSTR lpszPermission, LPFILEPROPERTIESA lpfp);
BOOL FTP_ParseDirectory(LPWININETFTPSESSIONA lpwfs, INT nSocket, LPFILEPROPERTIESA *lpafp, LPDWORD dwfp); BOOL FTP_ParseDirectory(LPWININETFTPSESSIONA lpwfs, INT nSocket, LPFILEPROPERTIESA *lpafp, LPDWORD dwfp);
HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONA lpwfs, INT nSocket, HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONA lpwfs, INT nSocket,
LPWIN32_FIND_DATAA lpFindFileData, DWORD dwContext); LPWIN32_FIND_DATAA lpFindFileData, DWORD dwContext);
LPSTR FTP_GetNextLine(INT nSocket, LPSTR lpszBuffer, LPDWORD dwBuffer);
DWORD FTP_SetResponseError(DWORD dwResponse); DWORD FTP_SetResponseError(DWORD dwResponse);
/*********************************************************************** /***********************************************************************
...@@ -135,8 +136,8 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile, ...@@ -135,8 +136,8 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile,
workRequest.asyncall = FTPPUTFILEA; workRequest.asyncall = FTPPUTFILEA;
workRequest.HFTPSESSION = (DWORD)hConnect; workRequest.HFTPSESSION = (DWORD)hConnect;
workRequest.LPSZLOCALFILE = (DWORD)strdup(lpszLocalFile); workRequest.LPSZLOCALFILE = (DWORD)HEAP_strdupA(GetProcessHeap(),0,lpszLocalFile);
workRequest.LPSZNEWREMOTEFILE = (DWORD)strdup(lpszNewRemoteFile); workRequest.LPSZNEWREMOTEFILE = (DWORD)HEAP_strdupA(GetProcessHeap(),0,lpszNewRemoteFile);
workRequest.DWFLAGS = dwFlags; workRequest.DWFLAGS = dwFlags;
workRequest.DWCONTEXT = dwContext; workRequest.DWCONTEXT = dwContext;
...@@ -250,7 +251,7 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) ...@@ -250,7 +251,7 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
workRequest.asyncall = FTPSETCURRENTDIRECTORYA; workRequest.asyncall = FTPSETCURRENTDIRECTORYA;
workRequest.HFTPSESSION = (DWORD)hConnect; workRequest.HFTPSESSION = (DWORD)hConnect;
workRequest.LPSZDIRECTORY = (DWORD)strdup(lpszDirectory); workRequest.LPSZDIRECTORY = (DWORD)HEAP_strdupA(GetProcessHeap(),0,lpszDirectory);
return INTERNET_AsyncCall(&workRequest); return INTERNET_AsyncCall(&workRequest);
} }
...@@ -347,7 +348,7 @@ BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) ...@@ -347,7 +348,7 @@ BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
workRequest.asyncall = FTPCREATEDIRECTORYA; workRequest.asyncall = FTPCREATEDIRECTORYA;
workRequest.HFTPSESSION = (DWORD)hConnect; workRequest.HFTPSESSION = (DWORD)hConnect;
workRequest.LPSZDIRECTORY = (DWORD)strdup(lpszDirectory); workRequest.LPSZDIRECTORY = (DWORD)HEAP_strdupA(GetProcessHeap(),0,lpszDirectory);
return INTERNET_AsyncCall(&workRequest); return INTERNET_AsyncCall(&workRequest);
} }
...@@ -443,7 +444,7 @@ INTERNETAPI HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect, ...@@ -443,7 +444,7 @@ INTERNETAPI HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect,
workRequest.asyncall = FTPFINDFIRSTFILEA; workRequest.asyncall = FTPFINDFIRSTFILEA;
workRequest.HFTPSESSION = (DWORD)hConnect; workRequest.HFTPSESSION = (DWORD)hConnect;
workRequest.LPSZSEARCHFILE = (DWORD)strdup(lpszSearchFile); workRequest.LPSZSEARCHFILE = (DWORD)HEAP_strdupA(GetProcessHeap(),0,lpszSearchFile);
workRequest.LPFINDFILEDATA = (DWORD)lpFindFileData; workRequest.LPFINDFILEDATA = (DWORD)lpFindFileData;
workRequest.DWFLAGS = dwFlags; workRequest.DWFLAGS = dwFlags;
workRequest.DWCONTEXT= dwContext; workRequest.DWCONTEXT= dwContext;
...@@ -706,7 +707,7 @@ INTERNETAPI HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession, ...@@ -706,7 +707,7 @@ INTERNETAPI HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession,
workRequest.asyncall = FTPOPENFILEA; workRequest.asyncall = FTPOPENFILEA;
workRequest.HFTPSESSION = (DWORD)hFtpSession; workRequest.HFTPSESSION = (DWORD)hFtpSession;
workRequest.LPSZFILENAME = (DWORD)strdup(lpszFileName); workRequest.LPSZFILENAME = (DWORD)HEAP_strdupA(GetProcessHeap(),0,lpszFileName);
workRequest.FDWACCESS = fdwAccess; workRequest.FDWACCESS = fdwAccess;
workRequest.DWFLAGS = dwFlags; workRequest.DWFLAGS = dwFlags;
workRequest.DWCONTEXT = dwContext; workRequest.DWCONTEXT = dwContext;
...@@ -827,8 +828,8 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN ...@@ -827,8 +828,8 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN
workRequest.asyncall = FTPGETFILEA; workRequest.asyncall = FTPGETFILEA;
workRequest.HFTPSESSION = (DWORD)hInternet; workRequest.HFTPSESSION = (DWORD)hInternet;
workRequest.LPSZREMOTEFILE = (DWORD)strdup(lpszRemoteFile); workRequest.LPSZREMOTEFILE = (DWORD)HEAP_strdupA(GetProcessHeap(),0,lpszRemoteFile);
workRequest.LPSZNEWFILE = (DWORD)strdup(lpszNewFile); workRequest.LPSZNEWFILE = (DWORD)HEAP_strdupA(GetProcessHeap(),0,lpszNewFile);
workRequest.DWLOCALFLAGSATTRIBUTE = dwLocalFlagsAttribute; workRequest.DWLOCALFLAGSATTRIBUTE = dwLocalFlagsAttribute;
workRequest.FFAILIFEXISTS = (DWORD)fFailIfExists; workRequest.FFAILIFEXISTS = (DWORD)fFailIfExists;
workRequest.DWFLAGS = dwInternetFlags; workRequest.DWFLAGS = dwInternetFlags;
...@@ -954,7 +955,7 @@ BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName) ...@@ -954,7 +955,7 @@ BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName)
workRequest.asyncall = FTPRENAMEFILEA; workRequest.asyncall = FTPRENAMEFILEA;
workRequest.HFTPSESSION = (DWORD)hFtpSession; workRequest.HFTPSESSION = (DWORD)hFtpSession;
workRequest.LPSZFILENAME = (DWORD)strdup(lpszFileName); workRequest.LPSZFILENAME = (DWORD)HEAP_strdupA(GetProcessHeap(),0,lpszFileName);
return INTERNET_AsyncCall(&workRequest); return INTERNET_AsyncCall(&workRequest);
} }
...@@ -1048,7 +1049,7 @@ BOOL WINAPI FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory) ...@@ -1048,7 +1049,7 @@ BOOL WINAPI FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory)
workRequest.asyncall = FTPREMOVEDIRECTORYA; workRequest.asyncall = FTPREMOVEDIRECTORYA;
workRequest.HFTPSESSION = (DWORD)hFtpSession; workRequest.HFTPSESSION = (DWORD)hFtpSession;
workRequest.LPSZDIRECTORY = (DWORD)strdup(lpszDirectory); workRequest.LPSZDIRECTORY = (DWORD)HEAP_strdupA(GetProcessHeap(),0,lpszDirectory);
return INTERNET_AsyncCall(&workRequest); return INTERNET_AsyncCall(&workRequest);
} }
...@@ -1143,8 +1144,8 @@ BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDes ...@@ -1143,8 +1144,8 @@ BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDes
workRequest.asyncall = FTPRENAMEFILEA; workRequest.asyncall = FTPRENAMEFILEA;
workRequest.HFTPSESSION = (DWORD)hFtpSession; workRequest.HFTPSESSION = (DWORD)hFtpSession;
workRequest.LPSZSRCFILE = (DWORD)strdup(lpszSrc); workRequest.LPSZSRCFILE = (DWORD)HEAP_strdupA(GetProcessHeap(),0,lpszSrc);
workRequest.LPSZDESTFILE = (DWORD)strdup(lpszDest); workRequest.LPSZDESTFILE = (DWORD)HEAP_strdupA(GetProcessHeap(),0,lpszDest);
return INTERNET_AsyncCall(&workRequest); return INTERNET_AsyncCall(&workRequest);
} }
...@@ -1309,13 +1310,13 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName, ...@@ -1309,13 +1310,13 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
if (NULL == lpszUserName) if (NULL == lpszUserName)
{ {
lpwfs->lpszUserName = strdup("anonymous"); lpwfs->lpszUserName = HEAP_strdupA(GetProcessHeap(),0,"anonymous");
lpwfs->lpszPassword = strdup("user@server"); lpwfs->lpszPassword = HEAP_strdupA(GetProcessHeap(),0,"user@server");
} }
else else
{ {
lpwfs->lpszUserName = strdup(lpszUserName); lpwfs->lpszUserName = HEAP_strdupA(GetProcessHeap(),0,lpszUserName);
lpwfs->lpszPassword = strdup(lpszPassword); lpwfs->lpszPassword = HEAP_strdupA(GetProcessHeap(),0,lpszPassword);
} }
if (FTP_ConnectToHost(lpwfs)) if (FTP_ConnectToHost(lpwfs))
...@@ -1481,7 +1482,7 @@ INT FTP_ReceiveResponse(INT nSocket, LPSTR lpszResponse, DWORD dwResponse, ...@@ -1481,7 +1482,7 @@ INT FTP_ReceiveResponse(INT nSocket, LPSTR lpszResponse, DWORD dwResponse,
while(1) while(1)
{ {
nRecv = dwResponse; nRecv = dwResponse;
if (!FTP_GetNextLine(nSocket, lpszResponse, &nRecv)) if (!INTERNET_GetNextLine(nSocket, lpszResponse, &nRecv))
goto lerror; goto lerror;
if (nRecv >= 3 && lpszResponse[3] != '-') if (nRecv >= 3 && lpszResponse[3] != '-')
...@@ -2177,7 +2178,7 @@ BOOL FTP_ParseDirectory(LPWININETFTPSESSIONA lpwfs, INT nSocket, LPFILEPROPERTIE ...@@ -2177,7 +2178,7 @@ BOOL FTP_ParseDirectory(LPWININETFTPSESSIONA lpwfs, INT nSocket, LPFILEPROPERTIE
goto lend; goto lend;
} }
while ((pszLine = FTP_GetNextLine(nSocket, INTERNET_GetResponseBuffer(), &nBufLen)) != NULL) while ((pszLine = INTERNET_GetNextLine(nSocket, INTERNET_GetResponseBuffer(), &nBufLen)) != NULL)
{ {
if (sizeFilePropArray <= indexFilePropArray) if (sizeFilePropArray <= indexFilePropArray)
{ {
...@@ -2272,7 +2273,7 @@ BOOL FTP_ParseDirectory(LPWININETFTPSESSIONA lpwfs, INT nSocket, LPFILEPROPERTIE ...@@ -2272,7 +2273,7 @@ BOOL FTP_ParseDirectory(LPWININETFTPSESSIONA lpwfs, INT nSocket, LPFILEPROPERTIE
pszToken = strtok(NULL, " \t"); pszToken = strtok(NULL, " \t");
if(pszToken != NULL) if(pszToken != NULL)
{ {
curFileProp->lpszName = strdup(pszToken); curFileProp->lpszName = HEAP_strdupA(GetProcessHeap(),0,pszToken);
TRACE(": %s\n", curFileProp->lpszName); TRACE(": %s\n", curFileProp->lpszName);
} }
...@@ -2371,71 +2372,6 @@ BOOL FTP_ParsePermission(LPCSTR lpszPermission, LPFILEPROPERTIESA lpfp) ...@@ -2371,71 +2372,6 @@ BOOL FTP_ParsePermission(LPCSTR lpszPermission, LPFILEPROPERTIESA lpfp)
/*********************************************************************** /***********************************************************************
* FTP_GetNextLine (internal)
*
* Parse next line in directory string listing
*
* RETURNS
* Pointer to begining of next line
* NULL on failure
*
*/
LPSTR FTP_GetNextLine(INT nSocket, LPSTR lpszBuffer, LPDWORD dwBuffer)
{
struct timeval tv;
fd_set infd;
BOOL bSuccess = FALSE;
INT nRecv = 0;
TRACE("\n");
while (nRecv < *dwBuffer)
{
FD_ZERO(&infd);
FD_SET(nSocket, &infd);
tv.tv_sec=RESPONSE_TIMEOUT;
tv.tv_usec=0;
if (select(nSocket+1,&infd,NULL,NULL,&tv))
{
if (recv(nSocket, &lpszBuffer[nRecv], 1, 0) <= 0)
{
INTERNET_SetLastError(ERROR_FTP_TRANSFER_IN_PROGRESS);
goto lend;
}
if (lpszBuffer[nRecv] == '\n')
{
bSuccess = TRUE;
break;
}
if (lpszBuffer[nRecv] != '\r')
nRecv++;
}
else
{
INTERNET_SetLastError(ERROR_INTERNET_TIMEOUT);
goto lend;
}
}
lend:
if (bSuccess)
{
lpszBuffer[nRecv] = '\0';
*dwBuffer = nRecv - 1;
TRACE(":%d %s\n", nRecv, lpszBuffer);
return lpszBuffer;
}
else
{
return NULL;
}
}
/***********************************************************************
* FTP_SetResponseError (internal) * FTP_SetResponseError (internal)
* *
* Set the appropriate error code for a given response from the server * Set the appropriate error code for a given response from the server
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
typedef enum typedef enum
{ {
WH_HINIT, WH_HINIT = INTERNET_HANDLE_TYPE_INTERNET,
WH_HFTPSESSION, WH_HFTPSESSION = INTERNET_HANDLE_TYPE_CONNECT_FTP,
WH_HGOPHERSESSION, WH_HGOPHERSESSION = INTERNET_HANDLE_TYPE_CONNECT_GOPHER,
WH_HHTTPSESSION, WH_HHTTPSESSION = INTERNET_HANDLE_TYPE_CONNECT_HTTP,
WH_HHTTPREQ, WH_HFILE = INTERNET_HANDLE_TYPE_FTP_FILE,
WH_HFILE, WH_HFINDNEXT = INTERNET_HANDLE_TYPE_FTP_FIND,
WH_HFINDNEXT, WH_HHTTPREQ = INTERNET_HANDLE_TYPE_HTTP_REQUEST,
} WH_TYPE; } WH_TYPE;
typedef struct _WININETHANDLEHEADER typedef struct _WININETHANDLEHEADER
...@@ -43,20 +43,29 @@ typedef struct ...@@ -43,20 +43,29 @@ typedef struct
struct hostent *phostent; struct hostent *phostent;
} WININETHTTPSESSIONA, *LPWININETHTTPSESSIONA; } WININETHTTPSESSIONA, *LPWININETHTTPSESSIONA;
#define HDR_ISREQUEST 0x0001
#define HDR_COMMADELIMITED 0x0002
#define HDR_SEMIDELIMITED 0x0004
typedef struct
{
LPSTR lpszField;
LPSTR lpszValue;
WORD wFlags;
WORD wCount;
} HTTPHEADERA, *LPHTTPHEADERA;
typedef struct typedef struct
{ {
WININETHANDLEHEADER hdr; WININETHANDLEHEADER hdr;
LPSTR lpszPath; LPSTR lpszPath;
LPSTR lpszReferrer;
LPSTR lpszAcceptTypes;
LPSTR lpszVerb; LPSTR lpszVerb;
LPSTR lpszHostName; LPSTR lpszHostName;
LPSTR lpszRedirect; INT nSocketFD;
int nSocketFD; HTTPHEADERA StdHeaders[HTTP_QUERY_MAX+1];
int statusCode; HTTPHEADERA *pCustHeaders;
int contentLength; INT nCustHeaders;
time_t nSystemTime;
} WININETHTTPREQA, *LPWININETHTTPREQA; } WININETHTTPREQA, *LPWININETHTTPREQA;
...@@ -111,6 +120,8 @@ typedef enum ...@@ -111,6 +120,8 @@ typedef enum
FTPREMOVEDIRECTORYA, FTPREMOVEDIRECTORYA,
FTPRENAMEFILEA, FTPRENAMEFILEA,
INTERNETFINDNEXTA, INTERNETFINDNEXTA,
HTTPSENDREQUESTA,
HTTPOPENREQUESTA,
} ASYNC_FUNC; } ASYNC_FUNC;
typedef struct WORKREQ typedef struct WORKREQ
...@@ -126,6 +137,8 @@ typedef struct WORKREQ ...@@ -126,6 +137,8 @@ typedef struct WORKREQ
#define LPSZSRCFILE param2 #define LPSZSRCFILE param2
#define LPSZDIRECTORY param2 #define LPSZDIRECTORY param2
#define LPSZSEARCHFILE param2 #define LPSZSEARCHFILE param2
#define LPSZHEADER param2
#define LPSZVERB param2
DWORD param3; DWORD param3;
#define LPSZNEWREMOTEFILE param3 #define LPSZNEWREMOTEFILE param3
...@@ -134,18 +147,27 @@ typedef struct WORKREQ ...@@ -134,18 +147,27 @@ typedef struct WORKREQ
#define LPDWDIRECTORY param3 #define LPDWDIRECTORY param3
#define FDWACCESS param3 #define FDWACCESS param3
#define LPSZDESTFILE param3 #define LPSZDESTFILE param3
#define DWHEADERLENGTH param3
#define LPSZOBJECTNAME param3
DWORD param4; DWORD param4;
#define DWFLAGS param4 #define DWFLAGS param4
#define LPOPTIONAL param4
DWORD param5; DWORD param5;
#define DWCONTEXT param5 #define DWCONTEXT param5
#define DWOPTIONALLENGTH param5
DWORD param6; DWORD param6;
#define FFAILIFEXISTS param4 #define FFAILIFEXISTS param6
#define LPSZVERSION param6
DWORD param7; DWORD param7;
#define DWLOCALFLAGSATTRIBUTE param7 #define DWLOCALFLAGSATTRIBUTE param7
#define LPSZREFERRER param7
DWORD param8;
#define LPSZACCEPTTYPES param8
struct WORKREQ *next; struct WORKREQ *next;
struct WORKREQ *prev; struct WORKREQ *prev;
...@@ -159,6 +181,10 @@ HINTERNET FTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName, ...@@ -159,6 +181,10 @@ HINTERNET FTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName,
INTERNET_PORT nServerPort, LPCSTR lpszUserName, INTERNET_PORT nServerPort, LPCSTR lpszUserName,
LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext); LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext);
HINTERNET HTTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName,
INTERNET_PORT nServerPort, LPCSTR lpszUserName,
LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext);
BOOL GetAddress(LPCSTR lpszServerName, INTERNET_PORT nServerPort, BOOL GetAddress(LPCSTR lpszServerName, INTERNET_PORT nServerPort,
struct hostent **phe, struct sockaddr_in *psa); struct hostent **phe, struct sockaddr_in *psa);
...@@ -168,6 +194,7 @@ void INTERNET_SetLastError(DWORD dwError); ...@@ -168,6 +194,7 @@ void INTERNET_SetLastError(DWORD dwError);
DWORD INTERNET_GetLastError(); DWORD INTERNET_GetLastError();
BOOL INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest); BOOL INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest);
LPSTR INTERNET_GetResponseBuffer(); LPSTR INTERNET_GetResponseBuffer();
LPSTR INTERNET_GetNextLine(INT nSocket, LPSTR lpszBuffer, LPDWORD dwBuffer);
BOOL FTP_CloseSessionHandle(LPWININETFTPSESSIONA lpwfs); BOOL FTP_CloseSessionHandle(LPWININETFTPSESSIONA lpwfs);
BOOL FTP_CloseFindNextHandle(LPWININETFINDNEXTA lpwfn); BOOL FTP_CloseFindNextHandle(LPWININETFINDNEXTA lpwfn);
...@@ -189,6 +216,15 @@ BOOLAPI FTP_FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN ...@@ -189,6 +216,15 @@ BOOLAPI FTP_FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN
BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags, BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags,
DWORD dwContext); DWORD dwContext);
BOOLAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
DWORD dwHeaderLength, LPVOID lpOptional ,DWORD dwOptionalLength);
INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession,
LPCSTR lpszVerb, LPCSTR lpszObjectName, LPCSTR lpszVersion,
LPCSTR lpszReferrer , LPCSTR *lpszAcceptTypes,
DWORD dwFlags, DWORD dwContext);
void HTTP_CloseHTTPSessionHandle(LPWININETHTTPSESSIONA lpwhs);
void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQA lpwhr);
#define MAX_REPLY_LEN 0x5B4 #define MAX_REPLY_LEN 0x5B4
......
...@@ -111,10 +111,12 @@ time_t ConvertTimeString(LPCSTR asctime) ...@@ -111,10 +111,12 @@ time_t ConvertTimeString(LPCSTR asctime)
BOOL GetAddress(LPCSTR lpszServerName, INTERNET_PORT nServerPort, BOOL GetAddress(LPCSTR lpszServerName, INTERNET_PORT nServerPort,
struct hostent **phe, struct sockaddr_in *psa) struct hostent **phe, struct sockaddr_in *psa)
{ {
TRACE("%s\n", lpszServerName);
*phe = gethostbyname(lpszServerName); *phe = gethostbyname(lpszServerName);
if (NULL == *phe) if (NULL == *phe)
{ {
TRACE("Failed to get hostname %s\n", lpszServerName); TRACE("Failed to get hostname: (%s)\n", lpszServerName);
return FALSE; return FALSE;
} }
......
...@@ -69,15 +69,15 @@ init WININET_LibMain ...@@ -69,15 +69,15 @@ init WININET_LibMain
@ stub GopherGetLocatorTypeW @ stub GopherGetLocatorTypeW
@ stub GopherOpenFileA @ stub GopherOpenFileA
@ stub GopherOpenFileW @ stub GopherOpenFileW
@ stub HttpAddRequestHeadersA @ stdcall HttpAddRequestHeadersA(ptr str long long) HttpAddRequestHeadersA
@ stub HttpAddRequestHeadersW @ stub HttpAddRequestHeadersW
@ stub HttpEndRequestA @ stub HttpEndRequestA
@ stub HttpEndRequestW @ stub HttpEndRequestW
@ stub HttpOpenRequestA @ stdcall HttpOpenRequestA(ptr str str str str ptr long long) HttpOpenRequestA
@ stub HttpOpenRequestW @ stub HttpOpenRequestW
@ stub HttpQueryInfoA @ stdcall HttpQueryInfoA(ptr long ptr ptr ptr) HttpQueryInfoA
@ stub HttpQueryInfoW @ stub HttpQueryInfoW
@ stub HttpSendRequestA @ stdcall HttpSendRequestA(ptr str long ptr long) HttpSendRequestA
@ stub HttpSendRequestExA @ stub HttpSendRequestExA
@ stub HttpSendRequestExW @ stub HttpSendRequestExW
@ stub HttpSendRequestW @ stub HttpSendRequestW
...@@ -120,7 +120,7 @@ init WININET_LibMain ...@@ -120,7 +120,7 @@ init WININET_LibMain
@ stub InternetOpenUrlW @ stub InternetOpenUrlW
@ stub InternetOpenW @ stub InternetOpenW
@ stub InternetQueryDataAvailable @ stub InternetQueryDataAvailable
@ stub InternetQueryOptionA @ stdcall InternetQueryOptionA(ptr long ptr ptr) InternetQueryOptionA
@ stub InternetQueryOptionW @ stub InternetQueryOptionW
@ stdcall InternetReadFile(ptr ptr long ptr) InternetReadFile @ stdcall InternetReadFile(ptr ptr long ptr) InternetReadFile
@ stub InternetReadFileExA @ stub InternetReadFileExA
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment