Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7410bf58
Commit
7410bf58
authored
Feb 13, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Moved INTERNET_GetNextLine to ftp.c.
parent
fdf50ba8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
73 deletions
+61
-73
ftp.c
dlls/wininet/ftp.c
+61
-2
internet.c
dlls/wininet/internet.c
+0
-70
internet.h
dlls/wininet/internet.h
+0
-1
No files found.
dlls/wininet/ftp.c
View file @
7410bf58
...
...
@@ -51,6 +51,12 @@
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
#ifdef HAVE_SYS_POLL_H
# include <sys/poll.h>
#endif
#include <time.h>
#include <assert.h>
...
...
@@ -70,6 +76,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wininet
);
#define RESPONSE_TIMEOUT 30
typedef
struct
_ftp_session_t
ftp_session_t
;
typedef
struct
...
...
@@ -2660,6 +2668,57 @@ lend:
return
bSuccess
;
}
/***********************************************************************
* FTP_GetNextLine (internal)
*
* Parse next line in directory string listing
*
* RETURNS
* Pointer to beginning of next line
* NULL on failure
*
*/
static
LPSTR
FTP_GetNextLine
(
INT
nSocket
,
LPDWORD
dwLen
)
{
struct
pollfd
pfd
;
INT
nRecv
=
0
;
LPSTR
lpszBuffer
=
INTERNET_GetResponseBuffer
();
TRACE
(
"
\n
"
);
pfd
.
fd
=
nSocket
;
pfd
.
events
=
POLLIN
;
while
(
nRecv
<
MAX_REPLY_LEN
)
{
if
(
poll
(
&
pfd
,
1
,
RESPONSE_TIMEOUT
*
1000
)
>
0
)
{
if
(
sock_recv
(
nSocket
,
&
lpszBuffer
[
nRecv
],
1
,
0
)
<=
0
)
{
INTERNET_SetLastError
(
ERROR_FTP_TRANSFER_IN_PROGRESS
);
return
NULL
;
}
if
(
lpszBuffer
[
nRecv
]
==
'\n'
)
{
lpszBuffer
[
nRecv
]
=
'\0'
;
*
dwLen
=
nRecv
-
1
;
TRACE
(
":%d %s
\n
"
,
nRecv
,
lpszBuffer
);
return
lpszBuffer
;
}
if
(
lpszBuffer
[
nRecv
]
!=
'\r'
)
nRecv
++
;
}
else
{
INTERNET_SetLastError
(
ERROR_INTERNET_TIMEOUT
);
return
NULL
;
}
}
return
NULL
;
}
/***********************************************************************
* FTP_SendCommandA (internal)
...
...
@@ -2759,7 +2818,7 @@ INT FTP_ReceiveResponse(ftp_session_t *lpwfs, DWORD_PTR dwContext)
while
(
1
)
{
if
(
!
INTERNET
_GetNextLine
(
lpwfs
->
sndSocket
,
&
nRecv
))
if
(
!
FTP
_GetNextLine
(
lpwfs
->
sndSocket
,
&
nRecv
))
goto
lerror
;
if
(
nRecv
>=
3
)
...
...
@@ -3619,7 +3678,7 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
lpfp
->
lpszName
=
NULL
;
do
{
if
(
!
(
pszLine
=
INTERNET
_GetNextLine
(
nSocket
,
&
nBufLen
)))
if
(
!
(
pszLine
=
FTP
_GetNextLine
(
nSocket
,
&
nBufLen
)))
return
FALSE
;
pszToken
=
strtok
(
pszLine
,
szSpace
);
...
...
dlls/wininet/internet.c
View file @
7410bf58
...
...
@@ -40,12 +40,6 @@
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
#ifdef HAVE_SYS_POLL_H
# include <sys/poll.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
...
...
@@ -85,8 +79,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wininet
);
#define RESPONSE_TIMEOUT 30
typedef
struct
{
DWORD
dwError
;
...
...
@@ -3918,68 +3910,6 @@ LPSTR INTERNET_GetResponseBuffer(void)
return
lpwite
->
response
;
}
/***********************************************************************
* INTERNET_GetNextLine (internal)
*
* Parse next line in directory string listing
*
* RETURNS
* Pointer to beginning of next line
* NULL on failure
*
*/
LPSTR
INTERNET_GetNextLine
(
INT
nSocket
,
LPDWORD
dwLen
)
{
struct
pollfd
pfd
;
BOOL
bSuccess
=
FALSE
;
INT
nRecv
=
0
;
LPSTR
lpszBuffer
=
INTERNET_GetResponseBuffer
();
TRACE
(
"
\n
"
);
pfd
.
fd
=
nSocket
;
pfd
.
events
=
POLLIN
;
while
(
nRecv
<
MAX_REPLY_LEN
)
{
if
(
poll
(
&
pfd
,
1
,
RESPONSE_TIMEOUT
*
1000
)
>
0
)
{
if
(
sock_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'
;
*
dwLen
=
nRecv
-
1
;
TRACE
(
":%d %s
\n
"
,
nRecv
,
lpszBuffer
);
return
lpszBuffer
;
}
else
{
return
NULL
;
}
}
/**********************************************************
* InternetQueryDataAvailable (WININET.@)
*
...
...
dlls/wininet/internet.h
View file @
7410bf58
...
...
@@ -430,7 +430,6 @@ void INTERNET_SetLastError(DWORD dwError) DECLSPEC_HIDDEN;
DWORD
INTERNET_GetLastError
(
void
)
DECLSPEC_HIDDEN
;
DWORD
INTERNET_AsyncCall
(
task_header_t
*
)
DECLSPEC_HIDDEN
;
LPSTR
INTERNET_GetResponseBuffer
(
void
)
DECLSPEC_HIDDEN
;
LPSTR
INTERNET_GetNextLine
(
INT
nSocket
,
LPDWORD
dwLen
)
DECLSPEC_HIDDEN
;
VOID
SendAsyncCallback
(
object_header_t
*
hdr
,
DWORD_PTR
dwContext
,
DWORD
dwInternetStatus
,
LPVOID
lpvStatusInfo
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment