|
Lines 31-36
Link Here
|
| 31 |
#include <ctype.h> /* isdigit() for ne_parse_statusline */ |
31 |
#include <ctype.h> /* isdigit() for ne_parse_statusline */ |
| 32 |
|
32 |
|
| 33 |
#include "ne_utils.h" |
33 |
#include "ne_utils.h" |
|
|
34 |
#include "ne_alloc.h" |
| 34 |
|
35 |
|
| 35 |
#include "ne_dates.h" |
36 |
#include "ne_dates.h" |
| 36 |
|
37 |
|
|
Lines 129-134
int ne_supports_ssl(void)
Link Here
|
| 129 |
#endif |
129 |
#endif |
| 130 |
} |
130 |
} |
| 131 |
|
131 |
|
|
|
132 |
/* Cleanse 'str' of non-printable characters. Duplicated in |
| 133 |
* ne_session.c for the duration of neon 0.23.x to prevent ABI |
| 134 |
* change. */ |
| 135 |
static char *cleanse(char *str) |
| 136 |
{ |
| 137 |
char *pnt; |
| 138 |
for (pnt = str; *pnt; pnt++) |
| 139 |
if (iscntrl(*pnt) || !isprint(*pnt)) *pnt = ' '; |
| 140 |
return str; |
| 141 |
} |
| 142 |
|
| 132 |
int ne_parse_statusline(const char *status_line, ne_status *st) |
143 |
int ne_parse_statusline(const char *status_line, ne_status *st) |
| 133 |
{ |
144 |
{ |
| 134 |
const char *part; |
145 |
const char *part; |
|
Lines 177-183
int ne_parse_statusline(const char *stat
Link Here
|
| 177 |
/* Fill in the results */ |
188 |
/* Fill in the results */ |
| 178 |
st->major_version = major; |
189 |
st->major_version = major; |
| 179 |
st->minor_version = minor; |
190 |
st->minor_version = minor; |
| 180 |
st->reason_phrase = part; |
191 |
st->reason_phrase = cleanse(ne_strdup(part)); |
| 181 |
st->code = status_code; |
192 |
st->code = status_code; |
| 182 |
st->klass = klass; |
193 |
st->klass = klass; |
| 183 |
return 0; |
194 |
return 0; |