Commit 4a075de846cf420a9dffb0ee25401d5d4002dc5b

Authored by Georg Hopp
1 parent 3dac803c

fix bug that arose in rewrite of header get and results in an ugly memory leak, …

…as well as no headers would be found any more
  1 +2012-02-10 05:52:50 +0100 Georg Hopp
  2 +
  3 + * fix bug that arose in rewrite of header get and results in an ugly memory leak, as well as no headers would be found any more (HEAD, master)
  4 +
  5 +2012-02-10 00:27:51 +0100 Georg Hopp
  6 +
  7 + * fix memory leak created while changing things
  8 +
1 2012-02-09 22:39:08 +0100 Georg Hopp 9 2012-02-09 22:39:08 +0100 Georg Hopp
2 10
3 - * updated docs (HEAD, master) 11 + * updated docs
4 12
5 2012-02-09 22:34:32 +0100 Georg Hopp 13 2012-02-09 22:34:32 +0100 Georg Hopp
6 14
@@ -35,7 +35,7 @@ httpHeaderGet(const HttpHeader header[], int nheader, const char * name) @@ -35,7 +35,7 @@ httpHeaderGet(const HttpHeader header[], int nheader, const char * name)
35 35
36 found = bsearch(&hash, header, nheader, sizeof(HttpHeader), comp); 36 found = bsearch(&hash, header, nheader, sizeof(HttpHeader), comp);
37 37
38 - return (NULL != *found)? (*found)->value : NULL; 38 + return (NULL != found)? (*found)->value : NULL;
39 } 39 }
40 40
41 // vim: set ts=4 sw=4: 41 // vim: set ts=4 sw=4:
  1 +#include <stdlib.h>
  2 +
1 #include "http/header.h" 3 #include "http/header.h"
2 4
3 static 5 static
@@ -13,7 +15,7 @@ comp (const void * _a, const void * _b) @@ -13,7 +15,7 @@ comp (const void * _a, const void * _b)
13 void 15 void
14 httpHeaderSort(const HttpHeader header[], int nheader) 16 httpHeaderSort(const HttpHeader header[], int nheader)
15 { 17 {
16 - qsort(header, nheader, sizeof(HttpHeader), comp); 18 + qsort((void*)header, nheader, sizeof(HttpHeader), comp);
17 } 19 }
18 20
19 // vim: set ts=4 sw=4: 21 // vim: set ts=4 sw=4:
  1 +#include <unistd.h>
1 #include <string.h> 2 #include <string.h>
2 #include <stdlib.h> 3 #include <stdlib.h>
3 #include <sys/types.h> 4 #include <sys/types.h>
@@ -38,6 +38,7 @@ httpRequestSkip(char ** data) @@ -38,6 +38,7 @@ httpRequestSkip(char ** data)
38 } 38 }
39 39
40 void httpRequestParserGetRequestLine(HttpRequest, char *); 40 void httpRequestParserGetRequestLine(HttpRequest, char *);
  41 +void httpRequestParserGetHeader(HttpRequest, char *);
41 42
42 void 43 void
43 httpRequestParserParse(HttpRequestParser this) 44 httpRequestParserParse(HttpRequestParser this)
Please register or login to post a comment