File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ typedef struct _swHttpRequest
53
53
uint8_t version ;
54
54
uint8_t opcode ;
55
55
uint8_t excepted ;
56
- uint8_t keep_alive : 1 ;
56
+ uint8_t keep_alive ;
57
57
58
58
uint32_t url_offset ;
59
59
uint32_t url_length ;
Original file line number Diff line number Diff line change @@ -205,13 +205,15 @@ void swHttpRequest_free(swConnection *conn)
205
205
int swHttpRequest_get_header_info (swHttpRequest * request )
206
206
{
207
207
swString * buffer = request -> buffer ;
208
+ // header field start
208
209
char * buf = buffer -> str + buffer -> offset ;
209
210
210
- //point-end: start + strlen(header) without strlen("\r\n\r\n")
211
- char * pe = buf + request -> header_length - 4 ;
211
+ //point-end: start + strlen(all- header) without strlen("\r\n\r\n")
212
+ char * pe = buffer -> str + request -> header_length - 4 ;
212
213
char * p ;
213
214
uint8_t got_len = 0 ;
214
215
216
+ * (pe ) = '\0' ;
215
217
for (p = buf + 1 ; p < pe ; p ++ )
216
218
{
217
219
if (* p == '\n' && * (p - 1 ) == '\r' )
@@ -245,6 +247,7 @@ int swHttpRequest_get_header_info(swHttpRequest *request)
245
247
}
246
248
}
247
249
}
250
+ * (pe ) = '\r' ;
248
251
249
252
return got_len ? SW_OK : SW_ERR ;
250
253
}
You can’t perform that action at this time.
0 commit comments