mirror of
https://github.com/curl/curl.git
synced 2026-08-25 05:23:32 +03:00
tests: tidy up types in server code
Cherry-picked from #13489 Closes #13610
This commit is contained in:
parent
7333faf00b
commit
0c49ea4ff2
7 changed files with 29 additions and 29 deletions
|
|
@ -241,7 +241,8 @@ static int synchnet(curl_socket_t);
|
|||
|
||||
static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size);
|
||||
|
||||
static int validate_access(struct testcase *test, const char *fname, int mode);
|
||||
static int validate_access(struct testcase *test,
|
||||
const char *filename, unsigned short mode);
|
||||
|
||||
static void sendtftp(struct testcase *test, const struct formats *pf);
|
||||
|
||||
|
|
@ -1073,7 +1074,7 @@ static int parse_servercmd(struct testcase *req)
|
|||
* Validate file access.
|
||||
*/
|
||||
static int validate_access(struct testcase *test,
|
||||
const char *filename, int mode)
|
||||
const char *filename, unsigned short mode)
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
|
|
@ -1183,7 +1184,7 @@ static void sendtftp(struct testcase *test, const struct formats *pf)
|
|||
nak(errno + 100);
|
||||
return;
|
||||
}
|
||||
sdp->th_opcode = htons((unsigned short)opcode_DATA);
|
||||
sdp->th_opcode = htons(opcode_DATA);
|
||||
sdp->th_block = htons(sendblock);
|
||||
timeout = 0;
|
||||
#ifdef HAVE_SIGSETJMP
|
||||
|
|
@ -1218,7 +1219,7 @@ send_data:
|
|||
logmsg("read: fail");
|
||||
return;
|
||||
}
|
||||
sap->th_opcode = ntohs((unsigned short)sap->th_opcode);
|
||||
sap->th_opcode = ntohs(sap->th_opcode);
|
||||
sap->th_block = ntohs(sap->th_block);
|
||||
|
||||
if(sap->th_opcode == opcode_ERROR) {
|
||||
|
|
@ -1261,7 +1262,7 @@ static void recvtftp(struct testcase *test, const struct formats *pf)
|
|||
rap = &ackbuf.hdr;
|
||||
do {
|
||||
timeout = 0;
|
||||
rap->th_opcode = htons((unsigned short)opcode_ACK);
|
||||
rap->th_opcode = htons(opcode_ACK);
|
||||
rap->th_block = htons(recvblock);
|
||||
recvblock++;
|
||||
#ifdef HAVE_SIGSETJMP
|
||||
|
|
@ -1290,7 +1291,7 @@ send_ack:
|
|||
logmsg("read: fail");
|
||||
goto abort;
|
||||
}
|
||||
rdp->th_opcode = ntohs((unsigned short)rdp->th_opcode);
|
||||
rdp->th_opcode = ntohs(rdp->th_opcode);
|
||||
rdp->th_block = ntohs(rdp->th_block);
|
||||
if(rdp->th_opcode == opcode_ERROR)
|
||||
goto abort;
|
||||
|
|
@ -1321,8 +1322,7 @@ send_ack:
|
|||
test->ofile = 0;
|
||||
}
|
||||
|
||||
rap->th_opcode = htons((unsigned short)opcode_ACK); /* send the "final"
|
||||
ack */
|
||||
rap->th_opcode = htons(opcode_ACK); /* send the "final" ack */
|
||||
rap->th_block = htons(recvblock);
|
||||
(void) swrite(peer, &ackbuf.storage[0], 4);
|
||||
#if defined(HAVE_ALARM) && defined(SIGALRM)
|
||||
|
|
@ -1361,7 +1361,7 @@ static void nak(int error)
|
|||
struct errmsg *pe;
|
||||
|
||||
tp = &buf.hdr;
|
||||
tp->th_opcode = htons((unsigned short)opcode_ERROR);
|
||||
tp->th_opcode = htons(opcode_ERROR);
|
||||
tp->th_code = htons((unsigned short)error);
|
||||
for(pe = errmsgs; pe->e_code >= 0; pe++)
|
||||
if(pe->e_code == error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue