Logo Search packages:      
Sourcecode: rapple version File versions  Download package

static void http_create_parameter ( rpl_c_str_t  key,
rpl_c_str_t  value 
) [static]

Populates the form data structure with the key/value pair.

Parameters:
key 
value 

Definition at line 347 of file http.c.

References rpl_me_malloc().

Referenced by http_parse_multipart_string().

                                                          {
    size_t klen, vlen;
    rpl_http_form_data *temp;

    assert((key != NULL) && (value != NULL));

    temp = (rpl_http_form_data *)rpl_me_malloc(sizeof(rpl_http_form_data));

    /* copy the key and value data */
    klen = strlen(key) + 1;
    temp->key = (rpl_str_t)rpl_me_malloc(klen);
    snprintf(temp->key, klen, "%s", key);
    vlen = strlen(value) + 1;
    temp->value= (rpl_str_t)rpl_me_malloc(vlen);
    snprintf(temp->value, vlen, "%s", value);

    /* TODO: has the protocol been incorrectly implemented ? */
    if((temp->value)[vlen - 3] == '\r')
        temp->value[vlen - 3] = '\0';

    temp->next = data.next;
    data.next = temp;
}


Generated by  Doxygen 1.6.0   Back to index