1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

cleaned up some picky compiler warnings and indented the code curl style

This commit is contained in:
Daniel Stenberg 2001-08-14 08:32:50 +00:00
parent 95e7e551f6
commit 8e1f95ac7d

View File

@ -73,45 +73,15 @@ static struct {
{ prot_private, "private" }
};
#if 0
static const char *
level_to_name(enum protection_level level)
{
int i;
for(i = 0; i < sizeof(level_names) / sizeof(level_names[0]); i++)
if(level_names[i].level == level)
return level_names[i].name;
return "unknown";
}
#endif
#ifndef FTP_SERVER /* not used in server */
static enum protection_level
name_to_level(const char *name)
{
int i;
for(i = 0; i < sizeof(level_names) / sizeof(level_names[0]); i++)
for(i = 0; i < (int)sizeof(level_names)/(int)sizeof(level_names[0]); i++)
if(!strncasecmp(level_names[i].name, name, strlen(name)))
return level_names[i].level;
return (enum protection_level)-1;
}
#endif
#ifdef FTP_SERVER
static struct sec_server_mech *mechs[] = {
#ifdef KRB5
&gss_server_mech,
#endif
#ifdef KRB4
&krb4_server_mech,
#endif
NULL
};
static struct sec_server_mech *mech;
#else
static struct sec_client_mech *mechs[] = {
#ifdef KRB5
@ -125,8 +95,6 @@ static struct sec_client_mech *mechs[] = {
static struct sec_client_mech *mech;
#endif
int
sec_getc(struct connectdata *conn, FILE *F)
{
@ -135,7 +103,8 @@ sec_getc(struct connectdata *conn, FILE *F)
if(sec_read(conn, fileno(F), &c, 1) <= 0)
return EOF;
return c;
} else
}
else
return getc(F);
}
@ -173,7 +142,7 @@ block_write(int fd, void *buf, size_t len)
static int
sec_get_data(struct connectdata *conn,
int fd, struct krb4buffer *buf, int level)
int fd, struct krb4buffer *buf)
{
int len;
int b;
@ -244,7 +213,7 @@ sec_read(struct connectdata *conn, int fd, void *buffer, int length)
buffer = (char*)buffer + len;
while(length) {
if(sec_get_data(conn, fd, &conn->in_buffer, conn->data_prot) < 0)
if(sec_get_data(conn, fd, &conn->in_buffer) < 0)
return -1;
if(conn->in_buffer.size == 0) {
if(rx)
@ -474,7 +443,7 @@ sec_prot_internal(struct connectdata *conn, int level)
{
char *p;
unsigned int s = 1048576;
size_t nread;
ssize_t nread;
if(!conn->sec_complete){
infof(conn->data, "No security data exchange has taken place.\n");
@ -577,7 +546,7 @@ sec_set_protection_level(struct connectdata *conn)
int
sec_request_prot(struct connectdata *conn, char *level)
sec_request_prot(struct connectdata *conn, const char *level)
{
int l = name_to_level(level);
if(l == -1)
@ -591,7 +560,7 @@ sec_login(struct connectdata *conn)
{
int ret;
struct sec_client_mech **m;
size_t nread;
ssize_t nread;
struct UrlData *data=conn->data;
for(m = mechs; *m && (*m)->name; m++) {