Skip to content

Commit 0e6dc6c

Browse files
committed
Fix wrong behaviour when HTTP server gets not supported method.
1 parent f60c715 commit 0e6dc6c

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

fnet_stack/service/http/fnet_http_srv.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,14 @@ static fnet_return_t _fnet_http_srv_tx_status_line (struct fnet_http_srv_if *htt
942942
}
943943
#endif
944944

945-
session->response.tx_data = session->request.method->send;
945+
if(session->request.method && session->request.method->send)
946+
{
947+
session->response.tx_data = session->request.method->send;
948+
}
949+
else
950+
{
951+
session->response.send_eof = FNET_TRUE; /* Only sataus (without data).*/
952+
}
946953
break;
947954
default:
948955
break;

fnet_stack/stack/fnet_stdlib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,11 +685,11 @@ fnet_int32_t fnet_strcmp_splitter( const fnet_char_t *in_str, const fnet_char_t
685685

686686
while (*s2p == ' ')
687687
{
688-
s1p++; /* Strip leading spaces */
688+
s2p++; /* Strip leading spaces */
689689
}
690690
while (*s2p == splitter)
691691
{
692-
s1p++; /* Strip heading slash */
692+
s2p++; /* Strip heading slash */
693693
}
694694

695695
while (*s1p == ' ')

0 commit comments

Comments
 (0)