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
4d10c96a
Commit
4d10c96a
authored
16 years ago
by
Yang Tse
Browse files
Options
Downloads
Patches
Plain Diff
fix compiler warning
parent
b701ea36
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/server/getpart.c
+9
-0
9 additions, 0 deletions
tests/server/getpart.c
tests/server/tftp.h
+7
-7
7 additions, 7 deletions
tests/server/tftp.h
tests/server/tftpd.c
+11
-11
11 additions, 11 deletions
tests/server/tftpd.c
with
27 additions
and
18 deletions
tests/server/getpart.c
+
9
−
0
View file @
4d10c96a
...
@@ -34,6 +34,7 @@ struct SessionHandle {
...
@@ -34,6 +34,7 @@ struct SessionHandle {
};
};
#include
"curl_base64.h"
#include
"curl_base64.h"
#include
"memory.h"
/* include memdebug.h last */
/* include memdebug.h last */
#include
"memdebug.h"
#include
"memdebug.h"
...
@@ -48,12 +49,20 @@ struct SessionHandle {
...
@@ -48,12 +49,20 @@ struct SessionHandle {
#define show(x)
#define show(x)
#endif
#endif
#if defined(_MSC_VER) && defined(_DLL)
# pragma warning(disable:4232)
/* MSVC extension, dllimport identity */
#endif
curl_malloc_callback
Curl_cmalloc
=
(
curl_malloc_callback
)
malloc
;
curl_malloc_callback
Curl_cmalloc
=
(
curl_malloc_callback
)
malloc
;
curl_free_callback
Curl_cfree
=
(
curl_free_callback
)
free
;
curl_free_callback
Curl_cfree
=
(
curl_free_callback
)
free
;
curl_realloc_callback
Curl_crealloc
=
(
curl_realloc_callback
)
realloc
;
curl_realloc_callback
Curl_crealloc
=
(
curl_realloc_callback
)
realloc
;
curl_strdup_callback
Curl_cstrdup
=
(
curl_strdup_callback
)
strdup
;
curl_strdup_callback
Curl_cstrdup
=
(
curl_strdup_callback
)
strdup
;
curl_calloc_callback
Curl_ccalloc
=
(
curl_calloc_callback
)
calloc
;
curl_calloc_callback
Curl_ccalloc
=
(
curl_calloc_callback
)
calloc
;
#if defined(_MSC_VER) && defined(_DLL)
# pragma warning(default:4232)
/* MSVC extension, dllimport identity */
#endif
static
static
char
*
appendstring
(
char
*
string
,
/* original string */
char
*
appendstring
(
char
*
string
,
/* original string */
char
*
buffer
,
/* to append */
char
*
buffer
,
/* to append */
...
...
This diff is collapsed.
Click to expand it.
tests/server/tftp.h
+
7
−
7
View file @
4d10c96a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
* \___|\___/|_| \_\_____|
*
*
* Copyright (C) 1998 - 200
7
, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 200
8
, Daniel Stenberg, <daniel@haxx.se>, et al.
*
*
* This software is licensed as described in the file COPYING, which
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* you should have received as part of this distribution. The terms
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
/* This file is a rewrite/clone of the arpa/tftp.h file for systems without
/* This file is a rewrite/clone of the arpa/tftp.h file for systems without
it. */
it. */
#define
SEGSIZE 512
/* data segment size */
#define
SEGSIZE 512
/* data segment size */
#ifndef __GNUC__
#ifndef __GNUC__
#define __attribute__(x)
#define __attribute__(x)
...
@@ -46,11 +46,11 @@ struct tftphdr {
...
@@ -46,11 +46,11 @@ struct tftphdr {
#define th_code th_block
#define th_code th_block
#define th_msg th_data
#define th_msg th_data
#define RRQ 1
#define
opcode_
RRQ 1
#define WRQ 2
#define
opcode_
WRQ 2
#define DATA 3
#define
opcode_
DATA 3
#define ACK 4
#define
opcode_
ACK 4
#define ERROR 5
#define
opcode_
ERROR 5
#define EUNDEF 0
#define EUNDEF 0
#define ENOTFOUND 1
#define ENOTFOUND 1
...
...
This diff is collapsed.
Click to expand it.
tests/server/tftpd.c
+
11
−
11
View file @
4d10c96a
...
@@ -552,7 +552,7 @@ int main(int argc, char **argv)
...
@@ -552,7 +552,7 @@ int main(int argc, char **argv)
tp
=
(
struct
tftphdr
*
)
buf
;
tp
=
(
struct
tftphdr
*
)
buf
;
tp
->
th_opcode
=
ntohs
(
tp
->
th_opcode
);
tp
->
th_opcode
=
ntohs
(
tp
->
th_opcode
);
if
(
tp
->
th_opcode
==
RRQ
||
tp
->
th_opcode
==
WRQ
)
{
if
(
tp
->
th_opcode
==
opcode_
RRQ
||
tp
->
th_opcode
==
opcode_
WRQ
)
{
memset
(
&
test
,
0
,
sizeof
(
test
));
memset
(
&
test
,
0
,
sizeof
(
test
));
if
(
tftp
(
&
test
,
tp
,
n
)
<
0
)
if
(
tftp
(
&
test
,
tp
,
n
)
<
0
)
break
;
break
;
...
@@ -635,7 +635,7 @@ again:
...
@@ -635,7 +635,7 @@ again:
nak
(
ecode
);
nak
(
ecode
);
return
1
;
return
1
;
}
}
if
(
tp
->
th_opcode
==
WRQ
)
if
(
tp
->
th_opcode
==
opcode_
WRQ
)
recvtftp
(
test
,
pf
);
recvtftp
(
test
,
pf
);
else
else
sendtftp
(
test
,
pf
);
sendtftp
(
test
,
pf
);
...
@@ -777,7 +777,7 @@ static void sendtftp(struct testcase *test, struct formats *pf)
...
@@ -777,7 +777,7 @@ static void sendtftp(struct testcase *test, struct formats *pf)
nak
(
ERRNO
+
100
);
nak
(
ERRNO
+
100
);
return
;
return
;
}
}
sdp
->
th_opcode
=
htons
((
u_short
)
DATA
);
sdp
->
th_opcode
=
htons
((
u_short
)
opcode_
DATA
);
sdp
->
th_block
=
htons
((
u_short
)
sendblock
);
sdp
->
th_block
=
htons
((
u_short
)
sendblock
);
timeout
=
0
;
timeout
=
0
;
#ifdef HAVE_SIGSETJMP
#ifdef HAVE_SIGSETJMP
...
@@ -804,12 +804,12 @@ static void sendtftp(struct testcase *test, struct formats *pf)
...
@@ -804,12 +804,12 @@ static void sendtftp(struct testcase *test, struct formats *pf)
sap
->
th_opcode
=
ntohs
((
u_short
)
sap
->
th_opcode
);
sap
->
th_opcode
=
ntohs
((
u_short
)
sap
->
th_opcode
);
sap
->
th_block
=
ntohs
((
u_short
)
sap
->
th_block
);
sap
->
th_block
=
ntohs
((
u_short
)
sap
->
th_block
);
if
(
sap
->
th_opcode
==
ERROR
)
{
if
(
sap
->
th_opcode
==
opcode_
ERROR
)
{
logmsg
(
"got ERROR"
);
logmsg
(
"got ERROR"
);
return
;
return
;
}
}
if
(
sap
->
th_opcode
==
ACK
)
{
if
(
sap
->
th_opcode
==
opcode_
ACK
)
{
if
(
sap
->
th_block
==
sendblock
)
{
if
(
sap
->
th_block
==
sendblock
)
{
break
;
break
;
}
}
...
@@ -848,7 +848,7 @@ static void recvtftp(struct testcase *test, struct formats *pf)
...
@@ -848,7 +848,7 @@ static void recvtftp(struct testcase *test, struct formats *pf)
rap
=
(
struct
tftphdr
*
)
ackbuf
;
rap
=
(
struct
tftphdr
*
)
ackbuf
;
do
{
do
{
timeout
=
0
;
timeout
=
0
;
rap
->
th_opcode
=
htons
((
u_short
)
ACK
);
rap
->
th_opcode
=
htons
((
u_short
)
opcode_
ACK
);
rap
->
th_block
=
htons
((
u_short
)
recvblock
);
rap
->
th_block
=
htons
((
u_short
)
recvblock
);
recvblock
++
;
recvblock
++
;
#ifdef HAVE_SIGSETJMP
#ifdef HAVE_SIGSETJMP
...
@@ -874,9 +874,9 @@ send_ack:
...
@@ -874,9 +874,9 @@ send_ack:
}
}
rdp
->
th_opcode
=
ntohs
((
u_short
)
rdp
->
th_opcode
);
rdp
->
th_opcode
=
ntohs
((
u_short
)
rdp
->
th_opcode
);
rdp
->
th_block
=
ntohs
((
u_short
)
rdp
->
th_block
);
rdp
->
th_block
=
ntohs
((
u_short
)
rdp
->
th_block
);
if
(
rdp
->
th_opcode
==
ERROR
)
if
(
rdp
->
th_opcode
==
opcode_
ERROR
)
goto
abort
;
goto
abort
;
if
(
rdp
->
th_opcode
==
DATA
)
{
if
(
rdp
->
th_opcode
==
opcode_
DATA
)
{
if
(
rdp
->
th_block
==
recvblock
)
{
if
(
rdp
->
th_block
==
recvblock
)
{
break
;
/* normal */
break
;
/* normal */
}
}
...
@@ -898,7 +898,7 @@ send_ack:
...
@@ -898,7 +898,7 @@ send_ack:
}
while
(
size
==
SEGSIZE
);
}
while
(
size
==
SEGSIZE
);
write_behind
(
test
,
pf
->
f_convert
);
write_behind
(
test
,
pf
->
f_convert
);
rap
->
th_opcode
=
htons
((
u_short
)
ACK
);
/* send the "final" ack */
rap
->
th_opcode
=
htons
((
u_short
)
opcode_
ACK
);
/* send the "final" ack */
rap
->
th_block
=
htons
((
u_short
)
recvblock
);
rap
->
th_block
=
htons
((
u_short
)
recvblock
);
(
void
)
swrite
(
peer
,
ackbuf
,
4
);
(
void
)
swrite
(
peer
,
ackbuf
,
4
);
#if defined(HAVE_ALARM) && defined(SIGALRM)
#if defined(HAVE_ALARM) && defined(SIGALRM)
...
@@ -910,7 +910,7 @@ send_ack:
...
@@ -910,7 +910,7 @@ send_ack:
alarm
(
0
);
alarm
(
0
);
#endif
#endif
if
(
n
>=
4
&&
/* if read some data */
if
(
n
>=
4
&&
/* if read some data */
rdp
->
th_opcode
==
DATA
&&
/* and got a data block */
rdp
->
th_opcode
==
opcode_
DATA
&&
/* and got a data block */
recvblock
==
rdp
->
th_block
)
{
/* then my last ack was lost */
recvblock
==
rdp
->
th_block
)
{
/* then my last ack was lost */
(
void
)
swrite
(
peer
,
ackbuf
,
4
);
/* resend final ack */
(
void
)
swrite
(
peer
,
ackbuf
,
4
);
/* resend final ack */
}
}
...
@@ -945,7 +945,7 @@ static void nak(int error)
...
@@ -945,7 +945,7 @@ static void nak(int error)
struct
errmsg
*
pe
;
struct
errmsg
*
pe
;
tp
=
(
struct
tftphdr
*
)
buf
;
tp
=
(
struct
tftphdr
*
)
buf
;
tp
->
th_opcode
=
htons
((
u_short
)
ERROR
);
tp
->
th_opcode
=
htons
((
u_short
)
opcode_
ERROR
);
tp
->
th_code
=
htons
((
u_short
)
error
);
tp
->
th_code
=
htons
((
u_short
)
error
);
for
(
pe
=
errmsgs
;
pe
->
e_code
>=
0
;
pe
++
)
for
(
pe
=
errmsgs
;
pe
->
e_code
>=
0
;
pe
++
)
if
(
pe
->
e_code
==
error
)
if
(
pe
->
e_code
==
error
)
...
...
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