/[osn-commons]/trunk/freehttpd/request.c
ViewVC logotype

Diff of /trunk/freehttpd/request.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 45 by rakinar2, Sun Aug 11 17:35:46 2024 UTC revision 46 by rakinar2, Mon Aug 12 16:55:32 2024 UTC
# Line 47  freehttpd_header_init (const char *name, Line 47  freehttpd_header_init (const char *name,
47      if (header == NULL)      if (header == NULL)
48          return NULL;          return NULL;
49    
50        freehttpd_header_t on_stack
51            = freehttpd_header_init_stack (name, value, name_length, value_length);
52        memcpy (header, &on_stack, sizeof (freehttpd_header_t));
53    
54        return header;
55    }
56    
57    freehttpd_header_t
58    freehttpd_header_init_stack (const char *name, const char *value,
59                                 size_t name_length, size_t value_length)
60    {
61        freehttpd_header_t header = { 0 };
62    
63      if (name != NULL)      if (name != NULL)
64          {          {
65              header->name = strdup (name);              header.name = strdup (name);
66              header->name_length              header.name_length = name_length == 0 ? strlen (name) : name_length;
                 = name_length == 0 ? strlen (name) : name_length;  
67          }          }
68    
69      if (value != NULL)      if (value != NULL)
70          {          {
71              header->value = strdup (value);              header.value = strdup (value);
72              header->value_length              header.value_length
73                  = value_length == 0 ? strlen (value) : value_length;                  = value_length == 0 ? strlen (value) : value_length;
74          }          }
75    

Legend:
Removed from v.45  
changed lines
  Added in v.46

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26