NetSurf
Data Structures | Functions
challenge.c File Reference
#include <stdlib.h>
#include "utils/http.h"
#include "utils/http/challenge_internal.h"
#include "utils/http/generics.h"
#include "utils/http/parameter_internal.h"
#include "utils/http/primitives.h"
Include dependency graph for challenge.c:

Go to the source code of this file.

Data Structures

struct  http_challenge
 Representation of an HTTP challenge. More...
 

Functions

static void http_destroy_challenge (http_challenge *self)
 Destroy an HTTP challenge. More...
 
nserror http__parse_challenge (const char **input, http_challenge **challenge)
 Parse an HTTP challenge. More...
 
const http_challengehttp_challenge_list_iterate (const http_challenge *cur, lwc_string **scheme, http_parameter **parameters)
 Iterate over a challenge list. More...
 
void http_challenge_list_destroy (http_challenge *list)
 Destroy a list of HTTP challenges. More...
 

Function Documentation

◆ http__parse_challenge()

nserror http__parse_challenge ( const char **  input,
http_challenge **  challenge 
)

Parse an HTTP challenge.

Parameters
inputPointer to current input byte. Updated on exit.
challengePointer to location to receive challenge
Returns
NSERROR_OK on success, NSERROR_NOMEM on memory exhaustion, NSERROR_NOT_FOUND if no parameter could be parsed

The returned challenge is owned by the caller.

Definition at line 61 of file challenge.c.

References HTTP__ITEM_INIT, http__item_list_parse, http__parse_parameter(), http__parse_token(), http__skip_LWS(), http_destroy_challenge(), http_parameter_list_destroy(), NSERROR_NOMEM, NSERROR_NOT_FOUND, NSERROR_OK, and result.

Referenced by http_parse_www_authenticate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ http_challenge_list_destroy()

void http_challenge_list_destroy ( http_challenge list)

Destroy a list of HTTP challenges.

Parameters
listList to destroy

Definition at line 136 of file challenge.c.

References http__item_list_destroy.

Referenced by http_parse_www_authenticate(), and http_www_authenticate_destroy().

Here is the caller graph for this function:

◆ http_challenge_list_iterate()

const http_challenge * http_challenge_list_iterate ( const http_challenge cur,
lwc_string **  scheme,
http_parameter **  parameters 
)

Iterate over a challenge list.

Parameters
curPointer to current iteration position, list head to start
schemePointer to location to receive challenge scheme
parametersPointer to location to receive challenge parameters
Returns
Pointer to next iteration position, or NULL for end of iteration

Definition at line 123 of file challenge.c.

References http_challenge::base, http__item::next, http_challenge::params, and http_challenge::scheme.

◆ http_destroy_challenge()

static void http_destroy_challenge ( http_challenge self)
static

Destroy an HTTP challenge.

Parameters
selfChallenge to destroy

Definition at line 43 of file challenge.c.

References http_parameter_list_destroy(), http_challenge::params, and http_challenge::scheme.

Referenced by http__parse_challenge().

Here is the call graph for this function:
Here is the caller graph for this function: