Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
ab057975
Commit
ab057975
authored
25 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
cleaned up some #ifdef mess, now uses data->fwrite() to write headers
parent
8629719e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/ftp.c
+11
-9
11 additions, 9 deletions
lib/ftp.c
with
11 additions
and
9 deletions
lib/ftp.c
+
11
−
9
View file @
ab057975
...
...
@@ -244,13 +244,7 @@ static int GetLastResponse(int sockfd, char *buf,
char
*
getmyhost
(
void
)
{
static
char
myhost
[
256
];
#if !defined(WIN32) && !defined(HAVE_UNAME) && !defined(HAVE_GETHOSTNAME)
/* We have no means of finding the local host name! */
strcpy
(
myhost
,
"localhost"
);
#endif
#if defined(WIN32) || !defined(HAVE_UNAME)
gethostname
(
myhost
,
256
);
#else
#ifdef HAVE_UNAME
struct
utsname
ugnm
;
if
(
uname
(
&
ugnm
)
<
0
)
...
...
@@ -258,6 +252,13 @@ char *getmyhost(void)
(
void
)
strncpy
(
myhost
,
ugnm
.
nodename
,
255
);
myhost
[
255
]
=
'\0'
;
#endif
#ifdef HAVE_GETHOSTNAME
gethostname
(
myhost
,
256
);
#endif
#if !defined(HAVE_UNAME) && !defined(HAVE_GETHOSTNAME)
/* We have no means of finding the local host name! */
strcpy
(
myhost
,
"localhost"
);
#endif
return
myhost
;
}
...
...
@@ -425,7 +426,8 @@ UrgError _ftp(struct UrlData *data,
}
if
(
data
->
writeheader
)
{
/* the header is requested to be written to this file */
if
(
strlen
(
buf
)
!=
fwrite
(
buf
,
1
,
strlen
(
buf
),
data
->
writeheader
))
{
if
(
strlen
(
buf
)
!=
data
->
fwrite
(
buf
,
1
,
strlen
(
buf
),
data
->
writeheader
))
{
failf
(
data
,
"Failed writing output"
);
return
URG_WRITE_ERROR
;
}
...
...
@@ -583,7 +585,7 @@ UrgError _ftp(struct UrlData *data,
struct
hostent
*
answer
;
unsigned
long
address
;
#if defined(HAVE_INET_ADDR)
|| defined(WIN32)
#if defined(HAVE_INET_ADDR)
address
=
inet_addr
(
newhost
);
answer
=
gethostbyaddr
((
char
*
)
&
address
,
sizeof
(
address
),
AF_INET
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment