Minor cleanup

This commit is contained in:
twinaphex 2020-08-11 06:35:12 +02:00
parent c7f839a7fd
commit 4092fd7e83

View File

@ -327,10 +327,7 @@ bool net_http_connection_done(struct http_connection_t *conn)
{
int has_port = 0;
if (!conn)
return false;
if (!conn->domain || !*conn->domain)
if (!conn || !conn->domain || !*conn->domain)
return false;
if (*conn->scan == ':')
@ -394,12 +391,10 @@ bool net_http_connection_done(struct http_connection_t *conn)
return true;
}
else
{
/* invalid character after domain/port */
return false;
}
}
void net_http_connection_free(struct http_connection_t *conn)
{
@ -430,7 +425,8 @@ void net_http_connection_free(struct http_connection_t *conn)
free(conn);
}
void net_http_connection_set_user_agent(struct http_connection_t* conn, const char* user_agent)
void net_http_connection_set_user_agent(
struct http_connection_t* conn, const char* user_agent)
{
if (conn->useragentcopy)
free(conn->useragentcopy);