mirror of
https://github.com/lammertb/libhttp.git
synced 2025-08-12 01:22:40 +03:00
Removed httplib_fc fake context
This commit is contained in:
@@ -55,7 +55,7 @@ static int url_encoded_field_found(const struct httplib_connection *conn,
|
||||
* Log error message and skip this field.
|
||||
*/
|
||||
|
||||
httplib_cry( conn, "%s: Cannot decode filename", __func__ );
|
||||
httplib_cry( conn->ctx, conn, "%s: Cannot decode filename", __func__ );
|
||||
return FORM_FIELD_STORAGE_SKIP;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ static int url_encoded_field_found(const struct httplib_connection *conn,
|
||||
|
||||
if ( fdh->field_get == NULL ) {
|
||||
|
||||
httplib_cry( conn, "%s: Function \"Get\" not available", __func__ );
|
||||
httplib_cry( conn->ctx, conn, "%s: Function \"Get\" not available", __func__ );
|
||||
return FORM_FIELD_STORAGE_SKIP;
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,7 @@ static int url_encoded_field_found(const struct httplib_connection *conn,
|
||||
|
||||
if ( fdh->field_store == NULL ) {
|
||||
|
||||
httplib_cry( conn, "%s: Function \"Store\" not available", __func__ );
|
||||
httplib_cry( conn->ctx, conn, "%s: Function \"Store\" not available", __func__ );
|
||||
return FORM_FIELD_STORAGE_SKIP;
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ static int url_encoded_field_get(const struct httplib_connection *conn,
|
||||
* Log error message and stop parsing the form data.
|
||||
*/
|
||||
|
||||
httplib_cry(conn, "%s: Not enough memory (required: %lu)", __func__, (unsigned long)(value_len + 1));
|
||||
httplib_cry( conn->ctx, conn, "%s: Not enough memory (required: %lu)", __func__, (unsigned long)(value_len + 1));
|
||||
return FORM_FIELD_STORAGE_ABORT;
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ int httplib_handle_form_request(struct httplib_connection *conn, struct httplib_
|
||||
|
||||
size_t n = (size_t)fwrite(val, 1, (size_t)vallen, fstore.fp);
|
||||
if ((n != (size_t)vallen) || (ferror(fstore.fp))) {
|
||||
httplib_cry( conn, "%s: Cannot write file %s", __func__, path );
|
||||
httplib_cry( conn->ctx, conn, "%s: Cannot write file %s", __func__, path );
|
||||
fclose( fstore.fp );
|
||||
fstore.fp = NULL;
|
||||
XX_httplib_remove_bad_file( conn, path );
|
||||
@@ -303,14 +303,14 @@ int httplib_handle_form_request(struct httplib_connection *conn, struct httplib_
|
||||
}
|
||||
|
||||
else {
|
||||
httplib_cry( conn, "%s: Error saving file %s", __func__, path );
|
||||
httplib_cry( conn->ctx, conn, "%s: Error saving file %s", __func__, path );
|
||||
XX_httplib_remove_bad_file( conn, path );
|
||||
}
|
||||
|
||||
fstore.fp = NULL;
|
||||
}
|
||||
|
||||
} else httplib_cry( conn, "%s: Cannot create file %s", __func__, path );
|
||||
} else httplib_cry( conn->ctx, conn, "%s: Cannot create file %s", __func__, path );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -411,7 +411,7 @@ int httplib_handle_form_request(struct httplib_connection *conn, struct httplib_
|
||||
|
||||
if (XX_httplib_fopen(conn, path, "wb", &fstore) == 0) fstore.fp = NULL;
|
||||
file_size = 0;
|
||||
if (!fstore.fp) httplib_cry(conn, "%s: Cannot create file %s", __func__, path);
|
||||
if (!fstore.fp) httplib_cry( conn->ctx, conn, "%s: Cannot create file %s", __func__, path);
|
||||
}
|
||||
|
||||
get_block = 0;
|
||||
@@ -456,7 +456,7 @@ int httplib_handle_form_request(struct httplib_connection *conn, struct httplib_
|
||||
if ( fstore.fp ) {
|
||||
size_t n = (size_t)fwrite(val, 1, (size_t)vallen, fstore.fp);
|
||||
if ((n != (size_t)vallen) || (ferror(fstore.fp))) {
|
||||
httplib_cry(conn, "%s: Cannot write file %s", __func__, path);
|
||||
httplib_cry( conn->ctx, conn, "%s: Cannot write file %s", __func__, path);
|
||||
fclose(fstore.fp);
|
||||
fstore.fp = NULL;
|
||||
XX_httplib_remove_bad_file(conn, path);
|
||||
@@ -507,7 +507,7 @@ int httplib_handle_form_request(struct httplib_connection *conn, struct httplib_
|
||||
}
|
||||
|
||||
else {
|
||||
httplib_cry( conn, "%s: Error saving file %s", __func__, path );
|
||||
httplib_cry( conn->ctx, conn, "%s: Error saving file %s", __func__, path );
|
||||
XX_httplib_remove_bad_file( conn, path );
|
||||
}
|
||||
|
||||
@@ -709,7 +709,7 @@ int httplib_handle_form_request(struct httplib_connection *conn, struct httplib_
|
||||
if ( XX_httplib_fopen( conn, path, "wb", &fstore ) == 0 ) fstore.fp = NULL;
|
||||
file_size = 0;
|
||||
|
||||
if ( ! fstore.fp ) httplib_cry( conn, "%s: Cannot create file %s", __func__, path );
|
||||
if ( ! fstore.fp ) httplib_cry( conn->ctx, conn, "%s: Cannot create file %s", __func__, path );
|
||||
}
|
||||
|
||||
get_block = 0;
|
||||
@@ -753,7 +753,7 @@ int httplib_handle_form_request(struct httplib_connection *conn, struct httplib_
|
||||
|
||||
if ( n != towrite || ferror( fstore.fp ) ) {
|
||||
|
||||
httplib_cry( conn, "%s: Cannot write file %s", __func__, path );
|
||||
httplib_cry( conn->ctx, conn, "%s: Cannot write file %s", __func__, path );
|
||||
fclose( fstore.fp );
|
||||
fstore.fp = NULL;
|
||||
XX_httplib_remove_bad_file( conn, path );
|
||||
@@ -809,7 +809,7 @@ int httplib_handle_form_request(struct httplib_connection *conn, struct httplib_
|
||||
|
||||
if ( n != towrite || ferror( fstore.fp ) ) {
|
||||
|
||||
httplib_cry( conn, "%s: Cannot write file %s", __func__, path );
|
||||
httplib_cry( conn->ctx, conn, "%s: Cannot write file %s", __func__, path );
|
||||
fclose( fstore.fp );
|
||||
fstore.fp = NULL;
|
||||
XX_httplib_remove_bad_file( conn, path );
|
||||
@@ -833,7 +833,7 @@ int httplib_handle_form_request(struct httplib_connection *conn, struct httplib_
|
||||
}
|
||||
|
||||
else {
|
||||
httplib_cry( conn, "%s: Error saving file %s", __func__, path );
|
||||
httplib_cry( conn->ctx, conn, "%s: Error saving file %s", __func__, path );
|
||||
XX_httplib_remove_bad_file( conn, path );
|
||||
}
|
||||
fstore.fp = NULL;
|
||||
|
Reference in New Issue
Block a user